Skip to content
Snippets Groups Projects
Commit 7a7c0519 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: save secondary tracks with Ek, rho, z

parent 89198c75
No related branches found
No related tags found
No related merge requests found
......@@ -452,8 +452,19 @@ Edm4hepWriterAnaElemTool::PostUserTrackingAction(const G4Track* track) {
G4ParticleDefinition* secparticle = sectrk->GetDefinition();
const G4VProcess* creatorProcess = sectrk->GetCreatorProcess();
double Ek = sectrk->GetKineticEnergy();
const auto& pos = sectrk->GetPosition();
// select the necessary processes
if (creatorProcess==proc_decay || creatorProcess==photon_general || creatorProcess==photon_conv) {
} else if (Ek >= m_sectrk_Ek.value() && fabs(pos.rho()) < m_sectrk_rho.value() && fabs(pos.z()) < m_sectrk_z.value()) {
// if the Ek > x
} else {
// skip this secondary track
continue;
}
debug() << "Creator Process is " << creatorProcess->GetProcessName()
<< " for secondary particle: "
<< " idx: " << i
......@@ -502,7 +513,6 @@ Edm4hepWriterAnaElemTool::PostUserTrackingAction(const G4Track* track) {
debug() << " Appending MCParticle: (id: "
<< mcp.getObjectID().index << ")"
<< endmsg;
}
}
}
......
......@@ -73,6 +73,10 @@ private:
"HcalBarrel", "HcalEndcaps", "HcalEndcapRing"},
"Names of the Calorimeter collections (without suffix Collection)"};
Gaudi::Property<double> m_sectrk_Ek{this, "SecTrackEk", 100., "Ek (MeV) threshold to record a secondary track"};
Gaudi::Property<double> m_sectrk_rho{this, "SecTrackRho", 1000., "rho (mm) threshold to record a secondary track"};
Gaudi::Property<double> m_sectrk_z{this, "SecTrackZ", 2000., "rho (mm) threshold to record a secondary track"};
private:
// in order to associate the hit contribution with the primary track,
// we have a bookkeeping of every track.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment