73 if (aStep -> GetPreStepPoint() -> GetPhysicalVolume() ->
GetName() !=
"RODetectorZDivisionPhys")
return false;
77 G4Track * theTrack = aStep -> GetTrack();
78 G4double kineticEnergy = theTrack -> GetKineticEnergy();
82 G4String particleName = particleDef -> GetParticleName();
87 G4int trackID = theTrack -> GetTrackID();
89 G4double energyDeposit = aStep -> GetTotalEnergyDeposit();
91 G4double DX = aStep -> GetStepLength();
92 G4int Z = particleDef-> GetAtomicNumber();
93 G4int A = particleDef-> GetAtomicMass();
104 #ifdef G4ANALYSIS_USE_ROOT
115 if ( !(Z==0 && A==1) )
117 if( energyDeposit>0. && DX >0. )
121 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i, j, k);
123 else if (kineticEnergy > 50.*
keV)
125 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i , j, k);
142 G4int* hitTrack = matrix -> GetHitTrack(i,j,k);
143 if ( *hitTrack != trackID )
150 if ( Z >= 1) matrix -> Fill(trackID, particleDef, i, j, k, 0,
true);
153 #ifdef G4ANALYSIS_USE_ROOT
172 if(energyDeposit != 0)
182 matrix -> Fill(trackID, particleDef, i, j, k, energyDeposit);
187 detectorHit -> SetEdepAndPosition(i, j, k, energyDeposit);
192 #ifdef G4ANALYSIS_USE_ROOT
193 if(energyDeposit != 0)
197 if (particleName ==
"proton")
198 analysis -> SecondaryProtonEnergyDeposit(i, energyDeposit/
MeV);
200 else if (particleName ==
"neutron")
201 analysis -> SecondaryNeutronEnergyDeposit(i, energyDeposit/
MeV);
203 else if (particleName ==
"alpha")
204 analysis -> SecondaryAlphaEnergyDeposit(i, energyDeposit/
MeV);
206 else if (particleName ==
"gamma")
207 analysis -> SecondaryGammaEnergyDeposit(i, energyDeposit/
MeV);
209 else if (particleName ==
"e-")
210 analysis -> SecondaryElectronEnergyDeposit(i, energyDeposit/
MeV);
212 else if (particleName ==
"triton")
213 analysis -> SecondaryTritonEnergyDeposit(i, energyDeposit/
MeV);
215 else if (particleName ==
"deuteron")
216 analysis -> SecondaryDeuteronEnergyDeposit(i, energyDeposit/
MeV);
218 else if (particleName ==
"pi+" || particleName ==
"pi-" || particleName ==
"pi0")
219 analysis -> SecondaryPionEnergyDeposit(i, energyDeposit/
MeV);
231 static G4int HCID = -1;
static HadrontherapyAnalysisManager * GetInstance()
Get the pointer to the analysis manager.
G4String sensitiveDetectorName
static HadrontherapyLet * GetInstance()
G4int GetPDGEncoding() const
const G4VTouchable * GetTouchable() const
virtual G4int GetCollectionID(G4int i)
G4StepPoint * GetPreStepPoint() const
static HadrontherapyMatrix * GetInstance()
HadrontherapyDetectorSD(G4String name)
void insert(G4String str)
G4THitsCollection< HadrontherapyDetectorHit > HadrontherapyDetectorHitsCollection
static const G4double A[nN]
~HadrontherapyDetectorSD()
virtual G4int GetReplicaNumber(G4int depth=0) const
void Initialize(G4HCofThisEvent *)
A class for connecting the simulation to an analysis package.
HadrontherapyDetectorHitsCollection * HitsCollection
void EndOfEvent(G4HCofThisEvent *HCE)
G4CollectionNameVector collectionName
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)