ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
D3PD::D3PDMCTruthClassifier Class Referenceabstract

Work around MCTruthClassifier brain-damage. More...

#include <D3PDMCTruthClassifier.h>

Inheritance diagram for D3PD::D3PDMCTruthClassifier:
Collaboration diagram for D3PD::D3PDMCTruthClassifier:

Public Member Functions

 D3PDMCTruthClassifier (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor. More...
 
virtual StatusCode initialize ()
 Standard Gaudi initialize method. More...
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Electron *el)
 Run the classifier for an electron. More...
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Photon *el)
 Run the classifier for a photon. More...
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Muon *mu)
 Run the classifier for a muon. More...
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual StatusCode finalize () override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigincheckOrigOfBkgElec (const xAOD::TruthParticle *thePart, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual const xAOD::TruthParticlegetGenPart (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool get_tptruth_name (const std::string &tp_name, std::string &tptruth_name)
 Try to find a TrackParticleTruthCollection pointing at TP_NAME. More...
 
void getProperty1 (const std::string &pname, std::string &value)
 Helper to retrieve the value of a Gaudi property. More...
 
void setProperty1 (const std::string &pname, const std::string &value)
 Helper to set the value of a Gaudi property. More...
 
double detEta (double x, double y) const
 
double detPhi (double x, double y) const
 
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron (const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
 
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
 
MCTruthPartClassifier::ParticleOrigin defOrigOfTau (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info *info) const
 
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
 
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
 
bool genPartToCalo (const EventContext &ctx, const xAOD::CaloCluster *clus, const xAOD::TruthParticle *thePart, bool isFwrdEle, double &dRmatch, bool &isNarrowCone, const CaloDetDescrManager &caloDDMgr) const
 
const xAOD::TruthParticleegammaClusMatch (const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const
 
double fracParticleInJet (const xAOD::TruthParticle *, const xAOD::Jet *, bool DR, bool nparts) const
 
void findJetConstituents (const xAOD::Jet *, std::set< const xAOD::TruthParticle * > &constituents, bool DR) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< StoreGateSvcm_sg
 The StoreGate service. More...
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleContainerKey {this,"xAODTruthParticleContainerName","TruthParticles","ReadHandleKey for xAOD::TruthParticleContainer"}
 
ToolHandle< Trk::IParticleCaloExtensionToolm_caloExtensionTool {this,"ParticleCaloExtensionTool",""}
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager",""}
 
ToolHandle< xAOD::ITruthParticlesInConeToolm_truthInConeTool {this,"TruthInConeTool","xAOD::TruthParticlesInConeTool/TruthParticlesInConeTool"}
 
bool m_FwdElectronUseG4Sel
 
float m_FwdElectronTruthExtrEtaCut
 
float m_FwdElectronTruthExtrEtaWindowCut
 
float m_partExtrConeEta
 
float m_partExtrConePhi
 
bool m_useCaching
 
float m_phtClasConePhi
 
float m_phtClasConeEta
 
float m_phtdRtoTrCut
 
float m_fwrdEledRtoTrCut
 
bool m_ROICone
 
float m_pTChargePartCut
 
float m_pTNeutralPartCut
 
bool m_inclG4part
 
SG::ReadHandleKey< xAODTruthParticleLinkVectorm_truthLinkVecReadHandleKey {this,"xAODTruthLinkVector","xAODTruthLinks", "ReadHandleKey for xAODTruthParticleLinkVector"}
 
float m_deltaRMatchCut
 
float m_deltaPhiMatchCut
 
int m_NumOfSiHitsCut
 
float m_jetPartDRMatch
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Work around MCTruthClassifier brain-damage.

This avoids having to specify the container names during configuration.

MCTruthClassifier requires specifying, at configuration time, the names of the TrackParticleContainer and TrackParticleTruthCollection objects to use for the mapping. This is painful in for electrons in the case where one may have several different track containers.

What we do to make this easier is to search through SG to find a truth collection that points at the TrackParticleContainer that contains the tracks for the electron we're looking at.

Definition at line 41 of file D3PDMCTruthClassifier.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ D3PDMCTruthClassifier()

D3PD::D3PDMCTruthClassifier::D3PDMCTruthClassifier ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 39 of file D3PDMCTruthClassifier.cxx.

43  m_sg ("StoreGateSvc", name)
44 {
45 }

Member Function Documentation

◆ checkOrigOfBkgElec()

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::checkOrigOfBkgElec ( const xAOD::TruthParticle thePart,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 1476 of file MCTruthClassifierGen.cxx.

1476  {
1478  ATH_MSG_DEBUG("executing CheckOrigOfBkgElec " << theEle);
1479 
1480  std::pair<ParticleType, ParticleOrigin> part;
1481  part.first = Unknown;
1482  part.second = NonDefined;
1483  if (theEle == nullptr) return part;
1484 
1486 
1487  if (!truthParticleContainerReadHandle.isValid()) {
1488  ATH_MSG_WARNING(" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
1489  return part;
1490  }
1491 
1492  ATH_MSG_DEBUG("xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() << " has valid ReadHandle ");
1493 
1495  if (!info) { info = &tmpinfo; }
1496  part = particleTruthClassifier(theEle, info);
1497  if (part.first != BkgElectron || part.second != PhotonConv) return part;
1498 
1499  const xAOD::TruthParticle* thePart(nullptr);
1500 
1501  if ((MC::isElectron(info->photonMotherPDG) || MC::isMuon(info->photonMotherPDG) || MC::isTau(info->photonMotherPDG) || (MC::isHadron(info->photonMother)&&!MC::isBeam(info->photonMother)) ) && info->photonMotherStatus < 3) {
1502  do {
1503  const xAOD::TruthParticle* theMotherPart =
1504  MC::find_matching(truthParticleContainerReadHandle.ptr(), info ? info->PhotonMother() : nullptr );
1505  if (theMotherPart == nullptr || theMotherPart == thePart) break;
1506  thePart = theMotherPart;
1507  part.first = Unknown;
1508  part.second = NonDefined;
1509  part = particleTruthClassifier(thePart, info);
1510  } while (part.first == BkgElectron && part.second == PhotonConv &&
1511  (MC::isElectron(info->photonMotherPDG) || MC::isMuon(info->photonMotherPDG) ||
1512  MC::isTau(info->photonMotherPDG) || (MC::isHadron(info->photonMother)&&!MC::isBeam(info->photonMother) )));
1513 
1514  if (part.first == BkgElectron && part.second == PhotonConv) {
1515  // in case of photon from gen particle classify photon
1516  // part=particleTruthClassifier(mother);
1517  thePart = MC::find_matching(truthParticleContainerReadHandle.ptr(), info ? info->Mother() : nullptr );
1518  if (thePart != nullptr) part = particleTruthClassifier(thePart, info);
1519  } else if (part.first == GenParticle && (MC::isHadron(thePart)&&!MC::isBeam(thePart))) {
1520  // to fix Alpgen hadrons with status code !=1 (>100)
1521  part.first = Hadron;
1522  part.second = NonDefined;
1523  }
1524 
1525  } else {
1526  // in case of photon from gen particle classify photon
1527  thePart = MC::find_matching(truthParticleContainerReadHandle.ptr(), info ? info->Mother() : nullptr);
1528  if (thePart != nullptr) part = particleTruthClassifier(thePart, info);
1529  }
1530 
1531  info->bkgElecMother = thePart;
1532  return part;
1533 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ defOrigOfElectron()

ParticleOrigin MCTruthClassifier::defOrigOfElectron ( const xAOD::TruthParticleContainer xTruthParticleContainer,
const xAOD::TruthParticle thePart,
bool &  isPrompt,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 230 of file MCTruthClassifierGen.cxx.

234 {
236  ATH_MSG_DEBUG("Executing DefOrigOfElectron ");
237 
238  const xAOD::TruthParticle* thePriPart = MC::find_matching(mcTruthTES, thePart);
239  if (!thePriPart) return NonDefined;
240  if (!MC::isElectron(thePriPart)) return NonDefined;
241 
242  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
243 
244  //-- to define electron outcome status
245  if (info) info->particleOutCome = defOutComeOfElectron(thePriPart);
247  if (!info) { info = &tmpinfo; }
248 
249  if (!partOriVert) return NonDefined;
250 
251  int numOfParents = -1;
252  numOfParents = partOriVert->nIncomingParticles();
253  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfElectron:: electron has more than one mother ");
254 
255  const xAOD::TruthParticle* mother = MC::getMother(thePriPart);
256  if (info) info->setMotherProperties(mother);
257  if (!mother) {
258  return NonDefined;
259  }
260  int motherPDG = mother->pdgId();
261  if (info) info->setMotherProperties(mother);
262  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
263 
264  bool samePart = false;
265  for (const auto& theDaug: partOriVert->particles_out()) {
266  if (!theDaug) continue;
267  if (motherPDG == theDaug->pdgId() && info && info->Mother() && HepMC::is_same_generator_particle(theDaug, info->Mother())) samePart = true;
268  }
269 
270  // to resolve Sherpa loop
271  if (mothOriVert && HepMC::uniqueID(mothOriVert) == HepMC::uniqueID(partOriVert))
272  samePart = true;
273  //
274 
275  if ((abs(motherPDG) == 13 || abs(motherPDG) == 15 || abs(motherPDG) == 24) && mothOriVert != nullptr && !samePart) {
276  long pPDG(0);
277  const xAOD::TruthParticle* MotherParent(nullptr);
278  do {
279  pPDG = 0;
280  MotherParent = MC::getMother(mother);
281  // to prevent Sherpa loop
282  const xAOD::TruthVertex* mother_prdVtx(nullptr);
283  const xAOD::TruthVertex* mother_endVtx(nullptr);
284  if (mother) {
285  mother_prdVtx = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
286  mother_endVtx = mother->decayVtx();
287  }
288  const xAOD::TruthVertex* parent_prdVtx(nullptr);
289  const xAOD::TruthVertex* parent_endVtx(nullptr);
290  if (MotherParent) {
291  parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() : nullptr;
292  parent_endVtx = MotherParent->decayVtx();
293  }
294  if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
295  MotherParent = mother;
296  break;
297  }
298  //
299  if (MotherParent) pPDG = MotherParent->pdgId();
300  // to prevent Sherpa loop
301  if (mother == MotherParent) break;
302  if (abs(pPDG) == 13 || abs(pPDG) == 15 || abs(pPDG) == 24) mother = MotherParent;
303 
304  } while ((abs(pPDG) == 13 || abs(pPDG) == 15 || abs(pPDG) == 24));
305 
306  if (abs(pPDG) == 13 || abs(pPDG) == 15 || abs(pPDG) == 24 || abs(pPDG) == 23 || abs(pPDG) == 25 ||
307  abs(pPDG) == 35 || abs(pPDG) == 36 || abs(pPDG) == 37 || abs(pPDG) == 32 || abs(pPDG) == 33 ||
308  abs(pPDG) == 34 || abs(pPDG) == 6 || abs(pPDG) == 9900024 || abs(pPDG) == 9900012 || abs(pPDG) == 9900014 ||
309  abs(pPDG) == 9900016 || (abs(pPDG) < 2000040 && abs(pPDG) > 1000001))
310  mother = MotherParent;
311  }
312 
313  motherPDG = mother->pdgId();
314  partOriVert = mother->decayVtx();
315  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
316  numOfParents = partOriVert->nIncomingParticles();
317  int numOfDaug = partOriVert->nOutgoingParticles();
318 
319  if (info) info->setMotherProperties(mother);
320 
321  int NumOfPhot(0);
322  int NumOfEl(0);
323  int NumOfPos(0);
324  int NumOfNucFr(0);
325  int NumOfquark(0);
326  int NumOfgluon(0);
327  int NumOfElNeut(0);
328  int NumOfLQ(0);
329  int NumOfMuPl(0);
330  int NumOfMuMin(0);
331  int NumOfMuNeut(0);
332  int NumOfTau(0);
333  int NumOfTauNeut(0);
334  samePart = false;
335 
336  for (const auto& theDaug: partOriVert->particles_out()) {
337  if (!theDaug) continue;
338  int DaugType = theDaug->pdgId();
339  if (abs(DaugType) < 7) NumOfquark++;
340  if (abs(DaugType) == 21) NumOfgluon++;
341  if (abs(DaugType) == 12) NumOfElNeut++;
342  if (abs(DaugType) == 14) NumOfMuNeut++;
343  if (DaugType == 22) NumOfPhot++;
344  if (DaugType == 11) NumOfEl++;
345  if (DaugType == -11) NumOfPos++;
346  if (DaugType == 13) NumOfMuMin++;
347  if (DaugType == -13) NumOfMuPl++;
348  if (abs(DaugType) == 15) NumOfTau++;
349  if (abs(DaugType) == 16) NumOfTauNeut++;
350  if (abs(DaugType) == 42) NumOfLQ++;
351  if (abs(DaugType) == abs(motherPDG) && theDaug && info && info->Mother() && HepMC::is_same_generator_particle(theDaug, info->Mother() )) samePart = true;
352  if (numOfParents == 1 &&
353  (motherPDG == 22 || abs(motherPDG) == 11 || abs(motherPDG) == 13 || abs(motherPDG) == 211) &&
354  (DaugType > 1000000000 || DaugType == 0 || DaugType == 2212 || DaugType == 2112 || abs(DaugType) == 211 ||
355  abs(DaugType) == 111))
356  NumOfNucFr++;
357  }
358 
359  if (motherPDG == 22 && mothOriVert != nullptr) {
360  for (const auto& theMother: mothOriVert->particles_in()) {
361  if (!theMother) continue;
362  if (!info) continue;
363  info->photonMother = theMother;
364  info->photonMotherStatus = theMother->status();
365  info->photonMotherBarcode = HepMC::barcode(theMother);
366  info->photonMotherPDG = theMother->pdgId();
367  }
368  }
369 
370  if ((motherPDG == 22 && numOfDaug == 2 && NumOfEl == 1 && NumOfPos == 1) || (motherPDG == 22 && numOfDaug == 1 && (NumOfEl == 1 || NumOfPos == 1))) return PhotonConv;
371 
372  // e,gamma,pi+Nuclear->NuclearFragments+nuclons+e
373  if ((numOfParents == 1 && (abs(motherPDG) == 22 || abs(motherPDG) == 11 || abs(motherPDG) == 15)) && numOfDaug > 1 && NumOfNucFr != 0) return ElMagProc;
374 
375  if (numOfParents == 1 && abs(motherPDG) == 211 && numOfDaug > 2 && NumOfNucFr != 0) return ElMagProc;
376 
377  // nuclear photo fission
378  if (motherPDG == 22 && numOfDaug > 4 && NumOfNucFr != 0) return ElMagProc;
379 
380  // unknown process el(pos)->el+pos??
381  if (abs(motherPDG) == 11 && numOfDaug == 2 && NumOfEl == 1 && NumOfPos == 1) return ElMagProc;
382 
383  // unknown process el->el+el??
384  if (motherPDG == 11 && numOfDaug == 2 && NumOfEl == 2 && NumOfPos == 0) return ElMagProc;
385 
386  // unknown process pos->pos+pos??
387  if (motherPDG == -11 && numOfDaug == 2 && NumOfEl == 0 && NumOfPos == 2) return ElMagProc;
388 
389  // unknown process pos/el->pos/el??
390  if (abs(motherPDG) == 11 && !MC::isDecayed(mother) && motherPDG == thePriPart->pdgId() && numOfDaug == 1 && !samePart) return ElMagProc;
391 
392  // pi->pi+e+/e-; mu->mu+e+/e- ;
393  // gamma+ atom->gamma(the same) + e (compton scattering)
394  if (numOfDaug == 2 && (NumOfEl == 1 || NumOfPos == 1) && abs(motherPDG) != 11 && samePart) return ElMagProc;
395 
396  if ((motherPDG == 111 && numOfDaug == 3 && NumOfPhot == 1 && NumOfEl == 1 && NumOfPos == 1) ||
397  (motherPDG == 111 && numOfDaug == 4 && NumOfPhot == 0 && NumOfEl == 2 && NumOfPos == 2))
398  return DalitzDec;
399 
400  // Quark weak decay
401  if (abs(motherPDG) < 7 && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && NumOfElNeut == 1) return QuarkWeakDec;
402 
403  if (abs(motherPDG) == 13 && NumOfNucFr != 0) return ElMagProc;
404 
405  if (abs(motherPDG) == 6) return top;
406 
407  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
408 
409  const xAOD::TruthVertex* prodVert = mothOriVert;
410  const xAOD::TruthParticle* ptrPart;
411  do {
412  ptrPart = prodVert->incomingParticle(0);
413  prodVert = ptrPart->hasProdVtx() ? ptrPart->prodVtx() : nullptr;
414  } while (MC::isW(ptrPart) && prodVert != nullptr);
415 
416  if (prodVert && prodVert->nIncomingParticles() == 1) {
417  if (abs(ptrPart->pdgId()) == 9900012) return NuREle;
418  if (abs(ptrPart->pdgId()) == 9900014) return NuRMu;
419  if (abs(ptrPart->pdgId()) == 9900016) return NuRTau;
420  }
421  return WBoson;
422  }
423  if (MC::isW(motherPDG)) return WBoson;
424  if (MC::isZ(motherPDG)) return ZBoson;
425 
426  // MadGraphPythia ZWW*->lllnulnu
427  if (numOfParents == 1 && numOfDaug > 4 && (abs(motherPDG) < 7 || motherPDG == 21)) {
428 
429  const xAOD::TruthParticle* thePartToCheck = thePriPart;
430  const xAOD::TruthParticle* theMother = thePriPart->hasProdVtx() ? thePriPart->prodVtx()->incomingParticle(0) : nullptr;
431  if (theMother != nullptr && abs(theMother->pdgId()) == 11 && MC::isDecayed(theMother)) thePartToCheck = theMother;
432 
433  bool isZboson = false;
434  bool isWboson = false;
435  bool skipnext = false;
436 
437  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ++ipOut) {
438  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
439  if (!theDaug) continue;
440  const xAOD::TruthParticle* theNextDaug = nullptr;
441  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
442  theNextDaug = partOriVert->outgoingParticle(ipOut1);
443  if (theNextDaug != nullptr) break;
444  }
445  if (!theNextDaug) continue;
446  if (skipnext) {
447  skipnext = false;
448  continue;
449  }
450 
451  if (abs(theDaug->pdgId()) == 11 && abs(theNextDaug->pdgId()) == 11) {
452  // Zboson
453  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
454  isZboson = true;
455  break;
456  }
457  skipnext = true;
458  } else if (abs(theDaug->pdgId()) == 11 && abs(theNextDaug->pdgId()) == 12) {
459  // WBoson
460  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
461  isWboson = true;
462  break;
463  }
464  skipnext = true;
465  }
466  }
467  if (isWboson) return WBoson;
468  if (isZboson) return ZBoson;
469  }
470  if (numOfParents == 2) {
471  int pdg1 = partOriVert->incomingParticle(0)->pdgId();
472  int pdg2 = partOriVert->incomingParticle(1)->pdgId();
473  //--Sherpa Z->ee
474  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfEl == 1 && NumOfPos == 1) return ZBoson;
475 
476  //--Sherpa W->enu ??
477  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1) return WBoson;
478 
479  //--Sherpa ZZ,ZW
480  if ((numOfDaug - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
481  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
482 
483  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
484  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
485  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
486  }
487 
488  // New Sherpa Z->ee
489  if (partOriVert == mothOriVert && partOriVert != nullptr) {
490  int NumOfEleLoop = 0;
491  int NumOfLepLoop = 0;
492  int NumOfEleNeuLoop = 0;
493  for (const auto *const pout: partOriVert->particles_out()) {
494  if (!pout) continue;
495  for (const auto *const pin: partOriVert->particles_in()) {
496  if (!pin) continue;
497  if (HepMC::uniqueID(pout) != HepMC::uniqueID(pin)) continue;
498  if (MC::isElectron(pout)) NumOfEleLoop++;
499  if (std::abs(pin->pdgId()) == 12) NumOfEleNeuLoop++;
500  if (MC::isSMLepton(pout)) NumOfLepLoop++;
501  }
502  }
503  if (NumOfEleLoop == 2 && NumOfEleNeuLoop == 0) return ZBoson;
504  if (NumOfEleLoop == 1 && NumOfEleNeuLoop == 1) return WBoson;
505  if ((NumOfEleLoop == 4 && NumOfEleNeuLoop == 0) || (NumOfEleLoop == 3 && NumOfEleNeuLoop == 1) ||
506  (NumOfEleLoop == 2 && NumOfEleNeuLoop == 2))
507  return DiBoson;
508  if (NumOfLepLoop == 4) return DiBoson;
509  }
510 
511  //-- McAtNLo
512 
513  if (abs(motherPDG) == 25) return Higgs;
514 
515  if (abs(motherPDG) == 35 || abs(motherPDG) == 36 || abs(motherPDG) == 37) return HiggsMSSM;
516 
517  if (abs(motherPDG) == 32 || abs(motherPDG) == 33 || abs(motherPDG) == 34) return HeavyBoson;
518 
519  if (abs(motherPDG) == 13) return Mu;
520  if (abs(motherPDG) == 15) {
521  ParticleOrigin tauOrig = defOrigOfTau(mcTruthTES, mother, motherPDG, info);
522  ParticleType tautype = defTypeOfTau(tauOrig);
523  return (tautype == IsoTau)?tauOrig:TauLep;
524  }
525 
526  if (abs(motherPDG) == 9900024) return WBosonLRSM;
527  if (abs(motherPDG) == 9900012) return NuREle;
528  if (abs(motherPDG) == 9900014) return NuRMu;
529  if (abs(motherPDG) == 9900016) return NuRTau;
530  if (abs(motherPDG) == 42 || NumOfLQ != 0) return LQ;
531  if (MC::isSUSY(motherPDG)) return SUSY;
532  if (MC::isBSM(motherPDG)) return OtherBSM;
533  ParticleType pType = defTypeOfHadron(motherPDG);
534  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatVrtx(mothOriVert)) isPrompt = true;
535  return convHadronTypeToOrig(pType, motherPDG);
536 }

◆ defOrigOfMuon()

ParticleOrigin MCTruthClassifier::defOrigOfMuon ( const xAOD::TruthParticleContainer m_xTruthParticleContainer,
const xAOD::TruthParticle thePart,
bool &  isPrompt,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 539 of file MCTruthClassifierGen.cxx.

543 {
545  ATH_MSG_DEBUG("Executing DefOrigOfMuon ");
546 
547  const xAOD::TruthParticle* thePriPart = MC::find_matching(mcTruthTES, thePart);
548  if (!thePriPart) return NonDefined;
549  if (abs(thePriPart->pdgId()) != 13) return NonDefined;
550 
551  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
552 
553  //-- to define muon outcome status
554  if (info) info->particleOutCome = defOutComeOfMuon(thePriPart);
555 
557  if (!info) { info = &tmpinfo; }
558  if (!partOriVert) return NonDefined;
559 
560  int numOfParents = partOriVert->nIncomingParticles();
561  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfMuon:: muon has more than one mother ");
562 
563  const xAOD::TruthParticle* mother = MC::getMother(thePriPart);
564  if (info) info->setMotherProperties(mother);
565  if (!mother) {
566  return NonDefined;
567  }
568 
569  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
570  int motherPDG = mother->pdgId();
571 
572  if ((MC::isTau(motherPDG)|| MC::isW(motherPDG)) && mothOriVert != nullptr) {
573  long pPDG(0);
574  const xAOD::TruthParticle* MotherParent(nullptr);
575  do {
576  //
577  pPDG = 0;
578  //
579  const xAOD::TruthVertex* mother_prdVtx(nullptr);
580  const xAOD::TruthVertex* mother_endVtx(nullptr);
581  MotherParent = MC::getMother(mother);
582  // to prevent Sherpa loop
583  mother_prdVtx = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
584  mother_endVtx = mother->decayVtx();
585  //
586  const xAOD::TruthVertex* parent_prdVtx(nullptr);
587  const xAOD::TruthVertex* parent_endVtx(nullptr);
588  if (MotherParent) {
589  parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() : nullptr;
590  parent_endVtx = MotherParent->decayVtx();
591  }
592  //
593  if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
594  MotherParent = mother;
595  break;
596  }
597  //
598  // to prevent Sherpa loop
599  if (mother == MotherParent) {
600  break;
601  }
602 
603  if (MotherParent) {
604  pPDG = MotherParent->pdgId();
605  if (abs(pPDG) == 13 || abs(pPDG) == 15 || abs(pPDG) == 24) {
606  mother = MotherParent;
607  if (info) info->setMotherProperties(mother);
608  }
609  }
610  } while ((abs(pPDG) == 13 || abs(pPDG) == 15 || abs(pPDG) == 24));
611 
612  if (abs(pPDG) == 15 || abs(pPDG) == 24 || abs(pPDG) == 23 || abs(pPDG) == 25 || abs(pPDG) == 35 ||
613  abs(pPDG) == 36 || abs(pPDG) == 37 || abs(pPDG) == 32 || abs(pPDG) == 33 || abs(pPDG) == 34 || abs(pPDG) == 6 ||
614  abs(pPDG) == 9900024 || abs(pPDG) == 9900012 || abs(pPDG) == 9900014 || abs(pPDG) == 9900016 ||
615  (abs(pPDG) < 2000040 && abs(pPDG) > 1000001)) {
616  if (info) info->setMotherProperties(mother);
617  }
618  }
619 
620  motherPDG = mother->pdgId();
621  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
622  partOriVert = mother->decayVtx();
623  numOfParents = partOriVert->nIncomingParticles();
624  int numOfDaug = partOriVert->nOutgoingParticles();
625 
626  if (info) info->setMotherProperties(mother);
627  auto DP = DecayProducts(partOriVert);
628  int NumOfPhot = DP.pd(22);
629  int NumOfEl = DP.pd(11);
630  int NumOfPos = DP.pd(-11);
631  int NumOfElNeut = DP.apd(12);
632  int NumOfMuNeut = DP.apd(14);
633  int NumOfLQ = DP.apd(42);
634  int NumOfquark = DP.apd({1,2,3,4,5,6});
635  int NumOfgluon = DP.apd(21);
636  int NumOfMuPl = DP.pd(-13);
637  int NumOfMuMin = DP.pd(13);
638  int NumOfTau = DP.apd(15);
639  int NumOfTauNeut = DP.apd(16);
640  if (std::abs(motherPDG) == 211 && numOfDaug == 2 && NumOfMuNeut == 1) return PionDecay;
641  if (std::abs(motherPDG) == 321 && numOfDaug == 2 && NumOfMuNeut == 1) return KaonDecay;
642  if (MC::isTau(motherPDG)) {
643  ParticleOrigin tauOrig = defOrigOfTau(mcTruthTES, mother, motherPDG, info);
644  ParticleType tautype = defTypeOfTau(tauOrig);
645  return (tautype == IsoTau)?tauOrig:TauLep;
646  }
647 
648  if (std::abs(motherPDG) == 6) return top;
649  // Quark weak decay
650  if (abs(motherPDG) < 7 && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && NumOfMuNeut == 1) return QuarkWeakDec;
651 
652  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
653  const xAOD::TruthVertex* prodVert = mothOriVert;
654  const xAOD::TruthParticle* itrP;
655  do {
656  itrP = prodVert->incomingParticle(0);
657  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
658  } while (MC::isW(itrP) && prodVert != nullptr);
659 
660  if (prodVert && prodVert->nIncomingParticles() == 1) {
661  if (abs(itrP->pdgId()) == 9900012) return NuREle;
662  if (abs(itrP->pdgId()) == 9900014) return NuRMu;
663  if (abs(itrP->pdgId()) == 9900016) return NuRTau;
664  }
665  return WBoson;
666  }
667  if (MC::isW(motherPDG)) return WBoson;
668  if (MC::isZ(motherPDG)) return ZBoson;
669  if (motherPDG == 22 && numOfDaug == 2 && NumOfMuMin == 1 && NumOfMuPl == 1) return PhotonConv;
670  //-- Exotics
671 
672  // MadGraphPythia ZWW*->lllnulnu
673 
674  if (numOfParents == 1 && numOfDaug > 4 && (abs(motherPDG) < 7 || motherPDG == 21)) {
675  bool isZboson = false;
676  bool isWboson = false;
677  bool skipnext = false;
678  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
679  if (skipnext) {
680  skipnext = false;
681  continue;
682  }
683  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
684  if (!theDaug) continue;
685  const xAOD::TruthParticle* theNextDaug = nullptr;
686  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
687  theNextDaug = partOriVert->outgoingParticle(ipOut1);
688  if (theNextDaug != nullptr) break;
689  }
690  if (!theNextDaug) continue;
691  if (abs(theDaug->pdgId()) == 13 && abs(theNextDaug->pdgId()) == 13) {
692  // Zboson
693  if (thePriPart == theDaug || thePriPart == theNextDaug) {
694  isZboson = true;
695  break;
696  }
697  skipnext = true;
698  } else if (abs(theDaug->pdgId()) == 13 && abs(theNextDaug->pdgId()) == 14) {
699  // WBoson
700  if (thePriPart == theDaug || thePriPart == theNextDaug) {
701  isWboson = true;
702  break;
703  }
704  skipnext = true;
705  }
706  }
707  if (isWboson) return WBoson;
708  if (isZboson) return ZBoson;
709  }
710  if (numOfParents == 2 ) {
711  int pdg1 = partOriVert->incomingParticle(0)->pdgId();
712  int pdg2 = partOriVert->incomingParticle(1)->pdgId();
713  //--Sherpa Z->mumu
714  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfMuPl == 1 && NumOfMuMin == 1) return ZBoson;
715 
716  //--Sherpa W->munu ??
717  // if(numOfParents==2&&(numOfDaug-NumOfquark-NumOfgluon)==2&&(NumOfEl==1||NumOfPos==1)&&NumOfElNeut==1) return WBoson;
718  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1) return WBoson;
719 
720  //--Sherpa ZZ,ZW
721  if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
722  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
723  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
724 
725  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
726  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
727  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
728  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
729 }
730 
731  //--New Sherpa Z->mumu
732  if (partOriVert == mothOriVert) {
733  int NumOfMuLoop = 0;
734  int NumOfMuNeuLoop = 0;
735  int NumOfLepLoop = 0;
736  for (const auto & pout: partOriVert->particles_out()) {
737  for (const auto & pin: partOriVert->particles_in()) {
738  if (!pout) continue;
739  if (!pin) continue;
740  if (HepMC::uniqueID(pout) == HepMC::uniqueID(pin)) {
741  if (std::abs(pout->pdg_id()) == 13) NumOfMuLoop++;
742  if (std::abs(pout->pdg_id()) == 14) NumOfMuNeuLoop++;
743  if (MC::isSMLepton(pout)) NumOfLepLoop++;
744  }
745  }
746  }
747  if (NumOfMuLoop == 2 && NumOfMuNeuLoop == 0) return ZBoson;
748  if (NumOfMuLoop == 1 && NumOfMuNeuLoop == 1) return WBoson;
749  if ((NumOfMuLoop == 4 && NumOfMuNeuLoop == 0) || (NumOfMuLoop == 3 && NumOfMuNeuLoop == 1) || (NumOfMuLoop == 2 && NumOfMuNeuLoop == 2)) return DiBoson;
750  if (NumOfLepLoop == 4) return DiBoson;
751  }
752 
753  //-- McAtNLo
754 
755  if (abs(motherPDG) == 25) return Higgs;
756 
757  if (abs(motherPDG) == 35 || abs(motherPDG) == 36 || abs(motherPDG) == 37) return HiggsMSSM;
758 
759  if (abs(motherPDG) == 32 || abs(motherPDG) == 33 || abs(motherPDG) == 34) return HeavyBoson;
760 
761  if (abs(motherPDG) == 9900024) return WBosonLRSM;
762  if (abs(motherPDG) == 9900012) return NuREle;
763  if (abs(motherPDG) == 9900014) return NuRMu;
764  if (abs(motherPDG) == 9900016) return NuRTau;
765  if (abs(motherPDG) == 42 || NumOfLQ != 0) return LQ;
766  if (MC::isSUSY(motherPDG)) return SUSY;
767  if (MC::isBSM(motherPDG)) return OtherBSM;
768 
769  ParticleType pType = defTypeOfHadron(motherPDG);
770  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatVrtx(mothOriVert)) isPrompt = true;
771 
772  return convHadronTypeToOrig(pType, motherPDG);
773 }

◆ defOrigOfNeutrino()

ParticleOrigin MCTruthClassifier::defOrigOfNeutrino ( const xAOD::TruthParticleContainer m_xTruthParticleContainer,
const xAOD::TruthParticle thePart,
bool &  isPrompt,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 1216 of file MCTruthClassifierGen.cxx.

1220 {
1222  ATH_MSG_DEBUG("Executing DefOrigOfNeutrino ");
1223 
1224  int nuFlav = abs(thePart->pdgId());
1225  const xAOD::TruthParticle* thePriPart = MC::find_matching(mcTruthTES, thePart);
1226  if (!thePriPart) return NonDefined;
1227  if (abs(thePriPart->pdgId()) != nuFlav) return NonDefined;
1228 
1229  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
1230 
1231  //-- to define neutrino outcome status
1232  if (info) info->particleOutCome = NonInteract;
1233 
1235  if (!info) { info = &tmpinfo; }
1236  if (!partOriVert) return NonDefined;
1237 
1238  int numOfParents = -1;
1239  numOfParents = partOriVert->nIncomingParticles();
1240  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfNeutrino:: neutrino has more than one mother ");
1241 
1242  const xAOD::TruthParticle* mother = MC::getMother(thePriPart);
1243  if (info) info->mother = mother;
1244  if (!mother) return NonDefined;
1245  int motherPDG = mother->pdgId();
1246  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1247 
1248  // to resolve Sherpa loop
1249  bool samePart = false;
1250  if (mothOriVert && HepMC::uniqueID(mothOriVert) == HepMC::uniqueID(partOriVert)) samePart = true;
1251  //
1252  if ((abs(motherPDG) == nuFlav || abs(motherPDG) == 15 || MC::isW(motherPDG)) && mothOriVert != nullptr &&
1253  !samePart) {
1254  long pPDG(0);
1255  const xAOD::TruthParticle* MotherParent(nullptr);
1256  do {
1257  pPDG = 0;
1258  MotherParent = MC::getMother(mother);
1259  // to prevent Sherpa loop
1260  const xAOD::TruthVertex* mother_prdVtx(nullptr);
1261  const xAOD::TruthVertex* mother_endVtx(nullptr);
1262  if (mother) {
1263  mother_prdVtx = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1264  mother_endVtx = mother->decayVtx();
1265  }
1266  const xAOD::TruthVertex* parent_prdVtx(nullptr);
1267  const xAOD::TruthVertex* parent_endVtx(nullptr);
1268  if (MotherParent) {
1269  parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() : nullptr;
1270  parent_endVtx = MotherParent->decayVtx();
1271  }
1272  if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
1273  MotherParent = mother;
1274  break;
1275  }
1276  //
1277  if (MotherParent) {
1278  pPDG = MotherParent->pdgId();
1279  }
1280  // to prevent Sherpa loop
1281  if (mother == MotherParent) {
1282  break;
1283  }
1284  if (abs(pPDG) == nuFlav || abs(pPDG) == 15 || abs(pPDG) == 24 ) {
1285  mother = MotherParent;
1286  if (info) info->setMotherProperties(mother);
1287  }
1288 
1289  } while ((std::abs(pPDG) == nuFlav || std::abs(pPDG) == 15 || std::abs(pPDG) == 24));
1290 
1291  if (std::abs(pPDG) == nuFlav || std::abs(pPDG) == 15 || std::abs(pPDG) == 24 || std::abs(pPDG) == 23 || std::abs(pPDG) == 25 ||
1292  std::abs(pPDG) == 35 || std::abs(pPDG) == 36 || std::abs(pPDG) == 37 || std::abs(pPDG) == 32 || std::abs(pPDG) == 33 ||
1293  std::abs(pPDG) == 34 || std::abs(pPDG) == 6 || std::abs(pPDG) == 9900024 || std::abs(pPDG) == 9900012 || std::abs(pPDG) == 9900014 ||
1294  std::abs(pPDG) == 9900016 || (std::abs(pPDG) < 2000040 && std::abs(pPDG) > 1000001)) {
1295  mother = MotherParent;
1296  if (info) info->setMotherProperties(mother);
1297  }
1298  }
1299  //if mother is still nullptr, we have a problem
1300  if (!mother) return NonDefined;
1301 
1302  motherPDG = mother->pdgId();
1303  partOriVert = mother->decayVtx();
1304  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1305  numOfParents = partOriVert->nIncomingParticles();
1306  int numOfDaug = partOriVert->nOutgoingParticles();
1307 
1308  if (info) info->setMotherProperties(mother);
1309 
1310  int NumOfPhot(0);
1311  int NumOfquark(0);
1312  int NumOfgluon(0);
1313  int NumOfLQ(0);
1314  int NumOfElNeut(0);
1315  int NumOfMuNeut(0);
1316  int NumOfTauNeut(0);
1317  int NumOfEl(0);
1318  int NumOfMu(0);
1319  int NumOfTau(0);
1320  samePart = false;
1321 
1322  for (const auto& theDaug: partOriVert->particles_out()) {
1323  if (!theDaug) continue;
1324  int DaugType = theDaug->pdgId();
1325  if (abs(DaugType) < 7) NumOfquark++;
1326  if (abs(DaugType) == 21) NumOfgluon++;
1327  if (abs(DaugType) == 12) NumOfElNeut++;
1328  if (std::abs(DaugType) == 14) NumOfMuNeut++;
1329  if (std::abs(DaugType) == 16) NumOfTauNeut++;
1330  if (DaugType == 22) NumOfPhot++;
1331  if (std::abs(DaugType) == 11) NumOfEl++;
1332  if (std::abs(DaugType) == 13) NumOfMu++;
1333  if (std::abs(DaugType) == 15) NumOfTau++;
1334  if (std::abs(DaugType) == 42) NumOfLQ++;
1335  if (std::abs(DaugType) == std::abs(motherPDG) && theDaug && info && info->Mother() && HepMC::is_same_generator_particle(theDaug,info->Mother())) samePart = true;
1336  }
1337 
1338  // Quark weak decay
1339  if (MC::isQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && (NumOfEl == 1 || NumOfMu == 1 || NumOfTau == 1)) return QuarkWeakDec;
1340  if (std::abs(motherPDG) == 6) return top;
1341 
1342  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
1343  const xAOD::TruthVertex* prodVert = mothOriVert;
1344  const xAOD::TruthParticle* ptrPart;
1345  do {
1346  ptrPart = prodVert->incomingParticle(0);
1347  prodVert = ptrPart->hasProdVtx() ? ptrPart->prodVtx() : nullptr;
1348  } while (MC::isW(ptrPart) && prodVert != nullptr);
1349 
1350  if (prodVert && prodVert->nIncomingParticles() == 1) {
1351  if (abs(ptrPart->pdgId()) == 9900012) return NuREle;
1352  if (abs(ptrPart->pdgId()) == 9900014) return NuRMu;
1353  if (abs(ptrPart->pdgId()) == 9900016) return NuRTau;
1354  }
1355  return WBoson;
1356  }
1357  if (MC::isW(motherPDG)) return WBoson;
1358  if (MC::isZ(motherPDG)) return ZBoson;
1359 
1360  //-- Exotics
1361 
1362  // MadGraphPythia ZWW*->lllnulnu or ZWW*->nunulnulnu (don't even know if the latter is generated)
1363  if (numOfParents == 1 && numOfDaug > 4 && (abs(motherPDG) < 7 || motherPDG == 21)) {
1364 
1365  const xAOD::TruthParticle* thePartToCheck = thePriPart;
1366  const xAOD::TruthParticle* theMother = thePriPart->hasProdVtx() ? thePriPart->prodVtx()->incomingParticle(0) : nullptr;
1367 
1368  if (abs(theMother->pdgId()) == 11 && MC::isDecayed(theMother)) thePartToCheck = theMother;
1369  bool isZboson = false;
1370  bool isWboson = false;
1371  bool skipnext = false;
1372 
1373  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ++ipOut) {
1374  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
1375  if (!theDaug) continue;
1376  const xAOD::TruthParticle* theNextDaug = nullptr;
1377  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
1378  theNextDaug = partOriVert->outgoingParticle(ipOut1);
1379  if (theNextDaug != nullptr) break;
1380  }
1381  if (!theNextDaug) continue;
1382 
1383  if (skipnext) {
1384  skipnext = false;
1385  continue;
1386  }
1387 
1388  int apdgID1 = abs(theDaug->pdgId());
1389  int apdgID2 = abs(theNextDaug->pdgId());
1390  if ((apdgID1 == 12 && apdgID2 == 12) || (apdgID1 == 14 && apdgID2 == 14) || (apdgID1 == 16 && apdgID2 == 16)) {
1391  // Zboson
1392  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1393  isZboson = true;
1394  break;
1395  }
1396  skipnext = true;
1397  } else if ((apdgID1 == 11 && apdgID2 == 12) || (apdgID1 == 14 && apdgID2 == 14) ||
1398  (apdgID1 == 16 && apdgID2 == 16)) {
1399  // WBoson
1400  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1401  isWboson = true;
1402  break;
1403  }
1404  skipnext = true;
1405  }
1406  }
1407  if (isWboson) return WBoson;
1408  if (isZboson) return ZBoson;
1409  }
1410 
1411  if (numOfParents == 2) {
1412  int pdg1 = partOriVert->incomingParticle(0)->pdgId();
1413  int pdg2 = partOriVert->incomingParticle(1)->pdgId();
1414  //--Sherpa Z->nunu
1415  if ( (numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2)) return ZBoson;
1416 
1417  //--Sherpa W->enu ??
1418  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && ((NumOfEl == 1 && NumOfElNeut == 1) || (NumOfMu == 1 && NumOfMuNeut == 1) || (NumOfTau == 1 && NumOfTauNeut == 1))) return WBoson;
1419 
1420  //--Sherpa ZZ,ZW
1421  if ( (numOfDaug - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
1422  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
1423 
1424  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
1425  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
1426  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
1427  }
1428 
1429  // New Sherpa Z->nunu
1430  if (partOriVert == mothOriVert && partOriVert != nullptr) {
1431  int NumOfLepLoop = 0;
1432  int NumOfNeuLoop = 0;
1433  for (const auto *const pout: partOriVert->particles_out()) {
1434  if (!pout) continue;
1435  for (const auto *const pin: partOriVert->particles_in()) {
1436  if (!pin) continue;
1437  if (HepMC::uniqueID(pin) == HepMC::uniqueID(pout)) continue;
1438  int apdgid = abs(pout->pdgId());
1439  if (apdgid == 12 || apdgid == 14 || apdgid == 16) NumOfNeuLoop++;
1440  if (apdgid == 11 || apdgid == 13 || apdgid == 15) NumOfLepLoop++;
1441  }
1442  }
1443  if (NumOfNeuLoop == 2 && NumOfLepLoop == 0) return ZBoson;
1444  if (NumOfNeuLoop == 1 && NumOfLepLoop == 1) return WBoson;
1445  if (NumOfNeuLoop + NumOfLepLoop == 4) return DiBoson;
1446  }
1447 
1448  //-- McAtNLo
1449 
1450  if (abs(motherPDG) == 25) return Higgs;
1451  if (abs(motherPDG) == 35 || abs(motherPDG) == 36 || abs(motherPDG) == 37) return HiggsMSSM;
1452  if (abs(motherPDG) == 32 || abs(motherPDG) == 33 || abs(motherPDG) == 34) return HeavyBoson;
1453 
1454  if (abs(motherPDG) == 15) {
1455  ParticleOrigin tauOrig = defOrigOfTau(mcTruthTES, mother, motherPDG, info);
1456  ParticleType tautype = defTypeOfTau(tauOrig);
1457  return (tautype == IsoTau)?tauOrig:TauLep;
1458  }
1459 
1460  if (abs(motherPDG) == 9900024) return WBosonLRSM;
1461  if (abs(motherPDG) == 9900012) return NuREle;
1462  if (abs(motherPDG) == 9900014) return NuRMu;
1463  if (abs(motherPDG) == 9900016) return NuRTau;
1464  if (abs(motherPDG) == 42 || NumOfLQ != 0) return LQ;
1465  if (MC::isSUSY(motherPDG)) return SUSY;
1466  if (MC::isBSM(motherPDG)) return OtherBSM;
1467 
1468  ParticleType pType = defTypeOfHadron(motherPDG);
1469  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatVrtx(mothOriVert)) isPrompt = true;
1470 
1471  return convHadronTypeToOrig(pType, motherPDG);
1472 }

◆ defOrigOfPhoton()

ParticleOrigin MCTruthClassifier::defOrigOfPhoton ( const xAOD::TruthParticleContainer m_xTruthParticleContainer,
const xAOD::TruthParticle thePart,
bool &  isPrompt,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 952 of file MCTruthClassifierGen.cxx.

956 {
957  if (!thePart) return NonDefined;
958  if (!mcTruthTES) return NonDefined;
960  ATH_MSG_DEBUG("Executing DefOrigOfPhoton ");
961 
963  if (!info) { info = &tmpinfo; }
964  if (info) {
965  info->resetMotherProperties();
966  info->photonMother = nullptr;
967  info->photonMotherBarcode = 0;
968  info->photonMotherPDG = 0;
969  info->photonMotherStatus = 0;
970  }
971 
972  const xAOD::TruthParticle* thePriPart = MC::find_matching(mcTruthTES, thePart);
973  if (!thePriPart) return NonDefined;
974  if (abs(thePriPart->pdgId()) != 22) return NonDefined;
975 
976  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
977 
978  //-- to define photon outcome status
979  if (info) info->particleOutCome = defOutComeOfPhoton(thePriPart);
980  if (!partOriVert) return NonDefined;
981 
982  int numOfParents = partOriVert->nIncomingParticles();
983  if (partOriVert->nIncomingParticles() > 1) ATH_MSG_DEBUG("DefOrigOfPhoton:: photon has more than one mother ");
984 
985 
986  const xAOD::TruthParticle* mother = MC::getMother(thePriPart);
987  if (info) info->setMotherProperties(mother);
988  if (!mother) return NonDefined;
989  int motherPDG = mother->pdgId();
990  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
991  int motherStatus = mother->status();
992  if (info) info->setMotherProperties(mother);
993  partOriVert = mother->decayVtx();
994  numOfParents = partOriVert->nIncomingParticles();
995  int numOfDaug = partOriVert->nOutgoingParticles();
996  int NumOfNucFr(0);
997  int NumOfEl(0);
998  int NumOfPos(0);
999  int NumOfMu(0);
1000  int NumOfTau(0);
1001  int NumOfPht(0);
1002  int NumOfLQ(0);
1003  long DaugType(0);
1004  long NumOfLep(0);
1005  long NumOfNeut(0);
1006  long NumOfPartons(0);
1007  const xAOD::TruthParticle* Daug = nullptr;
1008  for (const auto& pout: partOriVert->particles_out()) {
1009  if (!pout) continue;
1010  DaugType = pout->pdg_id();
1011  if (numOfParents == 1 && (motherPDG == 22 || abs(motherPDG) == 11 || abs(motherPDG) == 211) &&
1012  (DaugType > 1000000000 || DaugType == 0 || DaugType == 2212 || DaugType == 2112))
1013  NumOfNucFr++;
1014  if (DaugType == 22) NumOfPht++;
1015  if (DaugType == 11) NumOfEl++;
1016  if (DaugType == -11) NumOfPos++;
1017  if (abs(DaugType) == 13) NumOfMu++;
1018  if (abs(DaugType) == 15) NumOfTau++;
1019  if (abs(DaugType) == 42) NumOfLQ++;
1020  if (abs(DaugType) == 11 || abs(DaugType) == 13 || abs(DaugType) == 15) NumOfLep++;
1021  if (abs(DaugType) == 12 || abs(DaugType) == 14 || abs(DaugType) == 16) NumOfNeut++;
1022  if (abs(DaugType) < 11 || (abs(DaugType) > 16 && abs(DaugType) < 43 && abs(DaugType) != 22)) NumOfPartons++;
1023  if (DaugType == motherPDG) {
1024  Daug = pout;
1025  }
1026  }
1027 
1028  bool foundISR = false;
1029  bool foundFSR = false;
1030  if (numOfParents == 1 && numOfDaug == 2 && Daug && info && info->Mother() && HepMC::is_same_generator_particle(Daug, info->Mother())) return BremPhot;
1031  if (numOfParents == 1 && numOfDaug == 2 && abs(motherPDG) == 11 && NumOfPht == 2) return ElMagProc;
1032 
1033  // decay of W,Z and Higgs to lepton with FSR generated by Pythia
1034  if (numOfParents == 1 && numOfDaug == 2 && (abs(motherPDG) == 11 || abs(motherPDG) == 13 || abs(motherPDG) == 15) &&
1035  !(Daug && info && info->Mother() && HepMC::is_same_generator_particle(Daug, info->Mother())) && mothOriVert != nullptr &&
1036  mothOriVert->nIncomingParticles() == 1) {
1037  int itr = 0;
1038  long PartPDG = 0;
1039  const xAOD::TruthVertex* prodVert = mothOriVert;
1040  const xAOD::TruthVertex* Vert = nullptr;
1041  do {
1042  Vert = prodVert;
1043  for (const auto & pin: Vert->particles_in()) {
1044  if (!pin) continue;
1045  PartPDG = abs(pin->pdgId());
1046  prodVert = pin->prodVtx();
1047  if (PartPDG == 23 || PartPDG == 24 || PartPDG == 25) foundFSR = true;
1048  }
1049  itr++;
1050  if (itr > 100) {
1051  ATH_MSG_WARNING("DefOrigOfPhoton:: infinite while");
1052  break;
1053  }
1054  } while (prodVert != nullptr && abs(motherPDG) == PartPDG);
1055 
1056  if (foundFSR) return FSRPhot;
1057  }
1058 
1059  // Nucl reaction
1060  // gamma+Nuclear=>gamma+Nucl.Fr+Nuclons+pions
1061  // e+Nuclear=>e+gamma+Nucl.Fr+Nuclons+pions
1062  // pi+Nuclear=>gamma+Nucl.Fr+Nuclons+pions
1063 
1064  if ((numOfParents == 1 && (abs(motherPDG) == 22 || abs(motherPDG) == 11) && numOfDaug > 2 && NumOfNucFr != 0) ||
1065  (numOfParents == 1 && abs(motherPDG) == 211 && numOfDaug > 10 && NumOfNucFr != 0) ||
1066  (numOfParents == 1 && motherPDG == 22 && numOfDaug > 10 && motherStatus == 1) ||
1067  (numOfParents == 1 && motherPDG > 1000000000))
1068  return NucReact;
1069 
1070  if (MC::isMuon(motherPDG) && NumOfMu == 0) return Mu;
1071  if (MC::isTau(motherPDG) && NumOfTau == 0) return TauLep;
1072 
1073  if (numOfParents == 1 && motherStatus == 3) return (foundISR)? ISRPhot:UndrPhot;
1074 
1075  //-- to find initial and final state raiation and underline photons
1076  //-- SUSY
1077  if (numOfParents == 1 && (abs(motherPDG) < 7 || motherPDG == 21) &&
1078  (numOfDaug != NumOfPht + NumOfPartons ||
1079  (motherStatus != 62 && motherStatus != 52 && motherStatus != 21 && motherStatus != 22))) {
1080  for (const auto& pout: partOriVert->particles_out()) {
1081  if (!pout) continue;
1082  if (motherPDG != pout->pdgId()) continue;
1083  const xAOD::TruthVertex* Vrtx = pout->decayVtx();
1084  if (!Vrtx) continue;
1085  if (Vrtx->nOutgoingParticles() != 1 && Vrtx->nIncomingParticles() == 1) continue;
1086  if (!Vrtx->outgoingParticle(0)) continue;
1087  if (Vrtx->outgoingParticle(0)->pdgId() == 91) foundISR = true;
1088  }
1089  return (foundISR)?ISRPhot:UndrPhot;
1090  }
1091 
1092  //-- to find final state radiation
1093  //-- Exotics
1094 
1095  // FSR from Photos
1096  //-- Exotics- CompHep
1097  if (numOfParents == 2 && ((abs(motherPDG) == 11 && NumOfEl == 1 && NumOfPos == 1) || (abs(motherPDG) == 13 && NumOfMu == 2) || (abs(motherPDG) == 15 && NumOfTau == 2))) {
1098  if (abs(partOriVert->incomingParticle(0)->pdgId()) == abs(partOriVert->incomingParticle(1)->pdgId())) return FSRPhot;
1099  }
1100 
1101  if (numOfParents == 2 && NumOfLep == 1 && NumOfNeut == 1 && (abs(motherPDG) == 11 || abs(motherPDG) == 12)) return FSRPhot;
1102 
1103  //-- Exotics - CompHep
1104  if (abs(motherPDG) == 11 && numOfParents == 1 && numOfDaug == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfPht == 1 &&
1105  !( Daug && info && info->Mother() && HepMC::is_same_generator_particle(Daug, info->Mother())) && !HepMC::is_simulation_particle(Daug) && !HepMC::is_simulation_particle(info->Mother()))
1106  return FSRPhot;
1107 
1108  // FSR from Photos
1109  if (MC::isZ(motherPDG) && ((NumOfEl + NumOfPos == 2 || NumOfEl + NumOfPos == 4) || (NumOfMu == 2 || NumOfMu == 4) || (NumOfTau == 2 || NumOfTau == 4)) && NumOfPht > 0) return FSRPhot;
1110 
1111  if (NumOfPht > 0 && (abs(motherPDG) == 9900024 || abs(motherPDG) == 9900012 || abs(motherPDG) == 9900014 || abs(motherPDG) == 9900016)) return FSRPhot;
1112 
1113  if (numOfParents == 2 && NumOfLQ == 1) return FSRPhot;
1114 
1115  //--- other process
1116 
1117  if (MC::isZ(motherPDG)) return ZBoson;
1118  if (MC::isW(motherPDG)) {
1119 
1120  if (NumOfLep == 1 && NumOfNeut == 1 && numOfDaug == NumOfLep + NumOfNeut + NumOfPht) return FSRPhot;
1121 
1122  if (mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
1123  const xAOD::TruthVertex* prodVert = mothOriVert;
1124  const xAOD::TruthParticle* itrP;
1125  do {
1126  itrP = prodVert->incomingParticle(0);
1127  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
1128  } while (MC::isW(itrP) && prodVert != nullptr);
1129 
1130  if (prodVert && prodVert->nIncomingParticles() == 1 ) {
1131  if ( MC::isTau(itrP)) return TauLep;
1132  if ( MC::isMuon(itrP)) return Mu;
1133  if ( abs(itrP->pdgId()) == 9900012) return NuREle;
1134  if ( abs(itrP->pdgId()) == 9900014) return NuRMu;
1135  if ( abs(itrP->pdgId()) == 9900016) return NuRTau;
1136  }
1137  } else
1138  return WBoson;
1139  }
1140 
1141  // MadGraphPythia ZWW*->lllnulnu
1142  if (numOfParents == 1 && numOfDaug > 4 && (abs(motherPDG) < 7 || motherPDG == 21)) {
1143  bool isZboson = false;
1144  bool isWboson = false;
1145  bool skipnext = false;
1146  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
1147  if (skipnext) {
1148  skipnext = false;
1149  continue;
1150  }
1151  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
1152  if (!theDaug) continue;
1153  const xAOD::TruthParticle* theNextDaug = nullptr;
1154  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
1155  theNextDaug = partOriVert->outgoingParticle(ipOut1);
1156  if (theNextDaug != nullptr) break;
1157  }
1158  if (!theNextDaug) continue;
1159  if (abs(theDaug->pdgId()) == 15 && abs(theNextDaug->pdgId()) == 15) {
1160  // Zboson
1161  if (thePriPart == theDaug || thePriPart == theNextDaug) {
1162  isZboson = true;
1163  break;
1164  }
1165  skipnext = true;
1166  } else if (abs(theDaug->pdgId()) == 15 && abs(theNextDaug->pdgId()) == 16) {
1167  // WBoson
1168  if (thePriPart == theDaug || thePriPart == theNextDaug) {
1169  isWboson = true;
1170  break;
1171  }
1172  skipnext = true;
1173  }
1174  }
1175  if (isWboson) return WBoson;
1176  if (isZboson) return ZBoson;
1177  }
1178 
1179  //--Sherpa ZZ,ZW+FSR
1180  if (numOfParents == 4 && (numOfDaug - NumOfPht) == 4 && (NumOfLep + NumOfNeut == 4)) {
1181  if (MC::isSMLepton(partOriVert->incomingParticle(0))&&MC::isSMLepton(partOriVert->incomingParticle(1))
1182  && MC::isSMLepton(partOriVert->incomingParticle(2))&&MC::isSMLepton(partOriVert->incomingParticle(3)))
1183  return FSRPhot;
1184  }
1185 
1186  //--New Sherpa single photon
1187  if (partOriVert == mothOriVert && partOriVert != nullptr) {
1188  int NumOfPhtLoop = 0;
1189  for (const auto *const pout: partOriVert->particles_out()) {
1190  if (!pout) continue;
1191  for (const auto *const pin: partOriVert->particles_in()) {
1192  if (!pin) continue;
1193  if (HepMC::uniqueID(pout) == HepMC::uniqueID(pin) && MC::isPhoton(pout)) NumOfPhtLoop++;
1194  if (NumOfPhtLoop == 1) return SinglePhot;
1195  }
1196  }
1197  }
1198 
1199  if (abs(motherPDG) == 25) return Higgs;
1200  if (abs(motherPDG) == 111) return PiZero;
1201  if (abs(motherPDG) == 35 || abs(motherPDG) == 36 || abs(motherPDG) == 37) return HiggsMSSM;
1202  if (abs(motherPDG) == 32 || abs(motherPDG) == 33 || abs(motherPDG) == 34 || abs(motherPDG) == 5100039 ) return HeavyBoson;
1203 
1204  if (MC::isSUSY(motherPDG)) return SUSY;
1205  if (MC::isBSM(motherPDG)) return OtherBSM;
1206 
1207  // Pythia8 gamma+jet samples
1208  if ((motherStatus == 62 || motherStatus == 52 || motherStatus == 21 || motherStatus == 22) && MC::isStable(thePriPart) && NumOfPht == 1 && numOfDaug == (NumOfPht + NumOfPartons)) return PromptPhot;
1209 
1210  ParticleType pType = defTypeOfHadron(motherPDG);
1211  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatVrtx(mothOriVert)) isPrompt = true;
1212  return convHadronTypeToOrig(pType, motherPDG);
1213 }

◆ defOrigOfTau()

ParticleOrigin MCTruthClassifier::defOrigOfTau ( const xAOD::TruthParticleContainer m_xTruthParticleContainer,
const xAOD::TruthParticle thePart,
int  motherPDG,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 775 of file MCTruthClassifierGen.cxx.

779 {
781  ATH_MSG_DEBUG("Executing DefOrigOfTau ");
782  const xAOD::TruthParticle* thePriPart = MC::find_matching(mcTruthTES, thePart);
783  if (!thePriPart) return NonDefined;
784  if (abs(thePriPart->pdgId()) != 15) return NonDefined;
785 
786  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
787 
788  //-- to define tau outcome status
789  if (MC::isPhysical(thePriPart) && info) info->particleOutCome = defOutComeOfTau(thePriPart);
790 
792  if (!info) { info = &tmpinfo; }
793  if (!partOriVert) return NonDefined;
794 
795  int numOfParents = partOriVert->nIncomingParticles();
796  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfTau:: tau has more than one mother ");
797 
798  const xAOD::TruthParticle* mother = MC::getMother(thePriPart);
799  if (info) info->setMotherProperties(mother);
800  if (!mother) {
801  return NonDefined;
802  }
803 
804  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
805 
806  const xAOD::TruthParticle* MotherParent(nullptr);
807 
808  if (MC::isW(motherPDG) && mothOriVert != nullptr) {
809  MotherParent = MC::getMother(mother);
810  long pPDG(0);
811 
812  if (MotherParent) {//MotherParent checked here...
813  pPDG = MotherParent->pdgId();
814  if (abs(pPDG) == 6) {
815  mother = MotherParent; //...so mother cannot be nullptr
816  if (info) info->setMotherProperties(mother);
817  }
818  }
819  }
820 
821  motherPDG = mother->pdgId();
822  if (info) info->setMotherProperties(mother);
823  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
824  partOriVert = mother->decayVtx();
825  if (!partOriVert) return NonDefined;
826 
827  numOfParents = partOriVert->nIncomingParticles();
828  auto DP = DecayProducts(partOriVert);
829  int numOfDaug = DP.size();
830  int NumOfPhot = DP.pd(22);
831  int NumOfEl = DP.pd(11);
832  int NumOfPos = DP.pd(-11);
833  int NumOfElNeut = DP.apd(12);
834  int NumOfMuNeut = DP.apd(14);
835  /* int NumOfLQ = DP.apd(42); */
836  int NumOfquark = DP.apd({1,2,3,4,5,6});
837  int NumOfgluon = DP.apd(21);
838  int NumOfMuPl = DP.pd(-13);
839  int NumOfMuMin = DP.pd(13);
840  int NumOfTau = DP.apd(15);
841  int NumOfTauNeut = DP.pd(16);
842 
843  if (abs(motherPDG) == 6) return top;
844  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
845  const xAOD::TruthVertex* prodVert = mothOriVert;
846  const xAOD::TruthParticle* itrP;
847  do {
848  itrP = prodVert->incomingParticle(0);
849  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
850  } while (MC::isW(itrP) && prodVert != nullptr);
851 
852  if (prodVert && prodVert->nIncomingParticles() == 1 ) {
853  if (abs(itrP->pdgId()) == 9900012) return NuREle;
854  if (abs(itrP->pdgId()) == 9900014) return NuRMu;
855  if (abs(itrP->pdgId()) == 9900016) return NuRTau;
856  }
857  return WBoson;
858  }
859  if (MC::isW(motherPDG)) { return WBoson;}
860  if (MC::isZ(motherPDG)) { return ZBoson;}
861  if (numOfParents == 1 && numOfDaug > 4 && (abs(motherPDG) < 7 || motherPDG == 21)) {
862  bool isZboson = false;
863  bool isWboson = false;
864  bool skipnext = false;
865  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
866  if (skipnext) {
867  skipnext = false;
868  continue;
869  }
870  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
871  if (!theDaug) continue;
872  const xAOD::TruthParticle* theNextDaug = nullptr;
873  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
874  theNextDaug = partOriVert->outgoingParticle(ipOut1);
875  if (theNextDaug != nullptr) break;
876  }
877  if (!theNextDaug) {
878  continue;
879  }
880  if (abs(theDaug->pdgId()) == 15 && abs(theNextDaug->pdgId()) == 15) {
881  // Zboson
882  if (thePriPart == theDaug || thePriPart == theNextDaug) {
883  isZboson = true;
884  break;
885  }
886  skipnext = true;
887  } else if (abs(theDaug->pdgId()) == 15 && abs(theNextDaug->pdgId()) == 16) {
888  // WBoson
889  if (thePriPart == theDaug || thePriPart == theNextDaug) {
890  isWboson = true;
891  break;
892  }
893  skipnext = true;
894  }
895  }
896  if (isWboson) return WBoson;
897  if (isZboson) return ZBoson;
898  }
899  if (numOfParents == 2 ) {
900  int pdg1 = partOriVert->incomingParticle(0)->pdgId();
901  int pdg2 = partOriVert->incomingParticle(1)->pdgId();
902  //--Sherpa Z->tautau
903  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfTau == 2 && (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return ZBoson;
904 
905  //--Sherpa W->taunu new
906  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfTau == 1 && NumOfTauNeut == 1) return WBoson;
907 
908  //--Sherpa ZZ,ZW
909  if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
910  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
911  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
912 
913  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
914  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
915  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
916  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
917  }
918  // New Sherpa Z->tautau
919  if (partOriVert == mothOriVert) {
920  int NumOfTauLoop = 0;
921  int NumOfTauNeuLoop = 0;
922  int NumOfLepLoop = 0;
923  for ( const auto *const pout: partOriVert->particles_out()) {
924  if (!pout) continue;
925  for (const auto *const pin: partOriVert->particles_in()) {
926  if (!pin) continue;
927  if (HepMC::uniqueID(pout) != HepMC::uniqueID(pin)) continue;
928  if (std::abs(pout->pdgId()) == 15) NumOfTauLoop++;
929  if (std::abs(pout->pdgId()) == 16) NumOfTauNeuLoop++;
930  if (MC::isSMLepton(pout)) NumOfLepLoop++;
931  }
932  }
933  if (NumOfTauLoop == 2 && NumOfTauNeuLoop == 0) return ZBoson;
934  if (NumOfTauLoop == 1 && NumOfTauNeuLoop == 1) return WBoson;
935  if ((NumOfTauLoop == 4 && NumOfTauNeuLoop == 0) || (NumOfTauLoop == 3 && NumOfTauNeuLoop == 1) || (NumOfTauLoop == 2 && NumOfTauNeuLoop == 2)) return DiBoson;
936  if (NumOfLepLoop == 4) return DiBoson;
937  }
938 
939  if (abs(motherPDG) == 25) return Higgs;
940  if (abs(motherPDG) == 35 || abs(motherPDG) == 36 || abs(motherPDG) == 37) return HiggsMSSM;
941  if (abs(motherPDG) == 32 || abs(motherPDG) == 33 || abs(motherPDG) == 34) return HeavyBoson;
942  if (abs(motherPDG) == 9900024) return WBosonLRSM;
943  if (abs(motherPDG) == 9900016) return NuRTau;
944  if (MC::isSUSY(motherPDG)) return SUSY;
945  if (MC::isBSM(motherPDG)) return OtherBSM;
946  if (abs(motherPDG) == 443) return JPsi;
947 
948  ParticleType pType = defTypeOfHadron(motherPDG);
949  return convHadronTypeToOrig(pType, motherPDG);
950 }

◆ detEta()

double MCTruthClassifier::detEta ( double  x,
double  y 
) const
inlineprivateinherited

Definition at line 175 of file MCTruthClassifier.h.

◆ detPhi()

double MCTruthClassifier::detPhi ( double  x,
double  y 
) const
inlineprivateinherited

Definition at line 176 of file MCTruthClassifier.h.

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ egammaClusMatch()

const xAOD::TruthParticle * MCTruthClassifier::egammaClusMatch ( const xAOD::CaloCluster clus,
bool  isFwrdEle,
MCTruthPartClassifier::Info info 
) const
privateinherited

Definition at line 44 of file MCTruthClassifierAthena.cxx.

45 {
46  ATH_MSG_DEBUG("Executing egammaClusMatch ");
47  const xAOD::TruthParticle* theMatchPart = nullptr;
48  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
49  // retrieve collection and get a pointer
51 
52  if (!truthParticleContainerReadHandle.isValid()) {
53  ATH_MSG_WARNING( " Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
54  return theMatchPart;
55  }
56 
58  if (!caloMgrHandle.isValid()) {
59  ATH_MSG_WARNING(" Invalid ReadCondHandle for CaloDetDescrManager with key: " << m_caloMgrKey.key());
60  return theMatchPart;
61  }
62 
63  const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
64  const xAOD::TruthParticle* theEgamma(nullptr);
65  const xAOD::TruthParticle* theLeadingPartInCone(nullptr);
66  const xAOD::TruthParticle* theBestPartOutCone(nullptr);
67  const xAOD::TruthParticle* theBestPartdR(nullptr);
68  double LeadingPhtPT(0);
69  double LeadingPartPT(0);
70  double LeadingPhtdR(999.);
71  double LeadingPartdR(999.);
72  double BestPartdR(999.);
73  double etaClus = clus->etaBE(2);
74  double phiClus = clus->phiBE(2);
75  if (etaClus < -900) {
76  etaClus = clus->eta();
77  }
78  if (phiClus < -900) {
79  phiClus = clus->phi();
80  }
81  std::vector<const xAOD::TruthParticle*> tps;
82  if (!m_truthInConeTool->particlesInCone(ctx, etaClus, phiClus, 0.5, tps)) {
83  ATH_MSG_WARNING("Truth Particle in Cone failed");
84  return theMatchPart;
85  }
86 
87  for (const auto* const thePart : tps) {
88  // loop over the stable particle
89  if (!MC::isStable(thePart)) continue;
90  // excluding G4 particle
91  if ((!isFwrdEle || (isFwrdEle && m_FwdElectronUseG4Sel)) && HepMC::is_simulation_particle(thePart)) continue;
92  long iParticlePDG = thePart->pdgId();
93  // excluding neutrino
94  if (std::abs(iParticlePDG) == 12 || std::abs(iParticlePDG) == 14 || std::abs(iParticlePDG) == 16) continue;
95  double pt = thePart->pt() / Athena::Units::GeV;
96  double q = thePart?thePart->charge():0.0;
97  // exclude charged particles with pT<1 GeV
98  if (q != 0 && pt < m_pTChargePartCut) continue;
99  if (q == 0 && pt < m_pTNeutralPartCut) continue;
100 
101  // eleptical cone for extrapolations m_partExtrConePhi X m_partExtrConeEta
102  if (!isFwrdEle && m_ROICone && std::hypot( detPhi(phiClus, thePart->phi())/m_partExtrConePhi, detEta(etaClus, thePart->eta())/m_partExtrConeEta) > 1.0) {
103  continue;
104  }
105  // Also check if the clus and true have different sign , i they need both to be <0 or >0
106  if (isFwrdEle && // It is forward and
107  (((etaClus < 0) - (thePart->eta() < 0) != 0)
108  // The truth eta has different sign wrt to the fwd electron
109  || (std::fabs(thePart->eta()) < m_FwdElectronTruthExtrEtaCut) // or the truth is less than 2.4 (default cut)
110  || (std::fabs(thePart->eta() - etaClus) > m_FwdElectronTruthExtrEtaWindowCut) // or if the delta Eta between el and truth is > 0.15
111  ) // then do no extrapolate this truth Particle for this fwd electron
112  ) {
113  continue;
114  }
115  double dR(-999.);
116  bool isNCone = false;
117  bool isExt = genPartToCalo(ctx, clus, thePart, isFwrdEle, dR, isNCone, *caloDDMgr);
118  if (!isExt) continue;
119  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(), thePart);
120  if (info) {
121  info->egPartPtr.push_back(thePart);
122  info->egPartdR.push_back(dR);
123  info->egPartClas.push_back(particleTruthClassifier(theMatchPart, info));
124  }
125  // Gen particles Not forward
126  if (!isFwrdEle) {
127  // the leading photon or electron inside narrow eleptical cone
128  // m_phtClasConePhi X m_phtClasConeEta
129  if ((iParticlePDG == 22 || std::abs(iParticlePDG) == 11) && isNCone && pt > LeadingPhtPT) {
130  theEgamma = thePart;
131  LeadingPhtPT = pt;
132  LeadingPhtdR = dR;
133  }
134  // leading particle (excluding photon and electron) inside narrow eleptic
135  // cone m_phtClasConePhi X m_phtClasConeEta
136  if ((iParticlePDG != 22 && std::abs(iParticlePDG) != 11) && isNCone && pt > LeadingPartPT) {
137  theLeadingPartInCone = thePart;
138  LeadingPartPT = pt;
139  LeadingPartdR = dR;
140  };
141  // the best dR matched particle outside narrow eleptic cone cone
142  // m_phtClasConePhi X m_phtClasConeEta
143  if (!isNCone && dR < BestPartdR) {
144  theBestPartOutCone = thePart;
145  BestPartdR = dR;
146  };
147  } else {
148  if (dR < BestPartdR) {
149  theBestPartdR = thePart;
150  BestPartdR = dR;
151  };
152  }
153  }
154 
155  if (theEgamma != nullptr) {
156  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(), theEgamma);
157  if (info) info->deltaRMatch = LeadingPhtdR;
158  } else if (theLeadingPartInCone != nullptr) {
159  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theLeadingPartInCone);
160  if (info) info->deltaRMatch = LeadingPartdR;
161  } else if (theBestPartOutCone != nullptr) {
162  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theBestPartOutCone);
163  if (info) info->deltaRMatch = BestPartdR;
164  } else if (isFwrdEle && theBestPartdR != nullptr) {
165  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theBestPartdR );
166  if (info) info->deltaRMatch = BestPartdR;
167  } else {
168  theMatchPart = nullptr;
169  }
170  if (isFwrdEle || theMatchPart != nullptr || !m_inclG4part) return theMatchPart;
171 
172  // additional loop over G4 particles,
173  for (const auto* const thePart : tps) {
174  if (!MC::isStable(thePart)) continue;
175  if (!HepMC::is_simulation_particle(thePart)) continue;
176  long iParticlePDG = thePart->pdgId();
177  // exclude neutrino
178  if (std::abs(iParticlePDG) == 12 || std::abs(iParticlePDG) == 14 || std::abs(iParticlePDG) == 16) continue;
179  if (thePart->decayVtx() != nullptr) continue;
180  if (std::hypot( detPhi(phiClus, thePart->phi())/m_partExtrConePhi, detEta(etaClus, thePart->eta())/m_partExtrConeEta ) > 1.0) continue;
181 
182  double pt = thePart->pt() / Athena::Units::GeV;
183  double q = thePart->charge();
184  // exclude charged particles with pT<1 GeV
185  if (q != 0 && pt < m_pTChargePartCut) continue;
186  if (q == 0 && pt < m_pTNeutralPartCut) continue;
187 
188  double dR(-999.);
189  bool isNCone = false;
190  bool isExt = genPartToCalo(ctx, clus, thePart, isFwrdEle, dR, isNCone, *caloDDMgr);
191  if (!isExt) continue;
192 
193  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),thePart);
194  if (info) {
195  info->egPartPtr.push_back(thePart);
196  info->egPartdR.push_back(dR);
197  info->egPartClas.push_back(particleTruthClassifier(theMatchPart, info));
198  }
199  // the leading photon or electron inside narrow eleptical cone
200  // m_phtClasConePhi X m_phtClasConeEta
201  if ((iParticlePDG == 22 || std::abs(iParticlePDG) == 11) && isNCone && pt > LeadingPhtPT) {
202  theEgamma = thePart;
203  LeadingPhtPT = pt;
204  LeadingPhtdR = dR;
205  }
206  // leading particle (excluding photon or electron) inside narrow eleptic
207  // cone m_phtClasConePhi X m_phtClasConeEta
208  if ((iParticlePDG != 22 && std::abs(iParticlePDG) != 11) && isNCone && pt > LeadingPartPT) {
209  theLeadingPartInCone = thePart;
210  LeadingPartPT = pt;
211  LeadingPartdR = dR;
212  }
213  // the best dR matched particle outside narrow eleptic cone cone
214  // m_phtClasConePhi X m_phtClasConeEta
215  if (!isNCone && dR < BestPartdR) {
216  theBestPartOutCone = thePart;
217  BestPartdR = dR;
218  }
219  }
220 
221  if (theEgamma != nullptr) {
222  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theEgamma);
223  if (info) info->deltaRMatch = LeadingPhtdR;
224  } else if (theLeadingPartInCone != nullptr) {
225  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theLeadingPartInCone);
226  if (info) info->deltaRMatch = LeadingPartdR;
227  } else if (theBestPartOutCone != nullptr) {
228  theMatchPart = MC::find_matching(truthParticleContainerReadHandle.ptr(),theBestPartOutCone);
229  if (info) info->deltaRMatch = BestPartdR;
230  } else {
231  theMatchPart = nullptr;
232  }
233  ATH_MSG_DEBUG("succeeded egammaClusMatch ");
234  return theMatchPart;
235 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

virtual StatusCode MCTruthClassifier::finalize ( )
inlineoverridevirtualinherited

Definition at line 128 of file MCTruthClassifier.h.

◆ findJetConstituents()

void MCTruthClassifier::findJetConstituents ( const xAOD::Jet jet,
std::set< const xAOD::TruthParticle * > &  constituents,
bool  DR 
) const
privateinherited

Definition at line 273 of file MCRecoToTruth.cxx.

276 {
277  if (DR) {
278  // use a DR matching scheme (default)
279  // retrieve collection and get a pointer
281 
282  if (!truthParticleContainerReadHandle.isValid()) {
283  ATH_MSG_WARNING(" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
284  return;
285  }
286  ATH_MSG_DEBUG("xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() << " has valid ReadHandle ");
287  // find the matching truth particles
288  for (const auto *const thePart : *truthParticleContainerReadHandle) {
289  // match truth particles to the jet
290  if (MC::isStable(thePart) && thePart->p4().DeltaR(jet->p4()) < m_jetPartDRMatch) {
291  constituents.insert(thePart);
292  }
293  }
294  }
295  else {
296  xAOD::JetConstituentVector vec = jet->getConstituents();
297  for (const auto *particle0 : vec) {
298  const xAOD::TruthParticle* thePart = dynamic_cast<const xAOD::TruthParticle*>(particle0->rawConstituent());
299  if (MC::isStable(thePart)) {
300  constituents.insert(thePart);
301  }
302  }
303  }
304 }

◆ fracParticleInJet()

double MCTruthClassifier::fracParticleInJet ( const xAOD::TruthParticle thePart,
const xAOD::Jet jet,
bool  DR,
bool  nparts 
) const
privateinherited

Definition at line 305 of file MCRecoToTruth.cxx.

306 {
307  std::set<const xAOD::TruthParticle*> constituents;
308  std::set<const xAOD::TruthParticle*> daughters;
309  std::set<const xAOD::TruthParticle*> intersect;
310 
311  findJetConstituents(jet, constituents, DR);
312  MC::findParticleDaughters(thePart, daughters);
313  if (daughters.empty()) daughters.insert(thePart);
314  // Get the intersection of constituents and daughters
315  std::set_intersection(constituents.begin(),
316  constituents.end(),
317  daughters.begin(),
318  daughters.end(),
319  std::inserter(intersect, intersect.begin()));
320 
321  if (nparts) return 1.0*intersect.size() / daughters.size();
322  double frac = 0;
323  double tot = 0;
324  for (const auto *daughter : daughters) { tot += daughter->pt();}
325  for (const auto *particle : intersect) { frac += particle->pt();}
326  return frac/tot;
327 }

◆ genPartToCalo()

bool MCTruthClassifier::genPartToCalo ( const EventContext &  ctx,
const xAOD::CaloCluster clus,
const xAOD::TruthParticle thePart,
bool  isFwrdEle,
double &  dRmatch,
bool &  isNarrowCone,
const CaloDetDescrManager caloDDMgr 
) const
privateinherited

Definition at line 237 of file MCTruthClassifierAthena.cxx.

244 {
245  dRmatch = -999.;
246  isNarrowCone = false;
247  if (thePart == nullptr) return false;
248  double phiClus = clus->phiBE(2);
249  double etaClus = clus->etaBE(2);
250  if (etaClus < -900) {
251  etaClus = clus->eta();
252  }
253  if (phiClus < -900) {
254  phiClus = clus->phi();
255  }
256  //--FixMe
257  if (isFwrdEle || (etaClus == 0. && phiClus == 0.)) {
258  phiClus = clus->phi();
259  etaClus = clus->eta();
260  }
261  // define calo sample
263  if ((clus->inBarrel() && !clus->inEndcap()) ||
264  (clus->inBarrel() && clus->inEndcap() && clus->eSample(CaloSampling::EMB2) >= clus->eSample(CaloSampling::EME2))) {
265  // Barrel
267  } else if ((!clus->inBarrel() && clus->inEndcap() && !isFwrdEle) ||
268  (clus->inBarrel() && clus->inEndcap() && clus->eSample(CaloSampling::EME2) > clus->eSample(CaloSampling::EMB2))) {
269  // End-cap
271  } else if (isFwrdEle && clus->inEndcap()) {
272  // FCAL
274  } else {
275  return false;
276  }
277  std::unique_ptr<Trk::CurvilinearParameters> params = extractParamFromTruth(*thePart);
278  if (!params) return false;
279  // create extension to sample
280  std::vector<CaloSampling::CaloSample> samples = { sample };
281  auto extension = m_caloExtensionTool->layersCaloExtension(ctx, *params, samples, etaClus, caloDDMgr);
282  bool extensionOK = (!extension.empty());
283  if (!extensionOK) {
284  ATH_MSG_WARNING("extrapolation of Truth Particle with eta " << thePart->eta() << " , charge " << thePart->charge() << " , Pt " << thePart->pt() << " to calo failed");
285  return false;
286  }
287  double etaCalo = extension[0].second->position().eta();
288  double phiCalo = extension[0].second->position().phi();
289 
290  double dPhi = detPhi(phiCalo, phiClus);
291  double dEta = detEta(etaCalo, etaClus);
292  dRmatch = std::hypot(dPhi, dEta);
293 
294  if ((!isFwrdEle && dRmatch > m_phtdRtoTrCut) || (isFwrdEle && dRmatch > m_fwrdEledRtoTrCut)) return false;
295  if (!isFwrdEle && std::hypot( dPhi/m_phtClasConePhi, dEta/m_phtClasConeEta ) <= 1.0) isNarrowCone = true;
296  return true;
297 }

◆ get_tptruth_name()

bool D3PD::D3PDMCTruthClassifier::get_tptruth_name ( const std::string &  tp_name,
std::string &  tptruth_name 
)
private

Try to find a TrackParticleTruthCollection pointing at TP_NAME.

Parameters
tp_nameThe name of a TrackParticleContainer.
tptruth_name[out]The name of a TrackParticleTruthCollection pointing at it.
Returns
True if we found a good truth collection.

Definition at line 174 of file D3PDMCTruthClassifier.cxx.

176 {
177  // Check all TrackParticleTruthCollections to try to find one
178  // pointing at the desired TrackParticle container.
179  std::vector<std::string> keys;
181 
182  for (size_t i = 0; i < keys.size(); i++) {
183  const TrackParticleTruthCollection* tptc = 0;
184  if (m_sg->retrieve (tptc, keys[i]).isFailure() || !tptc)
185  {
186  ATH_MSG_WARNING( "Can't retrieve TrackParticleTruthCollection/"
187  << keys[i] );
188  continue;
189  }
190  tptruth_name = keys[i];
191 
192  std::string target_tp_name;
193  if (tptc->trackParticleContainerLink().isDefault()) {
194  // Older files didn't have this link. Hardcode this case.
195  target_tp_name = "TrackParticleCandidate";
196  }
197  else if (!tptc->trackParticleContainerLink().isValid())
198  continue;
199  else
200  target_tp_name = tptc->trackParticleContainerLink().dataID();
201 
202  if (tp_name == target_tp_name)
203  return true;
204  }
205  return false;
206 }

◆ getGenPart()

const xAOD::TruthParticle * MCTruthClassifier::getGenPart ( const xAOD::TrackParticle trk,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 181 of file MCRecoToTruth.cxx.

182 {
183  // return GenParticle corresponding to given TrackParticle
184  ATH_MSG_DEBUG("Executing getGenPart ");
185  if (!trk) return nullptr;
186  if (info) {
187  info->deltaRMatch = -999.;
188  info->deltaPhi = -999.;
189  info->probTrkToTruth = 0;
190  info->numOfSiHits = 0;
191  }
192 
193  uint8_t NumOfPixHits = 0;
194  uint8_t NumOfSCTHits = 0;
196 
197  static const SG::AuxElement::Accessor<TruthLink_t> tPL("truthParticleLink");
198  if (!tPL.isAvailable(*trk)) {
199  ATH_MSG_DEBUG("Track particle is not associated to truth particle");
200  return nullptr;
201  }
202 
203  const auto& truthLink = tPL(*trk);
204  if (!truthLink.isValid()) {
205  ATH_MSG_DEBUG("Invalid link to truth particle");
206  return nullptr;
207  }
208 
209  const xAOD::TruthParticle* theGenParticle = (*truthLink);
210  if (!theGenParticle) {
211  ATH_MSG_DEBUG("Could not find truth matching for track");
212  return nullptr;
213  }
214 
215  if (info) {
216  static const SG::AuxElement::Accessor<float> tMP("truthMatchProbability");
217  if (tMP.isAvailable(*trk)) {
218  info->probTrkToTruth = tMP(*trk);
219  } else {
220  ATH_MSG_DEBUG("Truth match probability not available");
221  }
222  }
223 
224  if (MC::isDecayed(theGenParticle) || theGenParticle->status() == 3) {
225  ATH_MSG_WARNING("track matched to the truth with status " << theGenParticle->status());
226  }
227 
228  if (MC::isDecayed(theGenParticle) && (std::abs(theGenParticle->pdgId()) == 11 || std::abs(theGenParticle->pdgId()) == 13)) {
229  const xAOD::TruthVertex* EndVrtx = theGenParticle->decayVtx();
230  const xAOD::TruthParticle* theGenPartTmp(nullptr);
231 
232  if (EndVrtx != nullptr) {
233  int itr = 0;
234  do {
235  theGenPartTmp = nullptr;
236  for (const auto & theDaugt: EndVrtx->particles_out()) {
237  if (!theDaugt) continue;
238  if (theDaugt->pdgId() == theGenParticle->pdgId()) theGenPartTmp = theDaugt;
239  if (theDaugt->pdgId() != theGenParticle->pdgId() && theDaugt->pdgId() != 22) theGenPartTmp = nullptr;
240  }
241  itr++;
242  if (itr > 100) {
243  ATH_MSG_WARNING("getGenPart infinite while");
244  break;
245  }
246  EndVrtx = theGenPartTmp ? theGenPartTmp->decayVtx() : nullptr;
247  } while (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->pdgId() && MC::isDecayed(theGenPartTmp) && EndVrtx != nullptr);
248 
249  if (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->pdgId()) theGenParticle = theGenPartTmp;
250  }
251  }
252 
253  if (!trk->summaryValue(NumOfSCTHits, xAOD::numberOfSCTHits)) ATH_MSG_DEBUG("Could not retrieve number of SCT hits");
254  if (!trk->summaryValue(NumOfPixHits, xAOD::numberOfPixelHits)) ATH_MSG_DEBUG("Could not retrieve number of Pixel hits");
255 
256  uint8_t NumOfSiHits = NumOfSCTHits + NumOfPixHits;
257 
258  float deltaPhi = detPhi(theGenParticle->phi(), trk->phi());
259  float deteta = detEta(theGenParticle->eta(), trk->eta());
260  float deltaRMatch = std::hypot(deltaPhi, deteta);
261  if ((NumOfSiHits > m_NumOfSiHitsCut && deltaRMatch > m_deltaRMatchCut) ||
262  (NumOfSiHits <= m_NumOfSiHitsCut && deltaPhi > m_deltaPhiMatchCut)) theGenParticle = nullptr;
263 
264  if (info) {
265  info->deltaRMatch = deltaRMatch;
266  info->deltaPhi = deltaPhi;
267  info->numOfSiHits = NumOfSiHits;
268  }
269  ATH_MSG_DEBUG("getGenPart succeeded ");
270  return (theGenParticle);
271 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ getProperty1()

void D3PD::D3PDMCTruthClassifier::getProperty1 ( const std::string &  pname,
std::string &  value 
)
private

Helper to retrieve the value of a Gaudi property.

Parameters
pnameThe name of the property. param value[out] The value of the property.

Definition at line 214 of file D3PDMCTruthClassifier.cxx.

216 {
217  StatusCode sc = getProperty (pname, value);
218  if (sc.isFailure())
219  REPORT_ERROR (sc) << "Can't get property " << pname << "\n";
220 }

◆ initialize()

StatusCode D3PD::D3PDMCTruthClassifier::initialize ( )
virtual

Standard Gaudi initialize method.

Reimplemented from MCTruthClassifier.

Definition at line 51 of file D3PDMCTruthClassifier.cxx.

52 {
54  CHECK( m_sg.retrieve() );
55  return StatusCode::SUCCESS;
56 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ particleTruthClassifier() [1/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 144 of file MCTruthClassifierGen.cxx.

26  {
27  // Retrieve the links between HepMC and xAOD::TruthParticle
28  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
30  if (!truthParticleLinkVecReadHandle.isValid()) {
31  ATH_MSG_WARNING(" Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
32  return std::make_pair(Unknown, NonDefined);
33  }
34  ElementLink<xAOD::TruthParticleContainer> tplink = truthParticleLinkVecReadHandle->find (theLink);
35  if (tplink.isValid()) {
36  return particleTruthClassifier (*tplink, info);
37  }
38  return std::make_pair(Unknown, NonDefined);
39 }

◆ particleTruthClassifier() [2/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const HepMcParticleLink theLink,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 26 of file MCTruthClassifierGen.cxx.

26  {
27  // Retrieve the links between HepMC and xAOD::TruthParticle
28  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
30  if (!truthParticleLinkVecReadHandle.isValid()) {
31  ATH_MSG_WARNING(" Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
32  return std::make_pair(Unknown, NonDefined);
33  }
34  ElementLink<xAOD::TruthParticleContainer> tplink = truthParticleLinkVecReadHandle->find (theLink);
35  if (tplink.isValid()) {
36  return particleTruthClassifier (*tplink, info);
37  }
38  return std::make_pair(Unknown, NonDefined);
39 }

◆ particleTruthClassifier() [3/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 165 of file MCRecoToTruth.cxx.

115 {
116  ATH_MSG_DEBUG("Executing egamma photon Classifier with cluster Input");
117  ParticleType parttype = Unknown;
118  ParticleOrigin partorig = NonDefined;
119  if (!clus) return std::make_pair(parttype, partorig);
120  if (std::fabs(clus->eta()) > 10.0 || std::fabs(clus->phi()) > M_PI || (clus->et()) <= 0.) return std::make_pair(parttype, partorig);
121  const xAOD::TruthParticle* genPart = nullptr;
122 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
123  genPart = egammaClusMatch(clus, false, info);
124 #else
125  ATH_MSG_WARNING("Cluster Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
126 #endif
127  if (!genPart) return std::make_pair(parttype, partorig);
128  ATH_MSG_DEBUG("Calo Cluster Classifier succeeded ");
129  if (info) info->genPart = genPart;
130  return particleTruthClassifier(genPart, info);
131 }

◆ particleTruthClassifier() [4/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::CaloCluster clus,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 114 of file MCRecoToTruth.cxx.

115 {
116  ATH_MSG_DEBUG("Executing egamma photon Classifier with cluster Input");
117  ParticleType parttype = Unknown;
118  ParticleOrigin partorig = NonDefined;
119  if (!clus) return std::make_pair(parttype, partorig);
120  if (std::fabs(clus->eta()) > 10.0 || std::fabs(clus->phi()) > M_PI || (clus->et()) <= 0.) return std::make_pair(parttype, partorig);
121  const xAOD::TruthParticle* genPart = nullptr;
122 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
123  genPart = egammaClusMatch(clus, false, info);
124 #else
125  ATH_MSG_WARNING("Cluster Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
126 #endif
127  if (!genPart) return std::make_pair(parttype, partorig);
128  ATH_MSG_DEBUG("Calo Cluster Classifier succeeded ");
129  if (info) info->genPart = genPart;
130  return particleTruthClassifier(genPart, info);
131 }

◆ particleTruthClassifier() [5/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 156 of file MCRecoToTruth.cxx.

25 {
26  ATH_MSG_DEBUG("Executing egamma electron Classifier");
27  ParticleType parttype = Unknown;
28  ParticleOrigin partorig = NonDefined;
29  const xAOD::TruthParticle* genPart = nullptr;
30  const xAOD::TrackParticle* trkPtr = elec->trackParticle();
31  if (elec->author() != xAOD::EgammaParameters::AuthorFwdElectron ||trkPtr) {
32  // Central electron or forward electron with track (when reco
33  // implemented in the future)
34  if (!trkPtr){
35  return std::make_pair(parttype, partorig);
36  }
37  genPart = getGenPart(trkPtr);
38  } else {
39 #ifndef XAOD_ANALYSIS // cluster matching available only in Athena
40  const xAOD::CaloCluster* clus = elec->caloCluster();
41  genPart = egammaClusMatch(clus, true, info);
42 #else
43  ATH_MSG_WARNING("Forward Electron classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
44 #endif
45  }
46 
47  if (info) info->genPart = genPart;
48  if (!genPart) return std::make_pair(parttype, partorig);
49  ATH_MSG_DEBUG("egamma electron Classifier succeeded ");
50  return particleTruthClassifier(genPart, info);
51 }

◆ particleTruthClassifier() [6/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::Electron elec,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 24 of file MCRecoToTruth.cxx.

25 {
26  ATH_MSG_DEBUG("Executing egamma electron Classifier");
27  ParticleType parttype = Unknown;
28  ParticleOrigin partorig = NonDefined;
29  const xAOD::TruthParticle* genPart = nullptr;
30  const xAOD::TrackParticle* trkPtr = elec->trackParticle();
31  if (elec->author() != xAOD::EgammaParameters::AuthorFwdElectron ||trkPtr) {
32  // Central electron or forward electron with track (when reco
33  // implemented in the future)
34  if (!trkPtr){
35  return std::make_pair(parttype, partorig);
36  }
37  genPart = getGenPart(trkPtr);
38  } else {
39 #ifndef XAOD_ANALYSIS // cluster matching available only in Athena
40  const xAOD::CaloCluster* clus = elec->caloCluster();
41  genPart = egammaClusMatch(clus, true, info);
42 #else
43  ATH_MSG_WARNING("Forward Electron classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
44 #endif
45  }
46 
47  if (info) info->genPart = genPart;
48  if (!genPart) return std::make_pair(parttype, partorig);
49  ATH_MSG_DEBUG("egamma electron Classifier succeeded ");
50  return particleTruthClassifier(genPart, info);
51 }

◆ particleTruthClassifier() [7/21]

std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > D3PD::D3PDMCTruthClassifier::particleTruthClassifier ( const xAOD::Electron el)
virtual

Run the classifier for an electron.

Parameters
elThe input electron.

Definition at line 65 of file D3PDMCTruthClassifier.cxx.

66 {
67  // Try to find the name of the truth map container,
68  // given the name of the TrackParticleContainer.
69  bool got_names = false;
70  std::string tp_truth_name, tp_name;
71  if (el->trackParticleLink().isValid()) {
72  tp_name = el->trackParticleLink().dataID();
73  got_names = get_tptruth_name (tp_name, tp_truth_name);
74  }
75 
76  // If we found the truth map container, diddle the properties
77  // for the base tool (remembering the original values).
78  std::string old_tp_truth_name, old_tp_name;
79  if (got_names) {
80  getProperty1 ("TrackParticleTruthCollection", old_tp_truth_name);
81  getProperty1 ("TrackParticleContainerName", old_tp_name);
82  setProperty1 ("TrackParticleTruthCollection", tp_truth_name);
83  setProperty1 ("TrackParticleContainerName", tp_name);
84  }
85 
86  // Call the base tool.
90 
91  // Restore original properties, if we changed them.
92  if (got_names) {
93  setProperty1 ("TrackParticleTruthCollection", old_tp_truth_name);
94  setProperty1 ("TrackParticleContainerName", old_tp_name);
95  }
96 
97  return ret;
98 }

◆ particleTruthClassifier() [8/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 168 of file MCRecoToTruth.cxx.

135 {
136  ATH_MSG_DEBUG("Executing Classifier with jet Input");
137  ParticleType parttype = UnknownJet;
138  ParticleOrigin partorig = NonDefined;
139  ParticleType tempparttype = UnknownJet;
140  std::set<const xAOD::TruthParticle*> allJetMothers;
141  std::set<const xAOD::TruthParticle*> constituents;
142  if (!jet) return std::make_pair(parttype, partorig);
143  allJetMothers.clear();
144  constituents.clear();
145  findJetConstituents(jet, constituents, DR);
146  // AV: Jet type is the type of hadron with "heaviest" flavour among the jet constituents.
147  // AV: No hadrons in the jet -- the flavour is unknown.
148  // AV: The algorithm will fail on 4/5 quark hadrons and probably on nonBSM hadrons. To be fixed.
149  for (const auto& thePart: constituents) {
150  MC::findAllJetMothers(thePart, allJetMothers);
151  //AV: probably skip ME particles
152  if (thePart->status() == 3) continue;
153  // determine if hadron and its type
154  tempparttype = particleTruthClassifier(thePart, info).first;
155  if (tempparttype != Hadron) continue;
156  tempparttype = defTypeOfHadron(thePart->pdgId());
157  // classify the jet
158  if (tempparttype == BBbarMesonPart || tempparttype == BottomMesonPart || tempparttype == BottomBaryonPart) {
159  parttype = BJet;
160  continue;
161  }
162  if (tempparttype == CCbarMesonPart || tempparttype == CharmedMesonPart || tempparttype == CharmedBaryonPart) {
163  if (parttype != BJet) parttype = CJet;
164  continue;
165  }
166  if (tempparttype == StrangeBaryonPart || tempparttype == LightBaryonPart || tempparttype == StrangeMesonPart || tempparttype == LightMesonPart) {
167  if (parttype != BJet && parttype != CJet) parttype = LJet;
168  continue;
169  }
170  }
171 
172  // clasify the jet origin
173  partorig = defJetOrig(allJetMothers);
174  allJetMothers.clear();
175  constituents.clear();
176  ATH_MSG_DEBUG(" jet Classifier succeeded");
177  return std::make_pair(parttype, partorig);
178 }

◆ particleTruthClassifier() [9/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::Jet jet,
bool  DR,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 134 of file MCRecoToTruth.cxx.

135 {
136  ATH_MSG_DEBUG("Executing Classifier with jet Input");
137  ParticleType parttype = UnknownJet;
138  ParticleOrigin partorig = NonDefined;
139  ParticleType tempparttype = UnknownJet;
140  std::set<const xAOD::TruthParticle*> allJetMothers;
141  std::set<const xAOD::TruthParticle*> constituents;
142  if (!jet) return std::make_pair(parttype, partorig);
143  allJetMothers.clear();
144  constituents.clear();
145  findJetConstituents(jet, constituents, DR);
146  // AV: Jet type is the type of hadron with "heaviest" flavour among the jet constituents.
147  // AV: No hadrons in the jet -- the flavour is unknown.
148  // AV: The algorithm will fail on 4/5 quark hadrons and probably on nonBSM hadrons. To be fixed.
149  for (const auto& thePart: constituents) {
150  MC::findAllJetMothers(thePart, allJetMothers);
151  //AV: probably skip ME particles
152  if (thePart->status() == 3) continue;
153  // determine if hadron and its type
154  tempparttype = particleTruthClassifier(thePart, info).first;
155  if (tempparttype != Hadron) continue;
156  tempparttype = defTypeOfHadron(thePart->pdgId());
157  // classify the jet
158  if (tempparttype == BBbarMesonPart || tempparttype == BottomMesonPart || tempparttype == BottomBaryonPart) {
159  parttype = BJet;
160  continue;
161  }
162  if (tempparttype == CCbarMesonPart || tempparttype == CharmedMesonPart || tempparttype == CharmedBaryonPart) {
163  if (parttype != BJet) parttype = CJet;
164  continue;
165  }
166  if (tempparttype == StrangeBaryonPart || tempparttype == LightBaryonPart || tempparttype == StrangeMesonPart || tempparttype == LightMesonPart) {
167  if (parttype != BJet && parttype != CJet) parttype = LJet;
168  continue;
169  }
170  }
171 
172  // clasify the jet origin
173  partorig = defJetOrig(allJetMothers);
174  allJetMothers.clear();
175  constituents.clear();
176  ATH_MSG_DEBUG(" jet Classifier succeeded");
177  return std::make_pair(parttype, partorig);
178 }

◆ particleTruthClassifier() [10/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 162 of file MCRecoToTruth.cxx.

94 {
95  ATH_MSG_DEBUG("Executing muon Classifier");
96  ParticleType parttype = Unknown;
97  ParticleOrigin partorig = NonDefined;
98  const xAOD::TrackParticle* trkPtr = nullptr;
99  if (mu->primaryTrackParticleLink().isValid()) trkPtr = *mu->primaryTrackParticleLink();
100  else if (mu->combinedTrackParticleLink().isValid()) trkPtr = *mu->combinedTrackParticleLink();
101  else if (mu->inDetTrackParticleLink().isValid()) trkPtr = *mu->combinedTrackParticleLink();
102  else if (mu->muonSpectrometerTrackParticleLink().isValid()) trkPtr = *mu->muonSpectrometerTrackParticleLink();
103 
104  if (!trkPtr) return std::make_pair(parttype, partorig);
105 
106  const xAOD::TruthParticle* genPart = getGenPart(trkPtr);
107  if (!genPart) return std::make_pair(parttype, partorig);
108  if (info) info->genPart = genPart;
109  ATH_MSG_DEBUG("muon Classifier succeeded ");
110  return particleTruthClassifier(genPart, info);
111 }

◆ particleTruthClassifier() [11/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::Muon mu,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 93 of file MCRecoToTruth.cxx.

94 {
95  ATH_MSG_DEBUG("Executing muon Classifier");
96  ParticleType parttype = Unknown;
97  ParticleOrigin partorig = NonDefined;
98  const xAOD::TrackParticle* trkPtr = nullptr;
99  if (mu->primaryTrackParticleLink().isValid()) trkPtr = *mu->primaryTrackParticleLink();
100  else if (mu->combinedTrackParticleLink().isValid()) trkPtr = *mu->combinedTrackParticleLink();
101  else if (mu->inDetTrackParticleLink().isValid()) trkPtr = *mu->combinedTrackParticleLink();
102  else if (mu->muonSpectrometerTrackParticleLink().isValid()) trkPtr = *mu->muonSpectrometerTrackParticleLink();
103 
104  if (!trkPtr) return std::make_pair(parttype, partorig);
105 
106  const xAOD::TruthParticle* genPart = getGenPart(trkPtr);
107  if (!genPart) return std::make_pair(parttype, partorig);
108  if (info) info->genPart = genPart;
109  ATH_MSG_DEBUG("muon Classifier succeeded ");
110  return particleTruthClassifier(genPart, info);
111 }

◆ particleTruthClassifier() [12/21]

std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > D3PD::D3PDMCTruthClassifier::particleTruthClassifier ( const xAOD::Muon mu)
virtual

Run the classifier for a muon.

This function is here to avoid a problem on the mc12 validation samples.

Parameters
elThe input photon.

Definition at line 155 of file D3PDMCTruthClassifier.cxx.

156 {
157  // Avoid using forward muons that have a tracklet associated to them:
158  if( mu->muonType() == xAOD::Muon::SiliconAssociatedForwardMuon ) {
159  return std::make_pair( MCTruthPartClassifier::Unknown, MCTruthPartClassifier::NonDefined );
160  }
161 
162  // For all other muons just use the base class's function:
164 }

◆ particleTruthClassifier() [13/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 159 of file MCRecoToTruth.cxx.

55 {
56  ATH_MSG_DEBUG("Executing egamma photon Classifier");
57  ParticleType parttype = Unknown;
58  ParticleOrigin partorig = NonDefined;
59  const xAOD::CaloCluster* clus = phot->caloCluster();
60  if (!clus) return std::make_pair(parttype, partorig);
61  if (std::fabs(clus->eta()) > 10.0 || std::fabs(clus->phi()) > 6.28 || (clus->et()) <= 0.) return std::make_pair(parttype, partorig);
62 
63  const xAOD::Vertex* VxCvPtr = phot->vertex();
64  if (VxCvPtr != nullptr) {
65  for (int itrk = 0; itrk < (int)VxCvPtr->nTrackParticles(); itrk++) {
66  if (itrk > 1) continue;
67  const xAOD::TrackParticle* trkPtr = VxCvPtr->trackParticle(itrk);
68  if (!trkPtr) continue;
69  const xAOD::TruthParticle* thePart = getGenPart(trkPtr);
70  std::pair<ParticleType, ParticleOrigin> classif = particleTruthClassifier(thePart, info);
71  if (info) {
72  info->cnvPhotTrkPtr.push_back(trkPtr);
73  info->cnvPhotTrkToTruthPart.push_back(thePart);
74  info->cnvPhotPartType.push_back(classif.first);
75  info->cnvPhotPartOrig.push_back(classif.second);
76  }
77  }
78  }
79 
80  const xAOD::TruthParticle* genPart = nullptr;
81 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
82  genPart = egammaClusMatch(clus, false, info);
83 #else
84  ATH_MSG_WARNING("Photon Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
85 #endif
86  if (!genPart) return std::make_pair(parttype, partorig);
87  if (info) info->genPart = genPart;
88  ATH_MSG_DEBUG("egamma photon Classifier succeeded ");
89  return particleTruthClassifier(genPart, info);
90 }

◆ particleTruthClassifier() [14/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::Photon phot,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 54 of file MCRecoToTruth.cxx.

55 {
56  ATH_MSG_DEBUG("Executing egamma photon Classifier");
57  ParticleType parttype = Unknown;
58  ParticleOrigin partorig = NonDefined;
59  const xAOD::CaloCluster* clus = phot->caloCluster();
60  if (!clus) return std::make_pair(parttype, partorig);
61  if (std::fabs(clus->eta()) > 10.0 || std::fabs(clus->phi()) > 6.28 || (clus->et()) <= 0.) return std::make_pair(parttype, partorig);
62 
63  const xAOD::Vertex* VxCvPtr = phot->vertex();
64  if (VxCvPtr != nullptr) {
65  for (int itrk = 0; itrk < (int)VxCvPtr->nTrackParticles(); itrk++) {
66  if (itrk > 1) continue;
67  const xAOD::TrackParticle* trkPtr = VxCvPtr->trackParticle(itrk);
68  if (!trkPtr) continue;
69  const xAOD::TruthParticle* thePart = getGenPart(trkPtr);
70  std::pair<ParticleType, ParticleOrigin> classif = particleTruthClassifier(thePart, info);
71  if (info) {
72  info->cnvPhotTrkPtr.push_back(trkPtr);
73  info->cnvPhotTrkToTruthPart.push_back(thePart);
74  info->cnvPhotPartType.push_back(classif.first);
75  info->cnvPhotPartOrig.push_back(classif.second);
76  }
77  }
78  }
79 
80  const xAOD::TruthParticle* genPart = nullptr;
81 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
82  genPart = egammaClusMatch(clus, false, info);
83 #else
84  ATH_MSG_WARNING("Photon Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
85 #endif
86  if (!genPart) return std::make_pair(parttype, partorig);
87  if (info) info->genPart = genPart;
88  ATH_MSG_DEBUG("egamma photon Classifier succeeded ");
89  return particleTruthClassifier(genPart, info);
90 }

◆ particleTruthClassifier() [15/21]

std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > D3PD::D3PDMCTruthClassifier::particleTruthClassifier ( const xAOD::Photon ph)
virtual

Run the classifier for a photon.

Parameters
elThe input photon.

Definition at line 107 of file D3PDMCTruthClassifier.cxx.

108 {
109  // Try to find the name of the truth map container,
110  // given the name of the TrackParticleContainer.
111  bool got_names = false;
112  std::string tp_truth_name, tp_name;
113  const xAOD::Vertex* vx = ph->vertex();
114  if (vx) {
116  for (auto trklink : links) {
117  if (trklink.isValid()) {
118  tp_name = trklink.dataID();
119  got_names = get_tptruth_name (tp_name, tp_truth_name);
120  if (got_names) break;
121  }
122  }
123  }
124 
125  // If we found the truth map container, diddle the properties
126  // for the base tool (remembering the original values).
127  std::string old_tp_truth_name, old_tp_name;
128  if (got_names) {
129  getProperty1 ("TrackParticleTruthCollection", old_tp_truth_name);
130  getProperty1 ("TrackParticleContainerName", old_tp_name);
131  setProperty1 ("TrackParticleTruthCollection", tp_truth_name);
132  setProperty1 ("TrackParticleContainerName", tp_name);
133  }
134 
135  // Call the base tool.
139 
140  // Restore original properties, if we changed them.
141  if (got_names) {
142  setProperty1 ("TrackParticleTruthCollection", old_tp_truth_name);
143  setProperty1 ("TrackParticleContainerName", old_tp_name);
144  }
145 
146  return ret;
147 }

◆ particleTruthClassifier() [16/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 153 of file MCRecoToTruth.cxx.

12 {
13  ATH_MSG_DEBUG("Executing trackClassifier");
14  ParticleType parttype = Unknown;
15  ParticleOrigin partorig = NonDefined;
16  const xAOD::TruthParticle* genPart = getGenPart(trkPtr);
17  if (info) info->genPart = genPart;
18  if (!genPart) return std::make_pair(parttype, partorig);
19  ATH_MSG_DEBUG("trackClassifier succeeded ");
20  return particleTruthClassifier(genPart, info);
21 }

◆ particleTruthClassifier() [17/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::TrackParticle trkPtr,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 11 of file MCRecoToTruth.cxx.

12 {
13  ATH_MSG_DEBUG("Executing trackClassifier");
14  ParticleType parttype = Unknown;
15  ParticleOrigin partorig = NonDefined;
16  const xAOD::TruthParticle* genPart = getGenPart(trkPtr);
17  if (info) info->genPart = genPart;
18  if (!genPart) return std::make_pair(parttype, partorig);
19  ATH_MSG_DEBUG("trackClassifier succeeded ");
20  return particleTruthClassifier(genPart, info);
21 }

◆ particleTruthClassifier() [18/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 136 of file MCTruthClassifierGen.cxx.

77  {
79  ATH_MSG_DEBUG("Executing particleTruthClassifier");
80 
81  ParticleType partType = Unknown;
82  ParticleOrigin partOrig = NonDefined;
83  if (!thePart){
84  return std::make_pair(partType, partOrig);
85  }
86 
87  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
89  if (!info) { info = &tmpinfo; }
90  info->genPart = thePart;
91 
92  // retrieve collection and get a pointer
94  if (!truthParticleContainerReadHandle.isValid()) {
95  ATH_MSG_WARNING( " Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
96  return std::make_pair(partType, partOrig);
97  }
98 
99  ATH_MSG_DEBUG("xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() << " has valid ReadHandle ");
100 
101  // status=HepMC::SPECIALSTATUS in Pythia?
102  if (!MC::isStable(thePart) && !MC::isDecayed(thePart) && thePart->status() != HepMC::SPECIALSTATUS) {
103  return std::make_pair(GenParticle, partOrig);
104  }
105  bool isPartHadr = MC::isHadron(thePart)&&!MC::isBeam(thePart);
106  if (MC::isDecayed(thePart) && (!MC::isTau(thePart) && !isPartHadr)) return std::make_pair(GenParticle, partOrig);
107 
108  // SUSY datasets: tau(satus==2)->tau(satus==2)
109  if (MC::isDecayed(thePart) && MC::isTau(thePart)) {
110  const xAOD::TruthVertex* endVert = thePart->decayVtx();
111  if (endVert != nullptr) {
112  int numOfDaught = endVert->nOutgoingParticles();
113  if (numOfDaught == 1 && MC::isTau(endVert->outgoingParticle(0))) {
114  return std::make_pair(GenParticle, partOrig);
115  }
116  }
117  }
118 
119  if (MC::isStable(thePart) && MC::isSUSY(thePart)) return std::make_pair(SUSYParticle, partOrig);
120 
121  if (MC::isStable(thePart) && MC::isBSM(thePart)) return std::make_pair(OtherBSMParticle, partOrig);
122 
123  if (thePart->status() == HepMC::SPECIALSTATUS &&
124  (!MC::isElectron(thePart) && !MC::isMuon(thePart) &&
125  !MC::isTau(thePart) && !MC::isPhoton(thePart)) &&
126  !isPartHadr)
127  return std::make_pair(GenParticle, partOrig);
128 
129  if (abs(thePart->pdg_id()) > 1000000000) return std::make_pair(NuclFrag, partOrig);
130 
131  if ( !MC::isSMLepton(thePart) && !MC::isPhoton(thePart) && !isPartHadr) return std::make_pair(partType, partOrig);
132  // don't consider generator particles
133 
134  const xAOD::TruthVertex* partOriVert = thePart->hasProdVtx() ? thePart->prodVtx() : nullptr;
135 
136  const xAOD::TruthParticle* theMoth{};
137  if (partOriVert != nullptr) {
138  for (const auto& temp: partOriVert->particles_in()) {if (temp) theMoth = temp;}
139  }
140  int motherStatus = theMoth?theMoth->status():0;
141  int motherPDG = theMoth?theMoth->pdg_id():0;
142  info->setMotherProperties(theMoth);
143 
144  if (!partOriVert && HepMC::is_simulation_particle(thePart)) {
145  return std::make_pair(NonPrimary, partOrig);
146  }
147  if (!partOriVert && MC::isElectron(thePart)) {
148  // to define electron out come status
149  bool isPrompt = false;
150  partOrig = defOrigOfElectron(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
151  return std::make_pair(UnknownElectron, partOrig);
152  }
153  if (!partOriVert && MC::isMuon(thePart)) {
154  // to define electron out come status
155  bool isPrompt = false;
156  partOrig = defOrigOfMuon(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
157  return std::make_pair(UnknownMuon, partOrig);
158  }
159  if (!partOriVert && MC::isTau(thePart)) {
160  // to define electron out come status
161  partOrig = defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG, info);
162  return std::make_pair(UnknownTau, partOrig);
163  }
164  if (!partOriVert && MC::isPhoton(thePart)) {
165  // to define photon out come
166  bool isPrompt = false;
167  partOrig = defOrigOfPhoton(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
168  return std::make_pair(UnknownPhoton, partOrig);
169  }
170  if (!partOriVert && MC::isNeutrino(thePart)) {
171  // to define neutrino outcome
172  info->particleOutCome = NonInteract;
173  return std::make_pair(Neutrino, partOrig);
174  }
175 
176  if (thePart&& info && info->Mother() && HepMC::is_same_generator_particle(thePart,info->Mother()))
177  return std::make_pair(NonPrimary, partOrig);
178 
179  if (isPartHadr) return std::make_pair(Hadron, partOrig);
180 
181  if (partOriVert && motherPDG == 0 && partOriVert->nOutgoingParticles() == 1 &&
182  partOriVert->nIncomingParticles() == 0) {
183  if (MC::isElectron(thePart)) {
184  info->particleOutCome = defOutComeOfElectron(thePart);
185  return std::make_pair(IsoElectron, SingleElec);
186  }
187  if (MC::isMuon(thePart)) {
188  info->particleOutCome = defOutComeOfMuon(thePart);
189  return std::make_pair(IsoMuon, SingleMuon);
190  }
191  if (MC::isTau(thePart)) {
192  info->particleOutCome = defOutComeOfTau(thePart);
193  return std::make_pair(IsoTau, SingleTau);
194  }
195  if (MC::isPhoton(thePart)) {
196  info->particleOutCome = defOutComeOfPhoton(thePart);
197  return std::make_pair(IsoPhoton, SinglePhot);
198  }
199  }
200 
201  if (motherPDG == thePart->pdg_id() && motherStatus == 3 && thePart->status() == HepMC::SPECIALSTATUS) return std::make_pair(GenParticle, partOrig);
202 
203  if (MC::isElectron(thePart)) {
204  bool isPrompt = false;
205  partOrig = defOrigOfElectron(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
206  partType = defTypeOfElectron(partOrig, isPrompt);
207  } else if (MC::isMuon(thePart)) {
208  bool isPrompt = false;
209  partOrig = defOrigOfMuon(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
210  partType = defTypeOfMuon(partOrig, isPrompt);
211  } else if (MC::isTau(thePart)) {
212  partOrig = defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG, info);
213  partType = defTypeOfTau(partOrig);
214  } else if (MC::isPhoton(thePart)) {
215  bool isPrompt = false;
216  partOrig = defOrigOfPhoton(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
217  partType = defTypeOfPhoton(partOrig);
218  } else if (MC::isNeutrino(thePart)) {
219  bool isPrompt = false;
220  partOrig = defOrigOfNeutrino(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
221  partType = Neutrino;
222  }
223 
224  ATH_MSG_DEBUG("particleTruthClassifier succeeded ");
225  return std::make_pair(partType, partOrig);
226 }

◆ particleTruthClassifier() [19/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( const xAOD::TruthParticle thePart,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 77 of file MCTruthClassifierGen.cxx.

77  {
79  ATH_MSG_DEBUG("Executing particleTruthClassifier");
80 
81  ParticleType partType = Unknown;
82  ParticleOrigin partOrig = NonDefined;
83  if (!thePart){
84  return std::make_pair(partType, partOrig);
85  }
86 
87  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
89  if (!info) { info = &tmpinfo; }
90  info->genPart = thePart;
91 
92  // retrieve collection and get a pointer
94  if (!truthParticleContainerReadHandle.isValid()) {
95  ATH_MSG_WARNING( " Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
96  return std::make_pair(partType, partOrig);
97  }
98 
99  ATH_MSG_DEBUG("xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() << " has valid ReadHandle ");
100 
101  // status=HepMC::SPECIALSTATUS in Pythia?
102  if (!MC::isStable(thePart) && !MC::isDecayed(thePart) && thePart->status() != HepMC::SPECIALSTATUS) {
103  return std::make_pair(GenParticle, partOrig);
104  }
105  bool isPartHadr = MC::isHadron(thePart)&&!MC::isBeam(thePart);
106  if (MC::isDecayed(thePart) && (!MC::isTau(thePart) && !isPartHadr)) return std::make_pair(GenParticle, partOrig);
107 
108  // SUSY datasets: tau(satus==2)->tau(satus==2)
109  if (MC::isDecayed(thePart) && MC::isTau(thePart)) {
110  const xAOD::TruthVertex* endVert = thePart->decayVtx();
111  if (endVert != nullptr) {
112  int numOfDaught = endVert->nOutgoingParticles();
113  if (numOfDaught == 1 && MC::isTau(endVert->outgoingParticle(0))) {
114  return std::make_pair(GenParticle, partOrig);
115  }
116  }
117  }
118 
119  if (MC::isStable(thePart) && MC::isSUSY(thePart)) return std::make_pair(SUSYParticle, partOrig);
120 
121  if (MC::isStable(thePart) && MC::isBSM(thePart)) return std::make_pair(OtherBSMParticle, partOrig);
122 
123  if (thePart->status() == HepMC::SPECIALSTATUS &&
124  (!MC::isElectron(thePart) && !MC::isMuon(thePart) &&
125  !MC::isTau(thePart) && !MC::isPhoton(thePart)) &&
126  !isPartHadr)
127  return std::make_pair(GenParticle, partOrig);
128 
129  if (abs(thePart->pdg_id()) > 1000000000) return std::make_pair(NuclFrag, partOrig);
130 
131  if ( !MC::isSMLepton(thePart) && !MC::isPhoton(thePart) && !isPartHadr) return std::make_pair(partType, partOrig);
132  // don't consider generator particles
133 
134  const xAOD::TruthVertex* partOriVert = thePart->hasProdVtx() ? thePart->prodVtx() : nullptr;
135 
136  const xAOD::TruthParticle* theMoth{};
137  if (partOriVert != nullptr) {
138  for (const auto& temp: partOriVert->particles_in()) {if (temp) theMoth = temp;}
139  }
140  int motherStatus = theMoth?theMoth->status():0;
141  int motherPDG = theMoth?theMoth->pdg_id():0;
142  info->setMotherProperties(theMoth);
143 
144  if (!partOriVert && HepMC::is_simulation_particle(thePart)) {
145  return std::make_pair(NonPrimary, partOrig);
146  }
147  if (!partOriVert && MC::isElectron(thePart)) {
148  // to define electron out come status
149  bool isPrompt = false;
150  partOrig = defOrigOfElectron(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
151  return std::make_pair(UnknownElectron, partOrig);
152  }
153  if (!partOriVert && MC::isMuon(thePart)) {
154  // to define electron out come status
155  bool isPrompt = false;
156  partOrig = defOrigOfMuon(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
157  return std::make_pair(UnknownMuon, partOrig);
158  }
159  if (!partOriVert && MC::isTau(thePart)) {
160  // to define electron out come status
161  partOrig = defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG, info);
162  return std::make_pair(UnknownTau, partOrig);
163  }
164  if (!partOriVert && MC::isPhoton(thePart)) {
165  // to define photon out come
166  bool isPrompt = false;
167  partOrig = defOrigOfPhoton(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
168  return std::make_pair(UnknownPhoton, partOrig);
169  }
170  if (!partOriVert && MC::isNeutrino(thePart)) {
171  // to define neutrino outcome
172  info->particleOutCome = NonInteract;
173  return std::make_pair(Neutrino, partOrig);
174  }
175 
176  if (thePart&& info && info->Mother() && HepMC::is_same_generator_particle(thePart,info->Mother()))
177  return std::make_pair(NonPrimary, partOrig);
178 
179  if (isPartHadr) return std::make_pair(Hadron, partOrig);
180 
181  if (partOriVert && motherPDG == 0 && partOriVert->nOutgoingParticles() == 1 &&
182  partOriVert->nIncomingParticles() == 0) {
183  if (MC::isElectron(thePart)) {
184  info->particleOutCome = defOutComeOfElectron(thePart);
185  return std::make_pair(IsoElectron, SingleElec);
186  }
187  if (MC::isMuon(thePart)) {
188  info->particleOutCome = defOutComeOfMuon(thePart);
189  return std::make_pair(IsoMuon, SingleMuon);
190  }
191  if (MC::isTau(thePart)) {
192  info->particleOutCome = defOutComeOfTau(thePart);
193  return std::make_pair(IsoTau, SingleTau);
194  }
195  if (MC::isPhoton(thePart)) {
196  info->particleOutCome = defOutComeOfPhoton(thePart);
197  return std::make_pair(IsoPhoton, SinglePhot);
198  }
199  }
200 
201  if (motherPDG == thePart->pdg_id() && motherStatus == 3 && thePart->status() == HepMC::SPECIALSTATUS) return std::make_pair(GenParticle, partOrig);
202 
203  if (MC::isElectron(thePart)) {
204  bool isPrompt = false;
205  partOrig = defOrigOfElectron(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
206  partType = defTypeOfElectron(partOrig, isPrompt);
207  } else if (MC::isMuon(thePart)) {
208  bool isPrompt = false;
209  partOrig = defOrigOfMuon(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
210  partType = defTypeOfMuon(partOrig, isPrompt);
211  } else if (MC::isTau(thePart)) {
212  partOrig = defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG, info);
213  partType = defTypeOfTau(partOrig);
214  } else if (MC::isPhoton(thePart)) {
215  bool isPrompt = false;
216  partOrig = defOrigOfPhoton(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
217  partType = defTypeOfPhoton(partOrig);
218  } else if (MC::isNeutrino(thePart)) {
219  bool isPrompt = false;
220  partOrig = defOrigOfNeutrino(truthParticleContainerReadHandle.ptr(), thePart, isPrompt, info);
221  partType = Neutrino;
222  }
223 
224  ATH_MSG_DEBUG("particleTruthClassifier succeeded ");
225  return std::make_pair(partType, partOrig);
226 }

◆ particleTruthClassifier() [20/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier
override

Definition at line 147 of file MCTruthClassifierGen.cxx.

42  {
43  ParticleType partType = Unknown;
44  ParticleOrigin partOrig = NonDefined;
45 
46  if (!theGenPart) return std::make_pair(partType, partOrig);
47 
48  // Retrieve the links between HepMC and xAOD::TruthParticle
49  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
50 
52  if (!truthParticleLinkVecReadHandle.isValid()) {
53  ATH_MSG_WARNING( " Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
54  return std::make_pair(partType, partOrig);
55  }
56  const int theUID = HepMC::uniqueID(theGenPart);
57  for (const auto *const entry : *truthParticleLinkVecReadHandle) {
58  if (entry->first.isValid() && entry->second.isValid() && HepMC::uniqueID(entry->first) == theUID) {
59  const xAOD::TruthParticle* truthParticle = *entry->second;
60  // if the barcode/pdg id / status of the pair does not match return default
61  if (!theGenPart || !truthParticle ||
62  theGenPart->pdg_id() != truthParticle->pdgId() ||
63  theGenPart->status() != truthParticle->status() ||
64  HepMC::barcode(theGenPart) != HepMC::uniqueID(truthParticle)) { // FIXME barcode-based have to use GenParticle barcode as uniqueID returns barcode when called on xAOD::TruthParticle
66  "HepMC::GenParticle and xAOD::TruthParticle do not match");
67  return std::make_pair(partType, partOrig);
68  }
69  return particleTruthClassifier(truthParticle, info);
70  }
71  }
72  return std::make_pair(partType, partOrig);
73 }

◆ particleTruthClassifier() [21/21]

std::pair< ParticleType, ParticleOrigin > MCTruthClassifier::particleTruthClassifier ( HepMC::ConstGenParticlePtr  theGenPart,
MCTruthPartClassifier::Info info = nullptr 
) const
overridevirtualinherited

Implements IMCTruthClassifier.

Definition at line 42 of file MCTruthClassifierGen.cxx.

42  {
43  ParticleType partType = Unknown;
44  ParticleOrigin partOrig = NonDefined;
45 
46  if (!theGenPart) return std::make_pair(partType, partOrig);
47 
48  // Retrieve the links between HepMC and xAOD::TruthParticle
49  const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
50 
52  if (!truthParticleLinkVecReadHandle.isValid()) {
53  ATH_MSG_WARNING( " Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
54  return std::make_pair(partType, partOrig);
55  }
56  const int theUID = HepMC::uniqueID(theGenPart);
57  for (const auto *const entry : *truthParticleLinkVecReadHandle) {
58  if (entry->first.isValid() && entry->second.isValid() && HepMC::uniqueID(entry->first) == theUID) {
59  const xAOD::TruthParticle* truthParticle = *entry->second;
60  // if the barcode/pdg id / status of the pair does not match return default
61  if (!theGenPart || !truthParticle ||
62  theGenPart->pdg_id() != truthParticle->pdgId() ||
63  theGenPart->status() != truthParticle->status() ||
64  HepMC::barcode(theGenPart) != HepMC::uniqueID(truthParticle)) { // FIXME barcode-based have to use GenParticle barcode as uniqueID returns barcode when called on xAOD::TruthParticle
66  "HepMC::GenParticle and xAOD::TruthParticle do not match");
67  return std::make_pair(partType, partOrig);
68  }
69  return particleTruthClassifier(truthParticle, info);
70  }
71  }
72  return std::make_pair(partType, partOrig);
73 }

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setProperty1()

void D3PD::D3PDMCTruthClassifier::setProperty1 ( const std::string &  pname,
const std::string &  value 
)
private

Helper to set the value of a Gaudi property.

Parameters
pnameThe name of the property. param value The new value of the property.

Definition at line 228 of file D3PDMCTruthClassifier.cxx.

230 {
231  StatusCode sc = setProperty (pname, value);
232  if (sc.isFailure())
233  REPORT_ERROR (sc) << "Can't set property " << pname << "\n";
234 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_caloExtensionTool

ToolHandle<Trk::IParticleCaloExtensionTool> MCTruthClassifier::m_caloExtensionTool {this,"ParticleCaloExtensionTool",""}
privateinherited

Definition at line 231 of file MCTruthClassifier.h.

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> MCTruthClassifier::m_caloMgrKey {this,"CaloDetDescrManager",""}
privateinherited

Definition at line 232 of file MCTruthClassifier.h.

◆ m_deltaPhiMatchCut

float MCTruthClassifier::m_deltaPhiMatchCut
privateinherited

Definition at line 259 of file MCTruthClassifier.h.

◆ m_deltaRMatchCut

float MCTruthClassifier::m_deltaRMatchCut
privateinherited

Definition at line 258 of file MCTruthClassifier.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_FwdElectronTruthExtrEtaCut

float MCTruthClassifier::m_FwdElectronTruthExtrEtaCut
privateinherited

Definition at line 237 of file MCTruthClassifier.h.

◆ m_FwdElectronTruthExtrEtaWindowCut

float MCTruthClassifier::m_FwdElectronTruthExtrEtaWindowCut
privateinherited

Definition at line 238 of file MCTruthClassifier.h.

◆ m_FwdElectronUseG4Sel

bool MCTruthClassifier::m_FwdElectronUseG4Sel
privateinherited

Definition at line 236 of file MCTruthClassifier.h.

◆ m_fwrdEledRtoTrCut

float MCTruthClassifier::m_fwrdEledRtoTrCut
privateinherited

Definition at line 245 of file MCTruthClassifier.h.

◆ m_inclG4part

bool MCTruthClassifier::m_inclG4part
privateinherited

Definition at line 250 of file MCTruthClassifier.h.

◆ m_jetPartDRMatch

float MCTruthClassifier::m_jetPartDRMatch
privateinherited

Definition at line 261 of file MCTruthClassifier.h.

◆ m_NumOfSiHitsCut

int MCTruthClassifier::m_NumOfSiHitsCut
privateinherited

Definition at line 260 of file MCTruthClassifier.h.

◆ m_partExtrConeEta

float MCTruthClassifier::m_partExtrConeEta
privateinherited

Definition at line 239 of file MCTruthClassifier.h.

◆ m_partExtrConePhi

float MCTruthClassifier::m_partExtrConePhi
privateinherited

Definition at line 240 of file MCTruthClassifier.h.

◆ m_phtClasConeEta

float MCTruthClassifier::m_phtClasConeEta
privateinherited

Definition at line 243 of file MCTruthClassifier.h.

◆ m_phtClasConePhi

float MCTruthClassifier::m_phtClasConePhi
privateinherited

Definition at line 242 of file MCTruthClassifier.h.

◆ m_phtdRtoTrCut

float MCTruthClassifier::m_phtdRtoTrCut
privateinherited

Definition at line 244 of file MCTruthClassifier.h.

◆ m_pTChargePartCut

float MCTruthClassifier::m_pTChargePartCut
privateinherited

Definition at line 248 of file MCTruthClassifier.h.

◆ m_pTNeutralPartCut

float MCTruthClassifier::m_pTNeutralPartCut
privateinherited

Definition at line 249 of file MCTruthClassifier.h.

◆ m_ROICone

bool MCTruthClassifier::m_ROICone
privateinherited

Definition at line 246 of file MCTruthClassifier.h.

◆ m_sg

ServiceHandle<StoreGateSvc> D3PD::D3PDMCTruthClassifier::m_sg
private

The StoreGate service.

Definition at line 119 of file D3PDMCTruthClassifier.h.

◆ m_truthInConeTool

ToolHandle<xAOD::ITruthParticlesInConeTool> MCTruthClassifier::m_truthInConeTool {this,"TruthInConeTool","xAOD::TruthParticlesInConeTool/TruthParticlesInConeTool"}
privateinherited

Definition at line 234 of file MCTruthClassifier.h.

◆ m_truthLinkVecReadHandleKey

SG::ReadHandleKey<xAODTruthParticleLinkVector> MCTruthClassifier::m_truthLinkVecReadHandleKey {this,"xAODTruthLinkVector","xAODTruthLinks", "ReadHandleKey for xAODTruthParticleLinkVector"}
privateinherited

Definition at line 255 of file MCTruthClassifier.h.

◆ m_truthParticleContainerKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> MCTruthClassifier::m_truthParticleContainerKey {this,"xAODTruthParticleContainerName","TruthParticles","ReadHandleKey for xAOD::TruthParticleContainer"}
privateinherited

Definition at line 228 of file MCTruthClassifier.h.

◆ m_useCaching

bool MCTruthClassifier::m_useCaching
privateinherited

Definition at line 241 of file MCTruthClassifier.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
MCTruthClassifier::defOrigOfNeutrino
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:1216
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
NuRMu
@ NuRMu
Definition: TruthClasses.h:73
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
temp
Definition: JetEventDict.h:21
IsoPhoton
@ IsoPhoton
Definition: TruthClasses.h:23
MCTruthPartClassifier::defOutComeOfMuon
ParticleOutCome defOutComeOfMuon(T thePart)
Definition: TruthClassifiers.h:213
LightBaryonPart
@ LightBaryonPart
Definition: TruthClasses.h:40
MCTruthPartClassifier::defTypeOfPhoton
ParticleType defTypeOfPhoton(ParticleOrigin PhotOrig)
Definition: TruthClassifiers.h:115
D3PD::D3PDMCTruthClassifier::getProperty1
void getProperty1(const std::string &pname, std::string &value)
Helper to retrieve the value of a Gaudi property.
Definition: D3PDMCTruthClassifier.cxx:214
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
calibdata.pout
def pout(output, newline=True)
Definition: calibdata.py:130
REPORT_ERROR
#define REPORT_ERROR(SC)
Report an error.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:355
TauLep
@ TauLep
Definition: TruthClasses.h:63
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
OtherBSMParticle
@ OtherBSMParticle
Definition: TruthClasses.h:32
MCTruthClassifier::m_FwdElectronTruthExtrEtaWindowCut
float m_FwdElectronTruthExtrEtaWindowCut
Definition: MCTruthClassifier.h:238
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
NuREle
@ NuREle
Definition: TruthClasses.h:72
Mu
@ Mu
Definition: TruthClasses.h:62
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::TruthVertex_v1::particles_in
std::vector< const TruthParticle * > particles_in() const
Get the incoming particles.
Definition: TruthVertex_v1.cxx:61
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
WBosonLRSM
@ WBosonLRSM
Definition: TruthClasses.h:71
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
SingleTau
@ SingleTau
Definition: TruthClasses.h:57
MCTruthClassifier::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MCTruthClassifier.h:101
isBSM
bool isBSM(const T &p)
Definition: AtlasPID.h:213
PionDecay
@ PionDecay
Definition: TruthClasses.h:90
MCTruthClassifier::findJetConstituents
void findJetConstituents(const xAOD::Jet *, std::set< const xAOD::TruthParticle * > &constituents, bool DR) const
Definition: MCRecoToTruth.cxx:273
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MCTruthPartClassifier::defOutComeOfTau
ParticleOutCome defOutComeOfTau(T thePart)
Definition: TruthClassifiers.h:240
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
xAOD::Vertex_v1::trackParticleLinks
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
MCTruthClassifier::m_phtClasConeEta
float m_phtClasConeEta
Definition: MCTruthClassifier.h:243
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
ElMagProc
@ ElMagProc
Definition: TruthClasses.h:61
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
MC::findAllJetMothers
void findAllJetMothers(T thePart, std::set< T > &allJetMothers)
Function to find all ancestors of the particle.
Definition: HepMCHelpers.h:116
MCTruthClassifier::m_partExtrConeEta
float m_partExtrConeEta
Definition: MCTruthClassifier.h:239
isNeutrino
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition: AtlasPID.h:152
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
IsoElectron
@ IsoElectron
Definition: TruthClasses.h:11
SingleElec
@ SingleElec
Definition: TruthClasses.h:54
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
athena.value
value
Definition: athena.py:122
MCTruthClassifier::m_caloExtensionTool
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
Definition: MCTruthClassifier.h:231
CharmedMesonPart
@ CharmedMesonPart
Definition: TruthClasses.h:36
ISRPhot
@ ISRPhot
Definition: TruthClasses.h:95
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::Electron_v1::trackParticle
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Definition: Electron_v1.cxx:55
asg::AsgTool::getProperty
const T * getProperty(const std::string &name) const
Get one of the tool's properties.
PromptPhot
@ PromptPhot
Definition: TruthClasses.h:93
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
MCTruthPartClassifier::defTypeOfElectron
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
Definition: TruthClassifiers.h:61
BottomMesonPart
@ BottomMesonPart
Definition: TruthClasses.h:34
NuRTau
@ NuRTau
Definition: TruthClasses.h:74
MCTruthClassifier::defOrigOfElectron
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:230
D3PD::D3PDMCTruthClassifier::particleTruthClassifier
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::Electron *el)
Run the classifier for an electron.
Definition: D3PDMCTruthClassifier.cxx:65
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MCTruthClassifier::m_pTNeutralPartCut
float m_pTNeutralPartCut
Definition: MCTruthClassifier.h:249
xAOD::EgammaParameters::AuthorFwdElectron
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition: EgammaDefs.h:30
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
UnknownMuon
@ UnknownMuon
Definition: TruthClasses.h:14
ZBoson
@ ZBoson
Definition: TruthClasses.h:67
UnknownTau
@ UnknownTau
Definition: TruthClasses.h:18
Hadron
@ Hadron
Definition: TruthClasses.h:26
xAOD::TruthParticle_v1::pdg_id
int pdg_id() const
PDG ID code.
Definition: TruthParticle_v1.h:56
MC::find_matching
T find_matching(C TruthTES, T bcin)
Function to find a particle in container.
Definition: HepMCHelpers.h:103
StrangeMesonPart
@ StrangeMesonPart
Definition: TruthClasses.h:41
MCTruthClassifier::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Definition: MCTruthClassifier.h:228
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
WBoson
@ WBoson
Definition: TruthClasses.h:66
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
isSMLepton
bool isSMLepton(const T &p)
Definition: AtlasPID.h:134
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:158
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
NuclFrag
@ NuclFrag
Definition: TruthClasses.h:28
BBbarMesonPart
@ BBbarMesonPart
Definition: TruthClasses.h:33
MCTruthPartClassifier::defTypeOfMuon
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
Definition: TruthClassifiers.h:80
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
MCTruthClassifier::m_NumOfSiHitsCut
int m_NumOfSiHitsCut
Definition: MCTruthClassifier.h:260
HiggsMSSM
@ HiggsMSSM
Definition: TruthClasses.h:69
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
MC::isPhysical
bool isPhysical(const T &p)
Definition: HepMCHelpers.h:32
CCbarMesonPart
@ CCbarMesonPart
Definition: TruthClasses.h:35
MCTruthClassifier::m_jetPartDRMatch
float m_jetPartDRMatch
Definition: MCTruthClassifier.h:261
isQuark
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to dot...
Definition: AtlasPID.h:113
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Neutrino
@ Neutrino
Definition: TruthClasses.h:27
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
TrackParticleTruthCollection::trackParticleContainerLink
DataLink< Rec::TrackParticleContainer > trackParticleContainerLink() const
Definition: TrackParticleTruthCollection.h:26
MCTruthClassifier::m_FwdElectronTruthExtrEtaCut
float m_FwdElectronTruthExtrEtaCut
Definition: MCTruthClassifier.h:237
MC::isHardScatVrtx
bool isHardScatVrtx(T pVert)
Function to classify the vertex as hard scattering vertex.
Definition: HepMCHelpers.h:158
HepMC::is_same_generator_particle
bool is_same_generator_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same generated particle.
Definition: MagicNumbers.h:309
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
HepMC::SPECIALSTATUS
constexpr int SPECIALSTATUS
Constant that the meaning of which is currently lost, to be recovered...
Definition: MagicNumbers.h:41
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
D3PD::D3PDMCTruthClassifier::setProperty1
void setProperty1(const std::string &pname, const std::string &value)
Helper to set the value of a Gaudi property.
Definition: D3PDMCTruthClassifier.cxx:228
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
HepMC::is_simulation_particle
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...
Definition: MagicNumbers.h:299
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TruthLink_t
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
Definition: TauxAODHelpers.cxx:7
UnknownElectron
@ UnknownElectron
Definition: TruthClasses.h:10
ret
T ret(T t)
Definition: rootspy.cxx:260
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DMTest::links
links
Definition: CLinks_v1.cxx:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:256
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
PiZero
@ PiZero
Definition: TruthClasses.h:98
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:13
MultiBoson
@ MultiBoson
Definition: TruthClasses.h:101
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:164
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:530
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: Egamma_v1.cxx:388
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition: CaloCluster_v1.h:896
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DiBoson
@ DiBoson
Definition: TruthClasses.h:99
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
IsoTau
@ IsoTau
Definition: TruthClasses.h:19
LQ
@ LQ
Definition: TruthClasses.h:75
LightMesonPart
@ LightMesonPart
Definition: TruthClasses.h:42
python.xAODType.dummy
dummy
Definition: xAODType.py:4
JPsi
@ JPsi
Definition: TruthClasses.h:84
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
MCTruthClassifier::m_truthLinkVecReadHandleKey
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthLinkVecReadHandleKey
Definition: MCTruthClassifier.h:255
xAOD::Vertex_v1::TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Type for the associated track particles.
Definition: Vertex_v1.h:128
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::TruthVertex_v1::incomingParticle
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Definition: TruthVertex_v1.cxx:71
IsoMuon
@ IsoMuon
Definition: TruthClasses.h:15
StrangeBaryonPart
@ StrangeBaryonPart
Definition: TruthClasses.h:39
MCTruthClassifier::m_phtClasConePhi
float m_phtClasConePhi
Definition: MCTruthClassifier.h:242
MCTruthClassifier::m_partExtrConePhi
float m_partExtrConePhi
Definition: MCTruthClassifier.h:240
CharmedBaryonPart
@ CharmedBaryonPart
Definition: TruthClasses.h:38
MCTruthPartClassifier::defTypeOfHadron
ParticleType defTypeOfHadron(int pdg)
Definition: TruthClassifiers.h:46
LB_AnalMapSplitter.tot
tot
Definition: LB_AnalMapSplitter.py:46
isSUSY
bool isSUSY(const T &p)
Definition: AtlasPID.h:201
LJet
@ LJet
Definition: TruthClasses.h:45
MCTruthClassifier::genPartToCalo
bool genPartToCalo(const EventContext &ctx, const xAOD::CaloCluster *clus, const xAOD::TruthParticle *thePart, bool isFwrdEle, double &dRmatch, bool &isNarrowCone, const CaloDetDescrManager &caloDDMgr) const
Definition: MCTruthClassifierAthena.cxx:237
isTau
bool isTau(const T &p)
Definition: AtlasPID.h:148
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
D3PD::D3PDMCTruthClassifier::m_sg
ServiceHandle< StoreGateSvc > m_sg
The StoreGate service.
Definition: D3PDMCTruthClassifier.h:119
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
MCTruthClassifier::getGenPart
virtual const xAOD::TruthParticle * getGenPart(const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
Definition: MCRecoToTruth.cxx:181
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
BJet
@ BJet
Definition: TruthClasses.h:43
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
SinglePhot
@ SinglePhot
Definition: TruthClasses.h:56
MCTruthPartClassifier::defOutComeOfElectron
ParticleOutCome defOutComeOfElectron(T thePart)
Definition: TruthClassifiers.h:189
D3PD::D3PDMCTruthClassifier::get_tptruth_name
bool get_tptruth_name(const std::string &tp_name, std::string &tptruth_name)
Try to find a TrackParticleTruthCollection pointing at TP_NAME.
Definition: D3PDMCTruthClassifier.cxx:174
BottomBaryonPart
@ BottomBaryonPart
Definition: TruthClasses.h:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
DataLinkBase::isDefault
bool isDefault() const
Test to see if we're in the default state.
Definition: DataLinkBase.cxx:31
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SUSY
@ SUSY
Definition: TruthClasses.h:77
HeavyBoson
@ HeavyBoson
Definition: TruthClasses.h:70
MCTruthClassifier::m_inclG4part
bool m_inclG4part
Definition: MCTruthClassifier.h:250
isHadron
bool isHadron(const T &p)
Definition: AtlasPID.h:207
xAOD::TruthVertex_v1::particles_out
std::vector< const TruthParticle * > particles_out() const
Get the outgoing particles.
Definition: TruthVertex_v1.cxx:66
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
UndrPhot
@ UndrPhot
Definition: TruthClasses.h:94
MCTruthClassifier::egammaClusMatch
const xAOD::TruthParticle * egammaClusMatch(const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierAthena.cxx:44
NucReact
@ NucReact
Definition: TruthClasses.h:97
NonInteract
@ NonInteract
Definition: TruthClasses.h:110
MCTruthClassifier::MCTruthClassifier
MCTruthClassifier(const std::string &type)
Definition: MCTruthClassifier.h:65
QuarkWeakDec
@ QuarkWeakDec
Definition: TruthClasses.h:65
MCTruthClassifier::defOrigOfMuon
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:539
MCTruthClassifier::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: MCTruthClassifier.h:232
isW
bool isW(const T &p)
Definition: AtlasPID.h:167
xAOD::TruthParticle_v1::status
int status() const
Status code.
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
SUSYParticle
@ SUSYParticle
Definition: TruthClasses.h:31
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:302
xAOD::TruthParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition: TruthParticle_v1.cxx:181
MCTruthPartClassifier::isPrompt
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
Definition: TruthClassifiers.h:180
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:49
MC::isDecayed
bool isDecayed(const T &p)
Definition: HepMCHelpers.h:29
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:22
TrackParticleTruthCollection
Definition: TrackParticleTruthCollection.h:18
MC::isBeam
bool isBeam(const T &p)
Definition: HepMCHelpers.h:28
MCTruthClassifier::m_deltaRMatchCut
float m_deltaRMatchCut
Definition: MCTruthClassifier.h:258
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MCTruthPartClassifier::convHadronTypeToOrig
ParticleOrigin convHadronTypeToOrig(ParticleType pType, int motherPDG)
Definition: TruthClassifiers.h:15
NonPrimary
@ NonPrimary
Definition: TruthClasses.h:29
Higgs
@ Higgs
Definition: TruthClasses.h:68
MCTruthClassifier::m_deltaPhiMatchCut
float m_deltaPhiMatchCut
Definition: MCTruthClassifier.h:259
MCTruthPartClassifier::defJetOrig
ParticleOrigin defJetOrig(const T &allJetMothers)
Definition: TruthClassifiers.h:131
MCTruthClassifier::defOrigOfTau
MCTruthPartClassifier::ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:775
MC::findParticleDaughters
void findParticleDaughters(T thePart, std::set< T > &daughters)
Function to get the particle stable MC daughters.
Definition: HepMCHelpers.h:129
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
extractSporadic.q
list q
Definition: extractSporadic.py:98
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
MCTruthClassifier::m_pTChargePartCut
float m_pTChargePartCut
Definition: MCTruthClassifier.h:248
SingleMuon
@ SingleMuon
Definition: TruthClasses.h:55
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
MCTruthPartClassifier::defTypeOfTau
ParticleType defTypeOfTau(ParticleOrigin TauOrig)
Definition: TruthClassifiers.h:98
xAOD::JetConstituentVector
A vector of jet constituents at the scale used during jet finding.
Definition: JetConstituentVector.h:117
UnknownJet
@ UnknownJet
Definition: TruthClasses.h:48
OtherBSM
@ OtherBSM
Definition: TruthClasses.h:78
MCTruthClassifier::m_truthInConeTool
ToolHandle< xAOD::ITruthParticlesInConeTool > m_truthInConeTool
Definition: MCTruthClassifier.h:234
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
DalitzDec
@ DalitzDec
Definition: TruthClasses.h:60
top
@ top
Definition: TruthClasses.h:64
MCTruthPartClassifier::defOutComeOfPhoton
ParticleOutCome defOutComeOfPhoton(T thePart)
Definition: TruthClassifiers.h:268
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
CJet
@ CJet
Definition: TruthClasses.h:44
KaonDecay
@ KaonDecay
Definition: TruthClasses.h:91
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:525
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
MCTruthClassifier::particleTruthClassifier
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override
Definition: MCTruthClassifierGen.cxx:77
MCTruthClassifier::m_FwdElectronUseG4Sel
bool m_FwdElectronUseG4Sel
Definition: MCTruthClassifier.h:236
SG::DataProxy
Definition: DataProxy.h:44
ParticleType
ParticleType
Definition: TruthClasses.h:8
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
MCTruthClassifier::m_fwrdEledRtoTrCut
float m_fwrdEledRtoTrCut
Definition: MCTruthClassifier.h:245
MCTruthPartClassifier::Info
Definition: IMCTruthClassifier.h:49
Neutrino
Definition: Neutrino.h:33
xAOD::Photon_v1::vertex
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition: Photon_v1.cxx:46
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:121
MCTruthClassifier::detEta
double detEta(double x, double y) const
Definition: MCTruthClassifier.h:175
BkgElectron
@ BkgElectron
Definition: TruthClasses.h:13
MCTruthClassifier::m_ROICone
bool m_ROICone
Definition: MCTruthClassifier.h:246
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
xAOD::TruthParticle_v1::charge
double charge() const
Physical charge.
UnknownPhoton
@ UnknownPhoton
Definition: TruthClasses.h:22
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
fitman.k
k
Definition: fitman.py:528
BremPhot
@ BremPhot
Definition: TruthClasses.h:92
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
MCTruthClassifier::defOrigOfPhoton
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:952
MCTruthClassifier::m_phtdRtoTrCut
float m_phtdRtoTrCut
Definition: MCTruthClassifier.h:244
MCTruthClassifier::detPhi
double detPhi(double x, double y) const
Definition: MCTruthClassifier.h:176
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:145
MC::getMother
T getMother(T thePart)
Function to get a mother of particle. MCTruthClassifier legacy.
Definition: HepMCHelpers.h:68