63 std::vector<math::XYZTLorentzVector> secondaries;
66 if (aStep !=
nullptr) {
67 const G4TrackVector* tkV = aStep->GetSecondary();
68 G4Track* thTk = aStep->GetTrack();
69 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
70 const G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
71 double eTrackNew = thTk->GetKineticEnergy()/
MeV;
74 if (tkV !=
nullptr && postStepPoint !=
nullptr) {
75 int nsc = (*tkV).size();
76 const G4VProcess*
proc = postStepPoint->GetProcessDefinedStep();
77 if (proc !=
nullptr) {
78 G4ProcessType
type = proc->GetProcessType();
80 name = proc->GetProcessName();
81 int sec = nsc -
nsecL;
82 LogDebug(
"CheckSecondary") << sec <<
" secondaries in step " 83 << thTk->GetCurrentStepNumber()
84 <<
" of track " << thTk->GetTrackID()
85 <<
" from " <<
name <<
" of type " 86 << type <<
" ID " << procid <<
" (" 91 if(procid >= 121 && procid <= 151) {
92 LogDebug(
"CheckSecondary") <<
"Hadronic Interaction " <<
nHad 93 <<
" of Type " << procid <<
" with " 94 << sec <<
" secondaries from process " 95 << proc->GetProcessName() <<
" Delta E " 96 << deltaE <<
" Flag " << hadrInt;
98 for (
int i=nsecL;
i<nsc; ++
i) {
99 G4Track* tk = (*tkV)[
i];
100 G4ThreeVector
pp = tk->GetMomentum();
101 double ee = tk->GetTotalEnergy();
103 secondaries.push_back(secondary);
104 int charge = (
int)(tk->GetDefinition()->GetPDGCharge());
105 charges.push_back(charge);
108 for (
int i=nsecL;
i<nsc;
i++) {
109 G4Track* tk = (*tkV)[
i];
110 LogDebug(
"CheckSecondary") <<
"Secondary: " << sec <<
" ID " 111 << tk->GetTrackID() <<
" Status " 112 << tk->GetTrackStatus() <<
" Particle " 113 << tk->GetDefinition()->GetParticleName()
114 <<
" Position " << tk->GetPosition()
115 <<
" KE " << tk->GetKineticEnergy()
116 <<
" Time " << tk->GetGlobalTime();
124 LogDebug(
"CheckSecondary") <<
"Track: " << thTk->GetTrackID()
125 <<
" Status " << thTk->GetTrackStatus()
127 << thTk->GetDefinition()->GetParticleName()
128 <<
" at " << preStepPoint->GetPosition()
129 <<
" Step: " <<
step <<
" KE " 130 << thTk->GetKineticEnergy()/
GeV <<
" GeV; p " 131 << thTk->GetMomentum().mag()/
GeV 132 <<
" GeV/c; Step Length " 133 << aStep->GetStepLength()<<
" Energy Deposit " 134 << aStep->GetTotalEnergyDeposit()/
MeV 135 <<
" MeV; Interaction " << hadrInt;
TrainProcessor *const proc
G4ProcessTypeEnumerator * typeEnumerator
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::string processG4Name(int)
int processIdLong(const G4VProcess *p)