52 HitsCollection = NULL;
53 sensitiveDetectorName =
name;
76 if (aStep -> GetPreStepPoint() -> GetPhysicalVolume() ->
GetName() !=
"DetectorPhys")
79 G4Track * theTrack = aStep -> GetTrack();
84 G4String particleName = particleDef -> GetParticleName();
87 G4int trackID = theTrack -> GetTrackID();
89 G4double energyDeposit = aStep -> GetTotalEnergyDeposit();
91 G4int Z = particleDef-> GetAtomicNumber();
95 G4int k = ROhist -> GetReplicaNumber(0);
96 G4int i = ROhist -> GetReplicaNumber(2);
97 G4int j = ROhist -> GetReplicaNumber(1);
99 #ifdef G4ANALYSIS_USE_ROOT
110 G4int* hitTrack = matrix -> GetHitTrack(i,j,k);
111 if ( *hitTrack != trackID )
119 matrix ->
Fill(trackID, particleDef, i, j, k, 0,
true);
120 #ifdef G4ANALYSIS_USE_ROOT
139 if(energyDeposit != 0)
149 matrix ->
Fill(trackID, particleDef, i, j, k, energyDeposit);
154 detectorHit -> SetEdepAndPosition(i, j, k, energyDeposit);
155 HitsCollection -> insert(detectorHit);
159 #ifdef G4ANALYSIS_USE_ROOT
160 if(energyDeposit != 0)
164 if (particleName ==
"proton")
165 analysis -> SecondaryProtonEnergyDeposit(i, energyDeposit/CLHEP::MeV);
167 else if (particleName ==
"neutron")
168 analysis -> SecondaryNeutronEnergyDeposit(i, energyDeposit/CLHEP::MeV);
170 else if (particleName ==
"alpha")
171 analysis -> SecondaryAlphaEnergyDeposit(i, energyDeposit/CLHEP::MeV);
173 else if (particleName ==
"gamma")
174 analysis -> SecondaryGammaEnergyDeposit(i, energyDeposit/CLHEP::MeV);
176 else if (particleName ==
"e-")
177 analysis -> SecondaryElectronEnergyDeposit(i, energyDeposit/CLHEP::MeV);
179 else if (particleName ==
"triton")
180 analysis -> SecondaryTritonEnergyDeposit(i, energyDeposit/CLHEP::MeV);
182 else if (particleName ==
"deuteron")
183 analysis -> SecondaryDeuteronEnergyDeposit(i, energyDeposit/CLHEP::MeV);
185 else if (particleName ==
"pi+" || particleName ==
"pi-" || particleName ==
"pi0")
186 analysis -> SecondaryPionEnergyDeposit(i, energyDeposit/CLHEP::MeV);
197 static G4int HCID = -1;
203 HCE -> AddHitsCollection(HCID,HitsCollection);