14 declareInterface<IAsgSelectionTool>(
this);
22 return StatusCode::FAILURE;
29 m_cuts.emplace_back(
"eta",
"Cut on (absolute) particle eta");
32 m_cuts.emplace_back(
"min_pt",
"Cut on minimum particle pT");
35 m_cuts.emplace_back(
"max_pt",
"Cut on maximum particle pT");
39 m_cuts.emplace_back(
"OnlyPrimary",
"Cut on origin");
43 m_cuts.emplace_back(
"charged",
"Require charged particle");
46 m_cuts.emplace_back(
"stable",
"Particle stable");
50 m_cuts.emplace_back(
"decay_before_pixel",
"Decays before first pixel layer");
54 m_cuts.emplace_back(
"pdgId",
"Pdg Id cut");
57 for (
const auto& cut :
m_cuts) {
58 if (
m_accept.addCut(cut.first, cut.second) < 0) {
59 ATH_MSG_ERROR(
"Failed to add cut " << cut.first <<
" because the AcceptInfo object is full.");
60 return StatusCode::FAILURE;
65 m_numTruthPassedCuts.resize(
m_accept.getNCuts(), 0);
67 return StatusCode::SUCCESS;
80 ATH_MSG_ERROR(
"accept(...) Function received a null pointer");
84 ATH_MSG_ERROR(
"accept(...) Function received a non-TruthParticle");
114 acceptData.
setCutResult(
"charged", (not (p->isNeutral())));
125 std::lock_guard<std::mutex> lock{
m_mutex};
127 for (
const auto& cut :
m_cuts) {
130 m_numTruthPassedCuts[pos]++;
147 return StatusCode::SUCCESS;
151 for (
const auto& cut :
m_cuts) {
152 ULong64_t numPassed = m_numTruthPassedCuts.at(
m_accept.getCutPosition(cut.first));
154 << cut.first <<
" cut.");
157 return StatusCode::SUCCESS;
ATLAS-specific HepMC functions.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
unsigned int getCutPosition(const std::string &cutName) const
Get the bit position of a cut.
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
Class providing the definition of the 4-vector interface.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
@ TruthParticle
The object is a truth particle.
TruthParticle_v1 TruthParticle
Typedef to implementation.