6 #include <CLHEP/Units/GlobalPhysicalConstants.h> 7 #include <CLHEP/Units/SystemOfUnits.h> 8 #include "G4HCofThisEvent.hh" 11 #include "G4VProcess.hh" 21 verbosity =
p.getUntrackedParameter<
int>(
"Verbosity", 0);
22 killAfter =
p.getUntrackedParameter<
int>(
"KillAfter", -1);
23 minDeltaE =
p.getUntrackedParameter<
double>(
"MinimumDeltaE", 10.0) * MeV;
25 edm::LogInfo(
"CheckSecondary") <<
"Instantiate CheckSecondary with Flag" 26 <<
" for Killing track after " <<
killAfter 27 <<
" hadronic interactions\nDefine inelastic" 28 <<
" if > 1 seondary or change in KE > " <<
minDeltaE <<
" MeV\n";
42 eTrack = thTk->GetKineticEnergy() / MeV;
43 LogDebug(
"CheckSecondary") <<
"TreatSecondary::initTrack:Track: " << thTk->GetTrackID()
44 <<
" Type: " << thTk->GetDefinition()->GetParticleName() <<
" KE " 45 << thTk->GetKineticEnergy() / GeV <<
" GeV p " << thTk->GetMomentum().mag() / GeV
46 <<
" GeV daughter of particle " << thTk->GetParentID();
56 std::vector<math::XYZTLorentzVector> secondaries;
59 if (aStep !=
nullptr) {
60 const G4TrackVector *tkV = aStep->GetSecondary();
61 G4Track *thTk = aStep->GetTrack();
62 const G4StepPoint *preStepPoint = aStep->GetPreStepPoint();
63 const G4StepPoint *postStepPoint = aStep->GetPostStepPoint();
64 double eTrackNew = thTk->GetKineticEnergy() / MeV;
67 if (tkV !=
nullptr && postStepPoint !=
nullptr) {
68 int nsc = (*tkV).size();
69 const G4VProcess *
proc = postStepPoint->GetProcessDefinedStep();
70 if (
proc !=
nullptr) {
71 G4ProcessType
type =
proc->GetProcessType();
75 LogDebug(
"CheckSecondary") <<
sec <<
" secondaries in step " << thTk->GetCurrentStepNumber() <<
" of track " 76 << thTk->GetTrackID() <<
" from " <<
name <<
" of type " <<
type <<
" ID " << procid
80 if (procid >= 121 && procid <= 151) {
81 LogDebug(
"CheckSecondary") <<
"Hadronic Interaction " <<
nHad <<
" of Type " << procid <<
" with " <<
sec 82 <<
" secondaries from process " <<
proc->GetProcessName() <<
" Delta E " <<
deltaE 83 <<
" Flag " << hadrInt;
86 G4Track *tk = (*tkV)[
i];
87 G4ThreeVector
pp = tk->GetMomentum();
88 double ee = tk->GetTotalEnergy();
90 secondaries.push_back(secondary);
91 int charge = (
int)(tk->GetDefinition()->GetPDGCharge());
96 G4Track *tk = (*tkV)[
i];
97 LogDebug(
"CheckSecondary") <<
"Secondary: " <<
sec <<
" ID " << tk->GetTrackID() <<
" Status " 98 << tk->GetTrackStatus() <<
" Particle " 99 << tk->GetDefinition()->GetParticleName() <<
" Position " << tk->GetPosition()
100 <<
" KE " << tk->GetKineticEnergy() <<
" Time " << tk->GetGlobalTime();
108 LogDebug(
"CheckSecondary") <<
"Track: " << thTk->GetTrackID() <<
" Status " << thTk->GetTrackStatus()
109 <<
" Particle " << thTk->GetDefinition()->GetParticleName() <<
" at " 110 << preStepPoint->GetPosition() <<
" Step: " <<
step <<
" KE " 111 << thTk->GetKineticEnergy() / GeV <<
" GeV; p " << thTk->GetMomentum().mag() / GeV
112 <<
" GeV/c; Step Length " << aStep->GetStepLength() <<
" Energy Deposit " 113 << aStep->GetTotalEnergyDeposit() / MeV <<
" MeV; Interaction " << hadrInt;
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.
TreatSecondary(const edm::ParameterSet &p)
int processIdLong(const G4VProcess *p) const
Log< level::Info, false > LogInfo
void initTrack(const G4Track *trk)
std::string processG4Name(int) const
charges
only generated particles of these IDs are considered