47 HitsCollection = NULL;
48 sensitiveDetectorName =
name;
70 if (aStep -> GetPreStepPoint() -> GetPhysicalVolume() ->
GetName() !=
"RODetectorZDivisionPhys")
return false;
74 G4Track * theTrack = aStep -> GetTrack();
75 G4double kineticEnergy = theTrack -> GetKineticEnergy();
79 G4String particleName = particleDef -> GetParticleName();
84 G4int trackID = theTrack -> GetTrackID();
86 G4double energyDeposit = aStep -> GetTotalEnergyDeposit();
88 G4double DX = aStep -> GetStepLength();
89 G4int Z = particleDef-> GetAtomicNumber();
90 G4int A = particleDef-> GetAtomicMass();
101 #ifdef G4ANALYSIS_USE_ROOT
112 if ( !(Z==0 && A==1) )
114 if( energyDeposit>0. && DX >0. )
118 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i, j, k);
120 else if (kineticEnergy > 50.*
keV)
122 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i , j, k);
139 G4int* hitTrack = matrix -> GetHitTrack(i,j,k);
140 if ( *hitTrack != trackID )
147 if ( Z >= 1) matrix -> Fill(trackID, particleDef, i, j, k, 0,
true);
150 #ifdef G4ANALYSIS_USE_ROOT
169 if(energyDeposit != 0)
179 matrix -> Fill(trackID, particleDef, i, j, k, energyDeposit);
184 detectorHit -> SetEdepAndPosition(i, j, k, energyDeposit);
185 HitsCollection -> insert(detectorHit);
189 #ifdef G4ANALYSIS_USE_ROOT
190 if(energyDeposit != 0)
194 if (particleName ==
"proton")
195 analysis -> SecondaryProtonEnergyDeposit(i, energyDeposit/
MeV);
197 else if (particleName ==
"neutron")
198 analysis -> SecondaryNeutronEnergyDeposit(i, energyDeposit/
MeV);
200 else if (particleName ==
"alpha")
201 analysis -> SecondaryAlphaEnergyDeposit(i, energyDeposit/
MeV);
203 else if (particleName ==
"gamma")
204 analysis -> SecondaryGammaEnergyDeposit(i, energyDeposit/
MeV);
206 else if (particleName ==
"e-")
207 analysis -> SecondaryElectronEnergyDeposit(i, energyDeposit/
MeV);
209 else if (particleName ==
"triton")
210 analysis -> SecondaryTritonEnergyDeposit(i, energyDeposit/
MeV);
212 else if (particleName ==
"deuteron")
213 analysis -> SecondaryDeuteronEnergyDeposit(i, energyDeposit/
MeV);
215 else if (particleName ==
"pi+" || particleName ==
"pi-" || particleName ==
"pi0")
216 analysis -> SecondaryPionEnergyDeposit(i, energyDeposit/
MeV);
228 static G4int HCID = -1;
234 HCE -> AddHitsCollection(HCID,HitsCollection);
static HadrontherapyAnalysisManager * GetInstance()
static HadrontherapyLet * GetInstance()
G4int GetPDGEncoding() const
const G4VTouchable * GetTouchable() const
virtual G4int GetCollectionID(G4int i)
G4StepPoint * GetPreStepPoint() const
static HadrontherapyMatrix * GetInstance()
HadrontherapyDetectorSD(G4String name)
double A(double temperature)
void insert(G4String str)
G4THitsCollection< HadrontherapyDetectorHit > HadrontherapyDetectorHitsCollection
~HadrontherapyDetectorSD()
virtual G4int GetReplicaNumber(G4int depth=0) const
void Initialize(G4HCofThisEvent *)
void EndOfEvent(G4HCofThisEvent *HCE)
static constexpr double MeV
G4CollectionNameVector collectionName
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
static constexpr double keV