171 const G4Track * G4PrimaryTrack = fastTrack.GetPrimaryTrack();
173 const G4ParticleDefinition * G4Particle = G4PrimaryTrack -> GetDefinition();
175 signed int pdgID = G4Particle -> GetPDGEncoding();
178 if(G4PrimaryTrack -> GetKineticEnergy() < 10){
180 G4cout<<
"[FastCaloSim::DoIt] Skipping particle with Ekin: " << G4PrimaryTrack -> GetKineticEnergy() <<
" MeV. Below the 10 MeV threshold"<<G4endl;
182 fastStep.KillPrimaryTrack();
186 if(G4Particle == G4Electron::Definition() || G4Particle == G4Positron::Definition() || G4Particle == G4Gamma::Definition())
193 truthState.
set_pdgid(G4PionPlus::Definition() -> GetPDGEncoding());
197 truthState.SetPtEtaPhiM(G4PrimaryTrack -> GetMomentum().
perp(),
198 G4PrimaryTrack -> GetMomentum().
eta(),
199 G4PrimaryTrack -> GetMomentum().
phi(),
200 G4Particle -> GetPDGMass());
203 truthState.
set_vertex(G4PrimaryTrack -> GetPosition().
x(),
204 G4PrimaryTrack -> GetPosition().
y(),
205 G4PrimaryTrack -> GetPosition().
z());
211 if(pdgID == -2212 || pdgID == -2112) truthState.
set_Ekin_off(2 * G4Particle -> GetPDGMass());
224 G4cout<<
"[FastCaloSim::DoIt] Killing particle as extrapolation failed"<<G4endl;
226 fastStep.KillPrimaryTrack();
230 if(
m_FastCaloSimSvc->simulate(simState, &truthState, &extrapolState).isFailure()){
231 G4Exception(
"FastCaloSimSvc",
"FailedSimulationCall", FatalException,
"FastCaloSimSvc: Simulation call failed.");
236 G4cout<<
"[FastCaloSim::DoIt] pdgID of G4PrimaryTrack: " << pdgID << G4endl;
237 G4cout<<
"[FastCaloSim::DoIt] Energy returned: " << simState.E() << G4endl;
238 G4cout<<
"[FastCaloSim::DoIt] Energy fraction for layer: " << G4endl;
239 for (
int s = 0;
s < 24;
s++) G4cout<<
"[FastCaloSim::DoIt] Sampling " <<
s <<
" energy " << simState.E(
s) << G4endl;
250 G4ParticleTable *ptable = G4ParticleTable::GetParticleTable();
253 const double simE = simState.E();
256 std::vector<double> simEfrac;
257 for (
unsigned int i = 0;
i < 24;
i++){simEfrac.push_back(simState.Efrac(
i));}
260 m_PunchThroughSimWrapper->DoPunchThroughSim(*ptable, G4Random::getTheEngine(), simE, simEfrac, fastTrack, fastStep);
264 simState.DoAuxInfoCleanup();
267 fastStep.KillPrimaryTrack();
268 fastStep.ProposePrimaryTrackPathLength(0.0);