Message: How to use ROhist->GetReplicaNumber() ? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None How to use ROhist->GetReplicaNumber() ? 

Forum: Hits, Digitization and Pileup
Date: 21 Apr, 2010
From: Bill <Bill>

Hi,

I have some problems with the HitProcess of my SD. GetReplicaNumber always gets the position of the

*** Here is my SD geometry *** G4VPhysicalVolume* MySDROGeometry::Build() {

	// A dummy material is used to fill the volumes of the readout geometry.
	// (It will be allowed to set a NULL pointer in volumes of such virtual
	// division in future, since this material is irrelevant for tracking.)

	G4Material* dummyMat = new G4Material(name="dummyMat", 
					1., 1.*g/mole, 1.*g/cm3);

	// variables for division ...
	G4double VoxelSizeX = sdROSizeX / numberOfVoxelsAlongX;
	G4double VoxelSizeY = sdROSizeY / numberOfVoxelsAlongY;

	// world volume of ROGeometry ...
	G4Box *ROWorld = new G4Box("ROWorld",
							   worldSizeX,
							   worldSizeY,
							   worldSizeZ);
	G4LogicalVolume *ROWorldLog = new G4LogicalVolume(ROWorld,
													  dummyMat,
													  "ROWorldLog",
													  0, 0, 0);
	G4VPhysicalVolume *ROWorldPhys = new G4PVPlacement(0,
													   G4ThreeVector(),
													   "ROWorldPhys",
													   ROWorldLog,
													   0, false, 0);

	// Detector ROGeometry ... 
	G4Box *DetectorRO = new G4Box("DetectorRO",
								  sdROSizeX,
								  sdROSizeY,
								  sdROSizeZ);
	G4LogicalVolume *DetectorROLog = new G4LogicalVolume(DetectorRO,
														 dummyMat,
														 "DetectorROLog",
														 0, 0, 0);
	G4VPhysicalVolume *DetectorROPhys = new G4PVPlacement(0,
														  G4ThreeVector(0, 0, sdROPosZ),
														  "DetectorROPhys",
														  DetectorROLog,
														  ROWorldPhys,
														  false,0);

	// ROGeometry: Voxel division

	// X division first... 
	G4Box *DetectorROXDivision = new G4Box("DetectorROXDivision",
										   VoxelSizeX,
										   sdROSizeY,
										   sdROSizeZ);
	G4LogicalVolume *DetectorROXDivisionLog = new G4LogicalVolume(DetectorROXDivision,
															      dummyMat,
																  "DetectorROXDivisionLog",
																  0, 0, 0);
	G4VPhysicalVolume *DetectorROXDivisionPhys = new G4PVReplica("DetectorROXDivisionPhys",
																 DetectorROXDivisionLog,
																 DetectorROPhys,
																 kXAxis,
																 numberOfVoxelsAlongX,
																 VoxelSizeX * 2);
	// ...then Y  division

	G4Box *DetectorROYDivision = new G4Box("DetectorROYDivision",
										   VoxelSizeX,
										   VoxelSizeY,
										   sdROSizeZ);
	G4LogicalVolume *DetectorROYDivisionLog = new G4LogicalVolume(DetectorROYDivision,
																  dummyMat,
																  "DetectorROYDivisionLog",
																  0, 0, 0);
	DetectorROYDivisionPhys = new G4PVReplica("DetectorROYDivisionPhys",
											  DetectorROYDivisionLog,
											  DetectorROXDivisionPhys,
											  kYAxis,
											  numberOfVoxelsAlongY,
											  VoxelSizeY * 2);

	MyDummySD *dummySD = new MyDummySD;
	DetectorROYDivisionLog -> SetSensitiveDetector(dummySD);

	return ROWorldPhys;
}

**** Here is my HitProcess **** G4int j = ROhist -> GetReplicaNumber(); G4int i = ROhist -> GetReplicaNumber(1); G4cout << "process hit: replica x " << i << "\treplica y " << j << G4endl;

**** And, here is the output ****

Apparently, the hit occurred at step 4, but the output showed the position (replicas) of step 3.

How do I get the XYZ of step 4?

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    0.555    0.209     9.85     0.141        0        0         0   WorldPhys initStep
    1   -0.365     2.44        1     0.141        0     9.17      9.17    HolePhys Transportation
    2    -0.47     2.69 -9.59e-17     0.141        0     1.04      10.2  CZTDetPhys Transportation
    3   -0.533     2.85   -0.605     0.141        0    0.628      10.8  CZTDetPhys LowEnRayleigh
    4    -4.11     1.66    -3.79     0.105 1.77e-05     4.93      15.8  CZTDetPhys LowEnCompton
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -4.11      1.66     -3.79     0.035                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
process hit: replica x 7        replica y 26
    5    -3.72    0.784     -3.7         0   0.0318    0.963      16.7  CZTDetPhys LowEnPhotoElec
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :     -3.72     0.784      -3.7    0.0736                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
process hit: replica x 3        replica y 25

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: RE: How to use ROhist->GetReplicaNumber() ?   (Asai, Makoto - 21 Apr, 2010)
(_ None: RE: How to use ROhist->GetReplicaNumber() ?   (Cui, Yonggang - 21 Apr, 2010)
 Add Message Add Message
to: "How to use ROhist->GetReplicaNumber() ?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]