8 #include "G4VProcess.hh"
9 #include "G4HCofThisEvent.hh"
10 #include "CLHEP/Units/GlobalSystemOfUnits.h"
11 #include "CLHEP/Units/GlobalPhysicalConstants.h"
23 edm::LogInfo(
"CheckSecondary") <<
"Instantiate CheckSecondary with Flag"
24 <<
" for Killing track after "<< killAfter
25 <<
" hadronic interactions\nDefine inelastic"
26 <<
" if > 1 seondary or change in KE > "
27 << minDeltaE <<
" MeV\n";
42 LogDebug(
"CheckSecondary") <<
"TreatSecondary::initTrack:Track: "
43 << thTk->GetTrackID() <<
" Type: "
44 << thTk->GetDefinition()->GetParticleName()
45 <<
" KE " << thTk->GetKineticEnergy()/
GeV
46 <<
" GeV p " << thTk->GetMomentum().mag()/
GeV
47 <<
" GeV daughter of particle "
48 << thTk->GetParentID();
56 std::vector<int> & charges) {
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;
T getUntrackedParameter(std::string const &, T const &) const
TrainProcessor *const proc
virtual ~TreatSecondary()
std::vector< math::XYZTLorentzVector > tracks(const G4Step *step, std::string &procName, int &procID, bool &intr, double &deltaE, std::vector< int > &charges)
G4ProcessTypeEnumerator * typeEnumerator
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::string processG4Name(int)
TreatSecondary(const edm::ParameterSet &p)
int processIdLong(const G4VProcess *p)
void initTrack(const G4Track *trk)