77 if (aStep -> GetPreStepPoint() -> GetPhysicalVolume() ->
GetName() !=
"RODetectorZDivisionPhys")
return false;
81 G4Track * theTrack = aStep -> GetTrack();
82 G4double kineticEnergy = theTrack -> GetKineticEnergy();
86 G4String particleName = particleDef -> GetParticleName();
91 G4int trackID = theTrack -> GetTrackID();
93 G4double energyDeposit = aStep -> GetTotalEnergyDeposit();
95 G4double DX = aStep -> GetStepLength();
96 G4int Z = particleDef-> GetAtomicNumber();
97 G4int A = particleDef-> GetAtomicMass();
108 #ifdef G4ANALYSIS_USE_ROOT
119 if ( !(Z==0 && A==1) )
121 if( energyDeposit>0. && DX >0. )
125 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i, j, k);
127 else if (kineticEnergy > 50.*
keV)
129 let -> FillEnergySpectrum(trackID, particleDef,energyDeposit, DX, i , j, k);
146 G4int* hitTrack = matrix -> GetHitTrack(i,j,k);
147 if ( *hitTrack != trackID )
154 if ( Z >= 1) matrix -> Fill(trackID, particleDef, i, j, k, 0,
true);
157 #ifdef G4ANALYSIS_USE_ROOT
176 if(energyDeposit != 0)
186 matrix -> Fill(trackID, particleDef, i, j, k, energyDeposit);
191 detectorHit -> SetEdepAndPosition(i, j, k, energyDeposit);
196 #ifdef G4ANALYSIS_USE_ROOT
197 if(energyDeposit != 0)
201 if (particleName ==
"proton")
202 analysis -> SecondaryProtonEnergyDeposit(i, energyDeposit/
MeV);
204 else if (particleName ==
"neutron")
205 analysis -> SecondaryNeutronEnergyDeposit(i, energyDeposit/
MeV);
207 else if (particleName ==
"alpha")
208 analysis -> SecondaryAlphaEnergyDeposit(i, energyDeposit/
MeV);
210 else if (particleName ==
"gamma")
211 analysis -> SecondaryGammaEnergyDeposit(i, energyDeposit/
MeV);
213 else if (particleName ==
"e-")
214 analysis -> SecondaryElectronEnergyDeposit(i, energyDeposit/
MeV);
216 else if (particleName ==
"triton")
217 analysis -> SecondaryTritonEnergyDeposit(i, energyDeposit/
MeV);
219 else if (particleName ==
"deuteron")
220 analysis -> SecondaryDeuteronEnergyDeposit(i, energyDeposit/
MeV);
222 else if (particleName ==
"pi+" || particleName ==
"pi-" || particleName ==
"pi0")
223 analysis -> SecondaryPionEnergyDeposit(i, energyDeposit/
MeV);
235 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)