|
ATLAS Offline Software
|
Go to the documentation of this file.
17 bool isInSet(
int origin,
const std::set<int> &
s)
19 return s.find(origin) !=
s.end();
34 unsigned int &classification)
const
38 classification =
static_cast<int>(
type);
39 return StatusCode::SUCCESS;
58 return StatusCode::FAILURE;
61 return StatusCode::SUCCESS;
72 bool isTruthParticle{};
73 if (truthParticle ==
nullptr)
80 isTruthParticle =
true;
85 ANA_MSG_ERROR(
"Electron does not have the 'truthPdgId' decoration.");
86 return StatusCode::FAILURE;
93 ANA_MSG_ERROR(
"Electron does not have one or more 'firstEgMother' decorations.");
94 return StatusCode::FAILURE;
114 int fallbackType{-1};
130 return StatusCode::SUCCESS;
138 return StatusCode::SUCCESS;
146 return StatusCode::SUCCESS;
155 return StatusCode::SUCCESS;
162 return StatusCode::SUCCESS;
169 return StatusCode::SUCCESS;
178 return StatusCode::SUCCESS;
184 return StatusCode::SUCCESS;
196 ANA_MSG_WARNING(
"Electron identified as from a PromptPhotonConversion, "
197 "but this type of electron needs further study!");
199 return StatusCode::SUCCESS;
206 && std::abs(firstMotherPdgId) == 11 && std::abs(pdgId) == 11)
212 return StatusCode::SUCCESS;
225 return StatusCode::SUCCESS;
231 return StatusCode::SUCCESS;
236 return StatusCode::SUCCESS;
249 return StatusCode::SUCCESS;
257 return StatusCode::SUCCESS;
268 return StatusCode::SUCCESS;
277 return StatusCode::SUCCESS;
285 return StatusCode::SUCCESS;
289 return StatusCode::SUCCESS;
297 return StatusCode::SUCCESS;
308 return StatusCode::SUCCESS;
318 return StatusCode::SUCCESS;
331 return StatusCode::SUCCESS;
335 return StatusCode::SUCCESS;
359 return StatusCode::SUCCESS;
362 if ((
type == MCTruthPartClassifier::Unknown && firstMotherType == MCTruthPartClassifier::Unknown)
366 return StatusCode::SUCCESS;
372 return StatusCode::SUCCESS;
379 && firstMotherType == 0 && firstMotherOrigin == 0 && firstMotherPdgId == 0)
381 if (lastMotherType == -1 || (lastMotherType == 0 && lastMotherOrigin == 0 && lastMotherPdgId == 0))
384 return StatusCode::SUCCESS;
391 if (truthParticle !=
nullptr)
395 std::string
out =
"\t";
406 return StatusCode::SUCCESS;
418 bool isTruthParticle{};
419 if (truthParticle ==
nullptr)
426 isTruthParticle =
true;
438 int fallbackType{-1};
451 return StatusCode::SUCCESS;
462 return StatusCode::SUCCESS;
468 return StatusCode::SUCCESS;
479 return StatusCode::SUCCESS;
489 return StatusCode::SUCCESS;
500 static const std::set<int> promptOrigin({
519 return StatusCode::SUCCESS;
522 return StatusCode::SUCCESS;
533 return StatusCode::SUCCESS;
543 return StatusCode::SUCCESS;
545 if (
type == -99999 && origin == -99999)
548 return StatusCode::SUCCESS;
559 return StatusCode::SUCCESS;
571 if( truthParticle !=
nullptr && truthParticle->
nParents() == 1 && truthParticle->
parent(0) !=
nullptr){
573 int parent_pdgid =
parent->pdgId();
576 ATH_MSG_WARNING(
"Muon type taudecaylike: type = " <<
type <<
", origin = " << origin <<
", parent = " << parent_pdgid) ;
577 return StatusCode::SUCCESS;
581 ATH_MSG_WARNING(
"Muon type bhadrondecaylike: type = " <<
type <<
", origin = " << origin <<
", parent = " << parent_pdgid) ;
582 return StatusCode::SUCCESS;
585 if( (parent_pdgid / 1000) % 10 != 0 || (parent_pdgid / 100) % 10 != 4 || (parent_pdgid / 10) % 10 != 4){
587 ATH_MSG_WARNING(
"Muon type chadrondecaylike: type = " <<
type <<
", origin = " << origin <<
", parent = " << parent_pdgid) ;
588 return StatusCode::SUCCESS;
600 return StatusCode::SUCCESS;
605 bool isTruthParticle,
619 if (
type == MCTruthPartClassifier::IsoElectron)
642 && std::abs(pdgId) == 11)
653 bool isTruthParticle,
678 && std::abs(pdgId) == 11)
686 && std::abs(pdgId) == 11)
693 if (truthParticle->
charge() != 0)
695 return (firstMotherPdgId * truthParticle->
charge()) > 0;
701 if (xAODElectron.
charge() != 0)
703 return (firstMotherPdgId * xAODElectron.
charge()) > 0;
707 return (firstMotherPdgId * (-pdgId)) > 0;
712 bool isTruthParticle,
723 return (truthParticle->
charge() * xAODMuon.
charge()) < 0;
726 ANA_MSG_DEBUG(
"Cannot find associated truth-particle... assuming muon has correct charge");
733 static const std::set<int> b_hadrons({
738 return isInSet(origin, b_hadrons);
743 static const std::set<int> c_hadrons({
748 return isInSet(origin, c_hadrons);
753 static const std::set<int> light_source({
762 return isInSet(origin, light_source);
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
float charge() const
Obtain the charge of the object.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class providing the definition of the 4-vector interface.
size_t nParents() const
Number of parents of this particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
std::string to_string(const DetectorType &type)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool isInDeltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2, double dR, bool useRapidity=true)
Check if 2 xAOD::IParticle are in a cone.
int pdgId() const
PDG ID code.
double charge() const
Physical charge.
Type
truth classification type enum