29 #include "TrackingAction.hh"
35 #include "DetectorConstruction.hh"
57 if(fTargetRegion == 0)
59 fTargetRegion = fDetector->GetTargetRegion();
64 int N = fTargetRegion->GetNumberOfRootVolumes();
65 std::vector<G4LogicalVolume*>::iterator it_logicalVolumeInRegion =
66 fTargetRegion->GetRootLogicalVolumeIterator();
68 bool inside_target =
false;
70 for(
int i = 0; i <
N ; i++, it_logicalVolumeInRegion++)
72 EInside test_status = (*it_logicalVolumeInRegion)->GetSolid()->Inside(position) ;
85 if(inside_target ==
true)
87 fNParticleInTarget[particleDefinition]++;
91 fNParticleInWorld[particleDefinition]++;