Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOriginparticleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual const xAOD::TruthParticlegetGenPart (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
 
virtual const xAOD::TruthParticleegammaClusMatch (const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const override final
 
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
 
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

◆ 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 225 of file MCTruthClassifierGen.cxx.

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

◆ defOrigOfMuon()

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

Definition at line 526 of file MCTruthClassifierGen.cxx.

530 {
531  ATH_MSG_DEBUG("Executing DefOrigOfMuon ");
532 
533  const xAOD::TruthParticle* thePriPart = MC::findMatching(mcTruthTES, thePart);
534  if (!thePriPart) return NonDefined;
535  if (!MC::isMuon(thePriPart)) return NonDefined;
536 
537  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
538 
539  //-- to define muon outcome status
540  info.particleOutCome = defOutComeOfMuon(thePriPart);
541 
542  if (!partOriVert) return NonDefined;
543 
544  int numOfParents = partOriVert->nIncomingParticles();
545  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfMuon:: muon has more than one mother ");
546 
547  const xAOD::TruthParticle* mother = MC::findMother(thePriPart);
548  info.setMotherProperties(mother);
549  if (!mother) {
550  return NonDefined;
551  }
552 
553  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
554  int motherPDG = mother->pdgId();
555 
556  if ((MC::isTau(motherPDG)|| MC::isW(motherPDG)) && mothOriVert != nullptr) {
557  int pPDG(0);
558  const xAOD::TruthParticle* MotherParent(nullptr);
559  do {
560  //
561  pPDG = 0;
562  //
563  const xAOD::TruthVertex* mother_prdVtx(nullptr);
564  const xAOD::TruthVertex* mother_endVtx(nullptr);
565  MotherParent = MC::findMother(mother);
566  // to prevent Sherpa loop
567  mother_prdVtx = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
568  mother_endVtx = mother->decayVtx();
569  //
570  const xAOD::TruthVertex* parent_prdVtx(nullptr);
571  const xAOD::TruthVertex* parent_endVtx(nullptr);
572  if (MotherParent) {
573  parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() : nullptr;
574  parent_endVtx = MotherParent->decayVtx();
575  }
576  //
577  if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
578  MotherParent = mother;
579  break;
580  }
581  //
582  // to prevent Sherpa loop
583  if (mother == MotherParent) {
584  break;
585  }
586 
587  if (MotherParent) {
588  pPDG = MotherParent->pdgId();
589  if (MC::isMuon(pPDG) || MC::isTau(pPDG) || MC::isW(pPDG)) {
590  mother = MotherParent;
591  info.setMotherProperties(mother);
592  }
593  }
594  } while ((MC::isMuon(pPDG) || MC::isTau(pPDG) || MC::isW(pPDG)));
595 
596  if (MC::isTau(pPDG) || MC::isW(pPDG) || MC::isZ(pPDG) || MC::isHiggs(pPDG) ||
597  MC::isMSSMHiggs(pPDG) || MC::isHeavyBoson(pPDG) || MC::isTop(pPDG) || // MSSM Higgs bosons, Heavy bosons( Z', Z'', W'+)
598  abs(pPDG) == MC::WBOSON_LRSM || MC::isNeutrinoRH(pPDG) || // Left-right symmetric model WBoson || Right-handed neutrino (Pythia-specific)
599  MC::isSUSY(pPDG)) {
600  info.setMotherProperties(mother);
601  }
602  }
603 
604  motherPDG = mother->pdgId();
605  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
606  partOriVert = mother->decayVtx();
607  numOfParents = partOriVert->nIncomingParticles();
608  int numOfDaug = partOriVert->nOutgoingParticles();
609 
610  info.setMotherProperties(mother);
611  auto DP = DecayProducts(partOriVert);
612  const int NumOfPhot = DP.pd(MC::PHOTON);
613  const int NumOfEl = DP.pd(MC::ELECTRON);
614  const int NumOfPos = DP.pd(MC::POSITRON);
615  const int NumOfElNeut = DP.apd(MC::NU_E);
616  const int NumOfMuNeut = DP.apd(MC::NU_MU);
617  const int NumOfLQ = DP.apd(MC::LEPTOQUARK);
618  const int NumOfquark = DP.apd({MC::DQUARK,MC::UQUARK,MC::SQUARK,MC::CQUARK,MC::BQUARK,MC::TQUARK});
619  const int NumOfgluon = DP.apd(MC::GLUON);
620  const int NumOfMuPl = DP.pd(-MC::MUON);
621  const int NumOfMuMin = DP.pd(MC::MUON);
622  const int NumOfTau = DP.apd(MC::TAU);
623  const int NumOfTauNeut = DP.apd(MC::NU_TAU);
624  if (std::abs(motherPDG) == MC::PIPLUS && numOfDaug == 2 && NumOfMuNeut == 1) return PionDecay;
625  if (std::abs(motherPDG) == MC::KPLUS && numOfDaug == 2 && NumOfMuNeut == 1) return KaonDecay;
626  if (MC::isTau(motherPDG)) {
627  ParticleOrigin tauOrig = defOrigOfTau(mcTruthTES, mother, motherPDG, info);
628  ParticleType tautype = defTypeOfTau(tauOrig);
629  return (tautype == IsoTau)?tauOrig:TauLep;
630  }
631 
632  if (MC::isTop(motherPDG)) return top;
633  // Quark weak decay
634  if (MC::isSMQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && NumOfMuNeut == 1) return QuarkWeakDec;
635 
636  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
637  const xAOD::TruthVertex* prodVert = mothOriVert;
638  const xAOD::TruthParticle* itrP;
639  do {
640  itrP = prodVert->incomingParticle(0);
641  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
642  } while (MC::isW(itrP) && prodVert != nullptr);
643 
644  if (prodVert && prodVert->nIncomingParticles() == 1) {
645  if (abs(itrP->pdgId()) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
646  if (abs(itrP->pdgId()) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
647  if (abs(itrP->pdgId()) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
648  }
649  return WBoson;
650  }
651  if (MC::isW(motherPDG)) return WBoson;
652  if (MC::isZ(motherPDG)) return ZBoson;
653  if (MC::isPhoton(motherPDG) && numOfDaug == 2 && NumOfMuMin == 1 && NumOfMuPl == 1) return PhotonConv;
654  //-- Exotics
655 
656  // MadGraphPythia ZWW*->lllnulnu
657 
658  if (numOfParents == 1 && numOfDaug > 4 && (MC::isSMQuark(motherPDG) || MC::isGluon(motherPDG))) {
659  bool isZboson = false;
660  bool isWboson = false;
661  bool skipnext = false;
662  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
663  if (skipnext) {
664  skipnext = false;
665  continue;
666  }
667  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
668  if (!theDaug) continue;
669  const xAOD::TruthParticle* theNextDaug = nullptr;
670  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
671  theNextDaug = partOriVert->outgoingParticle(ipOut1);
672  if (theNextDaug != nullptr) break;
673  }
674  if (!theNextDaug) continue;
675  if (MC::isMuon(theDaug) && MC::isMuon(theNextDaug)) {
676  // Zboson
677  if (thePriPart == theDaug || thePriPart == theNextDaug) {
678  isZboson = true;
679  break;
680  }
681  skipnext = true;
682  } else if (MC::isMuon(theDaug) && abs(theNextDaug->pdgId()) == MC::NU_MU) {
683  // WBoson
684  if (thePriPart == theDaug || thePriPart == theNextDaug) {
685  isWboson = true;
686  break;
687  }
688  skipnext = true;
689  }
690  }
691  if (isWboson) return WBoson;
692  if (isZboson) return ZBoson;
693  }
694  if (numOfParents == 2 ) {
695  const int pdg1 = partOriVert->incomingParticle(0)->pdgId();
696  const int pdg2 = partOriVert->incomingParticle(1)->pdgId();
697  //--Sherpa Z->mumu
698  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfMuPl == 1 && NumOfMuMin == 1) return ZBoson;
699 
700  //--Sherpa W->munu ??
701  // if(numOfParents==2&&(numOfDaug-NumOfquark-NumOfgluon)==2&&(NumOfEl==1||NumOfPos==1)&&NumOfElNeut==1) return WBoson;
702  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1) return WBoson;
703 
704  //--Sherpa ZZ,ZW
705  if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
706  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
707  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
708 
709  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
710  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
711  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
712  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
713 }
714 
715  //--New Sherpa Z->mumu
716  if (partOriVert == mothOriVert) {
717  int NumOfMuLoop = 0;
718  int NumOfMuNeuLoop = 0;
719  int NumOfLepLoop = 0;
720  for (const auto & pout: partOriVert->particles_out()) {
721  for (const auto & pin: partOriVert->particles_in()) {
722  if (!pout) continue;
723  if (!pin) continue;
724  if (HepMC::is_same_particle(pout,pin)) {
725  if (MC::isMuon(pout)) NumOfMuLoop++;
726  if (std::abs(pout->pdg_id()) == MC::NU_MU) NumOfMuNeuLoop++;
727  if (MC::isSMLepton(pout)) NumOfLepLoop++;
728  }
729  }
730  }
731  if (NumOfMuLoop == 2 && NumOfMuNeuLoop == 0) return ZBoson;
732  if (NumOfMuLoop == 1 && NumOfMuNeuLoop == 1) return WBoson;
733  if ((NumOfMuLoop == 4 && NumOfMuNeuLoop == 0) || (NumOfMuLoop == 3 && NumOfMuNeuLoop == 1) || (NumOfMuLoop == 2 && NumOfMuNeuLoop == 2)) return DiBoson;
734  if (NumOfLepLoop == 4) return DiBoson;
735  }
736 
737  //-- McAtNLo
738 
739  if (MC::isHiggs(motherPDG)) return Higgs;
740 
741  if (MC::isMSSMHiggs(motherPDG)) return HiggsMSSM; // MSSM Higgs bosons
742 
743  if (MC::isHeavyBoson(motherPDG)) return HeavyBoson; // Heavy bosons( Z', Z'', W'+)
744 
745  if (abs(motherPDG) == MC::WBOSON_LRSM) return WBosonLRSM; // Left-right symmetric model WBoson (Pythia-specific)
746  if (abs(motherPDG) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
747  if (abs(motherPDG) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
748  if (abs(motherPDG) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
749  if (MC::isLeptoQuark(motherPDG) || NumOfLQ != 0) return LQ;
750  if (MC::isSUSY(motherPDG)) return SUSY;
751  if (MC::isBSM(motherPDG)) return OtherBSM;
752 
753  ParticleType pType = defTypeOfHadron(motherPDG);
754  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatteringVertex(mothOriVert)) isPrompt = true;
755 
756  return convHadronTypeToOrig(pType, motherPDG);
757 }

◆ defOrigOfNeutrino()

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

Definition at line 1187 of file MCTruthClassifierGen.cxx.

1191 {
1192  ATH_MSG_DEBUG("Executing DefOrigOfNeutrino ");
1193 
1194  const int nuFlav = abs(thePart->pdgId());
1195  const xAOD::TruthParticle* thePriPart = MC::findMatching(mcTruthTES, thePart);
1196  if (!thePriPart) return NonDefined;
1197  if (abs(thePriPart->pdgId()) != nuFlav) return NonDefined;
1198 
1199  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
1200 
1201  //-- to define neutrino outcome status
1202  info.particleOutCome = NonInteract;
1203 
1204  if (!partOriVert) return NonDefined;
1205 
1206  int numOfParents = -1;
1207  numOfParents = partOriVert->nIncomingParticles();
1208  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfNeutrino:: neutrino has more than one mother ");
1209 
1210  const xAOD::TruthParticle* mother = MC::findMother(thePriPart);
1211  info.mother = mother; // FIXME why isn't info.setMotherProperties(mother) used here??
1212  if (!mother) return NonDefined;
1213  int motherPDG = mother->pdgId();
1214  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1215 
1216  // to resolve Sherpa loop
1217  bool samePart = false;
1218  if (mothOriVert && HepMC::is_same_vertex(mothOriVert,partOriVert)) samePart = true;
1219  //
1220  if ((abs(motherPDG) == nuFlav || MC::isTau(motherPDG) || MC::isW(motherPDG)) && mothOriVert != nullptr &&
1221  !samePart) {
1222  int pPDG(0);
1223  const xAOD::TruthParticle* MotherParent(nullptr);
1224  do {
1225  pPDG = 0;
1226  MotherParent = MC::findMother(mother);
1227  // to prevent Sherpa loop
1228  const xAOD::TruthVertex* mother_prdVtx(nullptr);
1229  const xAOD::TruthVertex* mother_endVtx(nullptr);
1230  if (mother) {
1231  mother_prdVtx = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1232  mother_endVtx = mother->decayVtx();
1233  }
1234  const xAOD::TruthVertex* parent_prdVtx(nullptr);
1235  const xAOD::TruthVertex* parent_endVtx(nullptr);
1236  if (MotherParent) {
1237  parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() : nullptr;
1238  parent_endVtx = MotherParent->decayVtx();
1239  }
1240  if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
1241  MotherParent = mother;
1242  break;
1243  }
1244  //
1245  if (MotherParent) {
1246  pPDG = MotherParent->pdgId();
1247  }
1248  // to prevent Sherpa loop
1249  if (mother == MotherParent) {
1250  break;
1251  }
1252  if (abs(pPDG) == nuFlav || MC::isTau(pPDG) || MC::isW(pPDG) ) {
1253  mother = MotherParent;
1254  info.setMotherProperties(mother);
1255  }
1256 
1257  } while ((std::abs(pPDG) == nuFlav || MC::isTau(pPDG) || MC::isW(pPDG)));
1258 
1259  if (std::abs(pPDG) == nuFlav || MC::isTau(pPDG) || MC::isW(pPDG) || MC::isZ(pPDG) || MC::isHiggs(pPDG) ||
1260  MC::isMSSMHiggs(pPDG) || MC::isHeavyBoson(pPDG) || MC::isTop(pPDG) || // MSSM Higgs bosons, Heavy bosons( Z', Z'', W'+)
1261  std::abs(pPDG) == MC::WBOSON_LRSM || MC::isNeutrinoRH(pPDG) || // Left-right symmetric model WBoson || Right-handed neutrino (Pythia-specific)
1262  MC::isSUSY(pPDG)) {
1263  mother = MotherParent;
1264  info.setMotherProperties(mother);
1265  }
1266  }
1267  //if mother is still nullptr, we have a problem
1268  if (!mother) return NonDefined;
1269 
1270  motherPDG = mother->pdgId();
1271  partOriVert = mother->decayVtx();
1272  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
1273  numOfParents = partOriVert->nIncomingParticles();
1274  int numOfDaug = partOriVert->nOutgoingParticles();
1275 
1276  info.setMotherProperties(mother);
1277 
1278  int NumOfPhot(0);
1279  int NumOfquark(0);
1280  int NumOfgluon(0);
1281  int NumOfLQ(0);
1282  int NumOfElNeut(0);
1283  int NumOfMuNeut(0);
1284  int NumOfTauNeut(0);
1285  int NumOfEl(0);
1286  int NumOfMu(0);
1287  int NumOfTau(0);
1288  samePart = false;
1289 
1290  for (const auto& theDaug: partOriVert->particles_out()) {
1291  if (!theDaug) continue;
1292  int DaugType = theDaug->pdgId();
1293  if (MC::isSMQuark(DaugType)) NumOfquark++;
1294  else if (MC::isGluon(DaugType)) NumOfgluon++;
1295  else if (abs(DaugType) == MC::NU_E) NumOfElNeut++;
1296  else if (std::abs(DaugType) == MC::NU_MU) NumOfMuNeut++;
1297  else if (std::abs(DaugType) == MC::NU_TAU) NumOfTauNeut++;
1298  else if (MC::isPhoton(DaugType)) NumOfPhot++;
1299  else if (MC::isElectron(DaugType)) NumOfEl++;
1300  else if (MC::isMuon(DaugType)) NumOfMu++;
1301  else if (MC::isTau(DaugType)) NumOfTau++;
1302  else if (MC::isLeptoQuark(DaugType)) NumOfLQ++;
1303  if (std::abs(DaugType) == std::abs(motherPDG) && theDaug && info.Mother() && HepMC::is_same_generator_particle(theDaug,info.Mother())) samePart = true;
1304  }
1305 
1306  // Quark weak decay
1307  if (MC::isQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && (NumOfEl == 1 || NumOfMu == 1 || NumOfTau == 1)) return QuarkWeakDec;
1308  if (MC::isTop(motherPDG)) return top;
1309 
1310  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
1311  const xAOD::TruthVertex* prodVert = mothOriVert;
1312  const xAOD::TruthParticle* ptrPart;
1313  do {
1314  ptrPart = prodVert->incomingParticle(0);
1315  prodVert = ptrPart->hasProdVtx() ? ptrPart->prodVtx() : nullptr;
1316  } while (MC::isW(ptrPart) && prodVert != nullptr);
1317 
1318  if (prodVert && prodVert->nIncomingParticles() == 1) {
1319  if (abs(ptrPart->pdgId()) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
1320  if (abs(ptrPart->pdgId()) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
1321  if (abs(ptrPart->pdgId()) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
1322  }
1323  return WBoson;
1324  }
1325  if (MC::isW(motherPDG)) return WBoson;
1326  if (MC::isZ(motherPDG)) return ZBoson;
1327 
1328  //-- Exotics
1329 
1330  // MadGraphPythia ZWW*->lllnulnu or ZWW*->nunulnulnu (don't even know if the latter is generated)
1331  if (numOfParents == 1 && numOfDaug > 4 && (MC::isSMQuark(motherPDG) || MC::isGluon(motherPDG))) {
1332 
1333  const xAOD::TruthParticle* thePartToCheck = thePriPart;
1334  const xAOD::TruthParticle* theMother = thePriPart->hasProdVtx() ? thePriPart->prodVtx()->incomingParticle(0) : nullptr;
1335 
1336  if (MC::isElectron(theMother) && MC::isDecayed(theMother)) thePartToCheck = theMother;
1337  bool isZboson = false;
1338  bool isWboson = false;
1339  bool skipnext = false;
1340 
1341  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ++ipOut) {
1342  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
1343  if (!theDaug) continue;
1344  const xAOD::TruthParticle* theNextDaug = nullptr;
1345  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
1346  theNextDaug = partOriVert->outgoingParticle(ipOut1);
1347  if (theNextDaug != nullptr) break;
1348  }
1349  if (!theNextDaug) continue;
1350 
1351  if (skipnext) {
1352  skipnext = false;
1353  continue;
1354  }
1355 
1356  const int apdgID1 = abs(theDaug->pdgId());
1357  const int apdgID2 = abs(theNextDaug->pdgId());
1358  if (apdgID1 == apdgID2 && MC::isSMNeutrino(apdgID1)) {
1359  // Zboson
1360  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1361  isZboson = true;
1362  break;
1363  }
1364  skipnext = true;
1365  } else if ((apdgID1 == MC::ELECTRON && apdgID2 == MC::NU_E) ||
1366  (apdgID1 == MC::NU_E && apdgID2 == MC::ELECTRON) ||
1367  (apdgID1 == MC::MUON && apdgID2 == MC::NU_MU) ||
1368  (apdgID1 == MC::NU_MU && apdgID2 == MC::MUON) ||
1369  (apdgID1 == MC::TAU && apdgID2 == MC::NU_TAU) ||
1370  (apdgID1 == MC::NU_TAU && apdgID2 == MC::TAU)
1371  ) {
1372  // WBoson
1373  if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1374  isWboson = true;
1375  break;
1376  }
1377  skipnext = true;
1378  }
1379  }
1380  if (isWboson) return WBoson;
1381  if (isZboson) return ZBoson;
1382  }
1383 
1384  if (numOfParents == 2) {
1385  int pdg1 = partOriVert->incomingParticle(0)->pdgId();
1386  int pdg2 = partOriVert->incomingParticle(1)->pdgId();
1387  //--Sherpa Z->nunu
1388  if ( (numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2)) return ZBoson;
1389 
1390  //--Sherpa W->enu ??
1391  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && ((NumOfEl == 1 && NumOfElNeut == 1) || (NumOfMu == 1 && NumOfMuNeut == 1) || (NumOfTau == 1 && NumOfTauNeut == 1))) return WBoson;
1392 
1393  //--Sherpa ZZ,ZW
1394  if ( (numOfDaug - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
1395  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
1396 
1397  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
1398  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
1399  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
1400  }
1401 
1402  // New Sherpa Z->nunu
1403  if (partOriVert == mothOriVert && partOriVert != nullptr) {
1404  int NumOfLepLoop = 0;
1405  int NumOfNeuLoop = 0;
1406  for (const auto *const pout: partOriVert->particles_out()) {
1407  if (!pout) continue;
1408  for (const auto *const pin: partOriVert->particles_in()) {
1409  if (!pin) continue;
1410  if (HepMC::is_same_particle(pin,pout)) continue;
1411  const int apdgid = abs(pout->pdgId());
1412  if (MC::isSMLepton(apdgid)) {
1413  if (MC::isSMNeutrino(apdgid)) { NumOfNeuLoop++; }
1414  else { NumOfLepLoop++; }
1415  }
1416  }
1417  }
1418  if (NumOfNeuLoop == 2 && NumOfLepLoop == 0) return ZBoson;
1419  if (NumOfNeuLoop == 1 && NumOfLepLoop == 1) return WBoson;
1420  if (NumOfNeuLoop + NumOfLepLoop == 4) return DiBoson;
1421  }
1422 
1423  //-- McAtNLo
1424 
1425  if (MC::isHiggs(motherPDG)) return Higgs;
1426  if (MC::isMSSMHiggs(motherPDG)) return HiggsMSSM; // MSSM Higgs bosons
1427  if (MC::isHeavyBoson(motherPDG)) return HeavyBoson; // Heavy bosons( Z', Z'', W'+)
1428 
1429  if (MC::isTau(motherPDG)) {
1430  ParticleOrigin tauOrig = defOrigOfTau(mcTruthTES, mother, motherPDG, info);
1431  ParticleType tautype = defTypeOfTau(tauOrig);
1432  return (tautype == IsoTau)?tauOrig:TauLep;
1433  }
1434 
1435  if (abs(motherPDG) == MC::WBOSON_LRSM) return WBosonLRSM; // Left-right symmetric model WBoson (Pythia-specific)
1436  if (abs(motherPDG) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
1437  if (abs(motherPDG) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
1438  if (abs(motherPDG) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
1439  if (MC::isLeptoQuark(motherPDG) || NumOfLQ != 0) return LQ;
1440  if (MC::isSUSY(motherPDG)) return SUSY;
1441  if (MC::isBSM(motherPDG)) return OtherBSM;
1442 
1443  ParticleType pType = defTypeOfHadron(motherPDG);
1444  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatteringVertex(mothOriVert)) isPrompt = true;
1445 
1446  return convHadronTypeToOrig(pType, motherPDG);
1447 }

◆ defOrigOfPhoton()

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

Definition at line 933 of file MCTruthClassifierGen.cxx.

937 {
938  if (!thePart) return NonDefined;
939  if (!mcTruthTES) return NonDefined;
940  ATH_MSG_DEBUG("Executing DefOrigOfPhoton ");
941 
942  info.resetMotherProperties();
943  info.photonMother = nullptr;
944 
945  const xAOD::TruthParticle* thePriPart = MC::findMatching(mcTruthTES, thePart);
946  if (!thePriPart) return NonDefined;
947  if (!MC::isPhoton(thePriPart)) return NonDefined;
948 
949  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
950 
951  //-- to define photon outcome status
952  info.particleOutCome = defOutComeOfPhoton(thePriPart);
953  if (!partOriVert) return NonDefined;
954 
955  int numOfParents = partOriVert->nIncomingParticles();
956  if (partOriVert->nIncomingParticles() > 1) ATH_MSG_DEBUG("DefOrigOfPhoton:: photon has more than one mother ");
957 
958 
959  const xAOD::TruthParticle* mother = MC::findMother(thePriPart);
960  info.setMotherProperties(mother);
961  if (!mother) return NonDefined;
962  int motherPDG = mother->pdgId();
963  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
964  info.setMotherProperties(mother);
965  partOriVert = mother->decayVtx();
966  numOfParents = partOriVert->nIncomingParticles();
967  int numOfDaug = partOriVert->nOutgoingParticles();
968  int NumOfNucFr(0);
969  int NumOfEl(0);
970  int NumOfPos(0);
971  int NumOfMu(0);
972  int NumOfTau(0);
973  int NumOfPht(0);
974  int NumOfLQ(0);
975  int DaugType(0);
976  long NumOfLep(0);
977  long NumOfNeut(0);
978  long NumOfPartons(0);
979  const xAOD::TruthParticle* Daug = nullptr;
980  for (const auto& pout: partOriVert->particles_out()) {
981  if (!pout) continue;
982  DaugType = pout->pdg_id();
983  if (numOfParents == 1 && (MC::isPhoton(motherPDG) || MC::isElectron(motherPDG) || abs(motherPDG) == MC::PIPLUS) &&
984  (MC::isNucleus(DaugType) || DaugType == 0 || DaugType == MC::PROTON || DaugType == MC::NEUTRON))
985  NumOfNucFr++;
986  if (DaugType == MC::PHOTON) NumOfPht++;
987  else if (DaugType == MC::ELECTRON) NumOfEl++;
988  else if (DaugType == MC::POSITRON) NumOfPos++;
989  else if (MC::isMuon(DaugType)) NumOfMu++;
990  else if (MC::isTau(DaugType)) NumOfTau++;
991  else if (MC::isLeptoQuark(DaugType)) NumOfLQ++;
992  else if (MC::isElectron(DaugType) || MC::isMuon(DaugType) || MC::isTau(DaugType)) NumOfLep++;
993  else if (abs(DaugType) == MC::NU_E || abs(DaugType) == MC::NU_MU || abs(DaugType) == MC::NU_TAU) NumOfNeut++;
994  if (abs(DaugType) < MC::ELECTRON || (abs(DaugType) > MC::NU_TAU && abs(DaugType) < 43 && !MC::isPhoton(DaugType))) NumOfPartons++; // FIXME Too loose? This definition picks up 4th generation quarks and leptons as well as all gauge bosons and leptoquarks.
995  if (DaugType == motherPDG) {
996  Daug = pout;
997  }
998  }
999 
1000  bool foundISR = false;
1001  bool foundFSR = false;
1002  if (numOfParents == 1 && numOfDaug == 2 && Daug && info.Mother() && HepMC::is_same_generator_particle(Daug, info.Mother())) return BremPhot;
1003  if (numOfParents == 1 && numOfDaug == 2 && MC::isElectron(motherPDG) && NumOfPht == 2) return ElMagProc;
1004 
1005  // decay of W,Z and Higgs to lepton with FSR generated by Pythia
1006  if (numOfParents == 1 && numOfDaug == 2 && (MC::isElectron(motherPDG) || MC::isMuon(motherPDG) || MC::isTau(motherPDG)) &&
1007  !(Daug && info.Mother() && HepMC::is_same_generator_particle(Daug, info.Mother())) && mothOriVert != nullptr &&
1008  mothOriVert->nIncomingParticles() == 1) {
1009  int itr = 0;
1010  int PartPDG = 0;
1011  const xAOD::TruthVertex* prodVert = mothOriVert;
1012  const xAOD::TruthVertex* Vert = nullptr;
1013  do {
1014  Vert = prodVert;
1015  for (const auto & pin: Vert->particles_in()) {
1016  if (!pin) continue;
1017  PartPDG = abs(pin->pdgId());
1018  prodVert = pin->prodVtx();
1019  if (MC::isZ(PartPDG) || MC::isW(PartPDG) || MC::isHiggs(PartPDG)) foundFSR = true;
1020  }
1021  itr++;
1022  if (itr > 100) { // FIXME Improve loop detection here?
1023  ATH_MSG_WARNING("DefOrigOfPhoton:: infinite while");
1024  break;
1025  }
1026  } while (prodVert != nullptr && abs(motherPDG) == PartPDG);
1027 
1028  if (foundFSR) return FSRPhot;
1029  }
1030 
1031  // Nucl reaction
1032  // gamma+Nuclear=>gamma+Nucl.Fr+Nuclons+pions
1033  // e+Nuclear=>e+gamma+Nucl.Fr+Nuclons+pions
1034  // pi+Nuclear=>gamma+Nucl.Fr+Nuclons+pions
1035 
1036  if ((numOfParents == 1 && (MC::isPhoton(motherPDG) || MC::isElectron(motherPDG)) && numOfDaug > 2 && NumOfNucFr != 0) ||
1037  (numOfParents == 1 && abs(motherPDG) == MC::PIPLUS && numOfDaug > 10 && NumOfNucFr != 0) ||
1038  (numOfParents == 1 && MC::isPhoton(motherPDG) && numOfDaug > 10 && MC::isStable(mother)) ||
1039  (numOfParents == 1 && MC::isNucleus(motherPDG) && std::abs(motherPDG) != MC::PROTON)) // FIXME vetoing protons here to preserve previous behaviour
1040  return NucReact;
1041 
1042  if (MC::isMuon(motherPDG) && NumOfMu == 0) return Mu;
1043  if (MC::isTau(motherPDG) && NumOfTau == 0) return TauLep;
1044 
1045  if (numOfParents == 1 && mother && mother->status() == 3) return (foundISR)? ISRPhot:UndrPhot;
1046 
1047  //-- to find initial and final state raiation and underline photons
1048  //-- SUSY
1049  if (numOfParents == 1 && (MC::isSMQuark(motherPDG) || MC::isGluon(motherPDG)) &&
1050  (numOfDaug != NumOfPht + NumOfPartons || !MC::Pythia8::isConditionA(mother))) {
1051  for (const auto& pout: partOriVert->particles_out()) {
1052  if (!pout) continue;
1053  if (motherPDG != pout->pdgId()) continue;
1054  const xAOD::TruthVertex* Vrtx = pout->decayVtx();
1055  if (!Vrtx) continue;
1056  if (Vrtx->nOutgoingParticles() != 1 && Vrtx->nIncomingParticles() == 1) continue;
1057  if (!Vrtx->outgoingParticle(0)) continue;
1058  if (Vrtx->outgoingParticle(0)->pdgId() == 91) foundISR = true; // Herwig "cluster"
1059  }
1060  return (foundISR)?ISRPhot:UndrPhot;
1061  }
1062 
1063  //-- to find final state radiation
1064  //-- Exotics
1065 
1066  // FSR from Photos
1067  //-- Exotics- CompHep
1068  if (numOfParents == 2 && ((MC::isElectron(motherPDG) && NumOfEl == 1 && NumOfPos == 1) || (MC::isMuon(motherPDG) && NumOfMu == 2) || (MC::isTau(motherPDG) && NumOfTau == 2))) {
1069  if (abs(partOriVert->incomingParticle(0)->pdgId()) == abs(partOriVert->incomingParticle(1)->pdgId())) return FSRPhot;
1070  }
1071 
1072  if (numOfParents == 2 && NumOfLep == 1 && NumOfNeut == 1 && (MC::isElectron(motherPDG) || abs(motherPDG) == MC::NU_E)) return FSRPhot;
1073 
1074  //-- Exotics - CompHep
1075  if (MC::isElectron(motherPDG) && numOfParents == 1 && numOfDaug == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfPht == 1 &&
1076  !( Daug && info.Mother() && HepMC::is_same_generator_particle(Daug, info.Mother())) && !HepMC::is_simulation_particle(Daug) && !HepMC::is_simulation_particle(info.Mother()))
1077  return FSRPhot;
1078 
1079  // FSR from Photos
1080  if (MC::isZ(motherPDG) && ((NumOfEl + NumOfPos == 2 || NumOfEl + NumOfPos == 4) || (NumOfMu == 2 || NumOfMu == 4) || (NumOfTau == 2 || NumOfTau == 4)) && NumOfPht > 0) return FSRPhot;
1081 
1082  if (NumOfPht > 0 && (abs(motherPDG) == MC::WBOSON_LRSM || MC::isNeutrinoRH(motherPDG))) return FSRPhot; // Left-right symmetric model WBoson || Right-handed neutrinos (Pythia-specific)
1083 
1084  if (numOfParents == 2 && NumOfLQ == 1) return FSRPhot;
1085 
1086  //--- other process
1087 
1088  if (MC::isZ(motherPDG)) return ZBoson;
1089  if (MC::isW(motherPDG)) {
1090 
1091  if (NumOfLep == 1 && NumOfNeut == 1 && numOfDaug == NumOfLep + NumOfNeut + NumOfPht) return FSRPhot;
1092 
1093  if (mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
1094  const xAOD::TruthVertex* prodVert = mothOriVert;
1095  const xAOD::TruthParticle* itrP;
1096  do {
1097  itrP = prodVert->incomingParticle(0);
1098  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
1099  } while (MC::isW(itrP) && prodVert != nullptr);
1100 
1101  if (prodVert && prodVert->nIncomingParticles() == 1 ) {
1102  if ( MC::isTau(itrP)) return TauLep;
1103  if ( MC::isMuon(itrP)) return Mu;
1104  if ( abs(itrP->pdgId()) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
1105  if ( abs(itrP->pdgId()) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
1106  if ( abs(itrP->pdgId()) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
1107  }
1108  } else
1109  return WBoson;
1110  }
1111 
1112  // MadGraphPythia ZWW*->lllnulnu
1113  if (numOfParents == 1 && numOfDaug > 4 && (MC::isSMQuark(motherPDG) || MC::isGluon(motherPDG))) {
1114  bool isZboson = false;
1115  bool isWboson = false;
1116  bool skipnext = false;
1117  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
1118  if (skipnext) {
1119  skipnext = false;
1120  continue;
1121  }
1122  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
1123  if (!theDaug) continue;
1124  const xAOD::TruthParticle* theNextDaug = nullptr;
1125  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
1126  theNextDaug = partOriVert->outgoingParticle(ipOut1);
1127  if (theNextDaug != nullptr) break;
1128  }
1129  if (!theNextDaug) continue;
1130  if (MC::isTau(theDaug) && MC::isTau(theNextDaug)) {
1131  // Zboson
1132  if (thePriPart == theDaug || thePriPart == theNextDaug) {
1133  isZboson = true;
1134  break;
1135  }
1136  skipnext = true;
1137  } else if (MC::isTau(theDaug) && abs(theNextDaug->pdgId()) == MC::NU_TAU) {
1138  // WBoson
1139  if (thePriPart == theDaug || thePriPart == theNextDaug) {
1140  isWboson = true;
1141  break;
1142  }
1143  skipnext = true;
1144  }
1145  }
1146  if (isWboson) return WBoson;
1147  if (isZboson) return ZBoson;
1148  }
1149 
1150  //--Sherpa ZZ,ZW+FSR
1151  if (numOfParents == 4 && (numOfDaug - NumOfPht) == 4 && (NumOfLep + NumOfNeut == 4)) {
1152  if (MC::isSMLepton(partOriVert->incomingParticle(0))&&MC::isSMLepton(partOriVert->incomingParticle(1))
1153  && MC::isSMLepton(partOriVert->incomingParticle(2))&&MC::isSMLepton(partOriVert->incomingParticle(3)))
1154  return FSRPhot;
1155  }
1156 
1157  //--New Sherpa single photon
1158  if (partOriVert == mothOriVert && partOriVert != nullptr) {
1159  int NumOfPhtLoop = 0;
1160  for (const auto *const pout: partOriVert->particles_out()) {
1161  if (!pout) continue;
1162  for (const auto *const pin: partOriVert->particles_in()) {
1163  if (!pin) continue;
1164  if (HepMC::is_same_particle(pout,pin) && MC::isPhoton(pout)) NumOfPhtLoop++;
1165  if (NumOfPhtLoop == 1) return SinglePhot;
1166  }
1167  }
1168  }
1169 
1170  if (MC::isHiggs(motherPDG)) return Higgs;
1171  if (abs(motherPDG) == MC::PI0) return PiZero;
1172  if (MC::isMSSMHiggs(motherPDG)) return HiggsMSSM; // MSSM Higgs bosons
1173  if (MC::isHeavyBoson(motherPDG) || std::abs(motherPDG) == 5100039 ) return HeavyBoson; // Heavy Bosons (Z' Z'' W'+) + KK excited graviton
1174 
1175  if (MC::isSUSY(motherPDG)) return SUSY;
1176  if (MC::isBSM(motherPDG)) return OtherBSM;
1177 
1178  // Pythia8 gamma+jet samples
1179  if (MC::Pythia8::isConditionA(mother) && MC::isStable(thePriPart) && NumOfPht == 1 && numOfDaug == (NumOfPht + NumOfPartons)) return PromptPhot;
1180 
1181  ParticleType pType = defTypeOfHadron(motherPDG);
1182  if ((pType == BBbarMesonPart || pType == CCbarMesonPart) && mothOriVert != nullptr && MC::isHardScatteringVertex(mothOriVert)) isPrompt = true;
1183  return convHadronTypeToOrig(pType, motherPDG);
1184 }

◆ defOrigOfTau()

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

Definition at line 759 of file MCTruthClassifierGen.cxx.

763 {
764  ATH_MSG_DEBUG("Executing DefOrigOfTau ");
765  const xAOD::TruthParticle* thePriPart = MC::findMatching(mcTruthTES, thePart);
766  if (!thePriPart) return NonDefined;
767  if (!MC::isTau(thePriPart)) return NonDefined;
768 
769  const xAOD::TruthVertex* partOriVert = thePriPart->hasProdVtx() ? thePriPart->prodVtx() : nullptr;
770 
771  //-- to define tau outcome status
772  if (MC::isPhysical(thePriPart)) info.particleOutCome = defOutComeOfTau(thePriPart);
773 
774  if (!partOriVert) return NonDefined;
775 
776  int numOfParents = partOriVert->nIncomingParticles();
777  if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfTau:: tau has more than one mother ");
778 
779  const xAOD::TruthParticle* mother = MC::findMother(thePriPart);
780  info.setMotherProperties(mother);
781  if (!mother) {
782  return NonDefined;
783  }
784 
785  const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
786 
787  const xAOD::TruthParticle* MotherParent(nullptr);
788 
789  if (MC::isW(motherPDG) && mothOriVert != nullptr) {
790  MotherParent = MC::findMother(mother);
791  int pPDG(0);
792 
793  if (MotherParent) {//MotherParent checked here...
794  pPDG = MotherParent->pdgId();
795  if (MC::isTop(pPDG)) {
796  mother = MotherParent; //...so mother cannot be nullptr
797  info.setMotherProperties(mother);
798  }
799  }
800  }
801 
802  motherPDG = mother->pdgId();
803  info.setMotherProperties(mother);
804  mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
805  partOriVert = mother->decayVtx();
806  if (!partOriVert) return NonDefined;
807 
808  numOfParents = partOriVert->nIncomingParticles();
809  auto DP = DecayProducts(partOriVert);
810  const int numOfDaug = DP.size();
811  const int NumOfPhot = DP.pd(MC::PHOTON);
812  const int NumOfEl = DP.pd(MC::ELECTRON);
813  const int NumOfPos = DP.pd(MC::POSITRON);
814  const int NumOfElNeut = DP.apd(MC::NU_E);
815  const int NumOfMuNeut = DP.apd(MC::NU_MU);
816  /* const int NumOfLQ = DP.apd(MC::LEPTOQUARK); */
817  const int NumOfquark = DP.apd({MC::DQUARK,MC::UQUARK,MC::SQUARK,MC::CQUARK,MC::BQUARK,MC::TQUARK});
818  const int NumOfgluon = DP.apd(MC::GLUON);
819  const int NumOfMuPl = DP.pd(-MC::MUON);
820  const int NumOfMuMin = DP.pd(MC::MUON);
821  const int NumOfTau = DP.apd(MC::TAU);
822  const int NumOfTauNeut = DP.apd(MC::NU_TAU);
823 
824  if (MC::isTop(motherPDG)) return top;
825  if (MC::isW(motherPDG) && mothOriVert != nullptr && mothOriVert->nIncomingParticles() != 0) {
826  const xAOD::TruthVertex* prodVert = mothOriVert;
827  const xAOD::TruthParticle* itrP;
828  do {
829  itrP = prodVert->incomingParticle(0);
830  prodVert = itrP->hasProdVtx() ? itrP->prodVtx() : nullptr;
831  } while (MC::isW(itrP) && prodVert != nullptr);
832 
833  if (prodVert && prodVert->nIncomingParticles() == 1 ) {
834  if (abs(itrP->pdgId()) == MC::RH_NU_E) return NuREle; // Right-handed NU_E (Pythia-specific)
835  if (abs(itrP->pdgId()) == MC::RH_NU_MU) return NuRMu; // Right-handed NU_MU (Pythia-specific)
836  if (abs(itrP->pdgId()) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
837  }
838  return WBoson;
839  }
840  if (MC::isW(motherPDG)) { return WBoson;}
841  if (MC::isZ(motherPDG)) { return ZBoson;}
842  if (numOfParents == 1 && numOfDaug > 4 && (MC::isSMQuark(motherPDG) || MC::isGluon(motherPDG))) {
843  bool isZboson = false;
844  bool isWboson = false;
845  bool skipnext = false;
846  for (unsigned int ipOut = 0; ipOut + 1 < partOriVert->nOutgoingParticles(); ipOut++) {
847  if (skipnext) {
848  skipnext = false;
849  continue;
850  }
851  const xAOD::TruthParticle* theDaug = partOriVert->outgoingParticle(ipOut);
852  if (!theDaug) continue;
853  const xAOD::TruthParticle* theNextDaug = nullptr;
854  for (unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->nOutgoingParticles(); ipOut1++) {
855  theNextDaug = partOriVert->outgoingParticle(ipOut1);
856  if (theNextDaug != nullptr) break;
857  }
858  if (!theNextDaug) {
859  continue;
860  }
861  if (MC::isTau(theDaug) && MC::isTau(theNextDaug)) {
862  // Zboson
863  if (thePriPart == theDaug || thePriPart == theNextDaug) {
864  isZboson = true;
865  break;
866  }
867  skipnext = true;
868  } else if (MC::isTau(theDaug) && abs(theNextDaug->pdgId()) == MC::NU_TAU) {
869  // WBoson
870  if (thePriPart == theDaug || thePriPart == theNextDaug) {
871  isWboson = true;
872  break;
873  }
874  skipnext = true;
875  }
876  }
877  if (isWboson) return WBoson;
878  if (isZboson) return ZBoson;
879  }
880  if (numOfParents == 2 ) {
881  const int pdg1 = partOriVert->incomingParticle(0)->pdgId();
882  const int pdg2 = partOriVert->incomingParticle(1)->pdgId();
883  //--Sherpa Z->tautau
884  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfTau == 2 && (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return ZBoson;
885 
886  //--Sherpa W->taunu new
887  if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfTau == 1 && NumOfTauNeut == 1) return WBoson;
888 
889  //--Sherpa ZZ,ZW
890  if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
891  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
892  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return DiBoson;
893 
894  //--Sherpa VVV -- Note, have to allow for prompt photon radiation or these get lost
895  if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
896  (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
897  (MC::isQuark(pdg1)||MC::isGluon(pdg1)) && (MC::isQuark(pdg2)||MC::isGluon(pdg2))) return MultiBoson;
898  }
899  // New Sherpa Z->tautau
900  if (partOriVert == mothOriVert) {
901  int NumOfTauLoop = 0;
902  int NumOfTauNeuLoop = 0;
903  int NumOfLepLoop = 0;
904  for ( const auto *const pout: partOriVert->particles_out()) {
905  if (!pout) continue;
906  for (const auto *const pin: partOriVert->particles_in()) {
907  if (!pin) continue;
908  if (!HepMC::is_same_particle(pout,pin)) continue;
909  if (MC::isTau(pout)) NumOfTauLoop++;
910  if (std::abs(pout->pdgId()) == MC::NU_TAU) NumOfTauNeuLoop++;
911  if (MC::isSMLepton(pout)) NumOfLepLoop++;
912  }
913  }
914  if (NumOfTauLoop == 2 && NumOfTauNeuLoop == 0) return ZBoson;
915  if (NumOfTauLoop == 1 && NumOfTauNeuLoop == 1) return WBoson;
916  if ((NumOfTauLoop == 4 && NumOfTauNeuLoop == 0) || (NumOfTauLoop == 3 && NumOfTauNeuLoop == 1) || (NumOfTauLoop == 2 && NumOfTauNeuLoop == 2)) return DiBoson;
917  if (NumOfLepLoop == 4) return DiBoson;
918  }
919 
920  if (MC::isHiggs(motherPDG)) return Higgs;
921  if (MC::isMSSMHiggs(motherPDG)) return HiggsMSSM; // MSSM Higgs bosons
922  if (MC::isHeavyBoson(motherPDG)) return HeavyBoson; // Heavy bosons( Z', Z'', W'+)
923  if (abs(motherPDG) == MC::WBOSON_LRSM) return WBosonLRSM; // Left-right symmetric model WBoson (Pythia-specific)
924  if (abs(motherPDG) == MC::RH_NU_TAU) return NuRTau; // Right-handed NU_TAU (Pythia-specific)
925  if (MC::isSUSY(motherPDG)) return SUSY;
926  if (MC::isBSM(motherPDG)) return OtherBSM;
927  if (abs(motherPDG) == MC::JPSI) return JPsi;
928 
929  ParticleType pType = defTypeOfHadron(motherPDG);
930  return convHadronTypeToOrig(pType, motherPDG);
931 }

◆ detEta()

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

Definition at line 169 of file MCTruthClassifier.h.

◆ detPhi()

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

Definition at line 170 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
finaloverridevirtualinherited

Implements IMCTruthClassifier.

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::findMatching(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::findMatching(truthParticleContainerReadHandle.ptr(), theEgamma);
157  if (info) info->deltaRMatch = LeadingPhtdR;
158  } else if (theLeadingPartInCone != nullptr) {
159  theMatchPart = MC::findMatching(truthParticleContainerReadHandle.ptr(),theLeadingPartInCone);
160  if (info) info->deltaRMatch = LeadingPartdR;
161  } else if (theBestPartOutCone != nullptr) {
162  theMatchPart = MC::findMatching(truthParticleContainerReadHandle.ptr(),theBestPartOutCone);
163  if (info) info->deltaRMatch = BestPartdR;
164  } else if (isFwrdEle && theBestPartdR != nullptr) {
165  theMatchPart = MC::findMatching(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::findMatching(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::findMatching(truthParticleContainerReadHandle.ptr(),theEgamma);
223  if (info) info->deltaRMatch = LeadingPhtdR;
224  } else if (theLeadingPartInCone != nullptr) {
225  theMatchPart = MC::findMatching(truthParticleContainerReadHandle.ptr(),theLeadingPartInCone);
226  if (info) info->deltaRMatch = LeadingPartdR;
227  } else if (theBestPartOutCone != nullptr) {
228  theMatchPart = MC::findMatching(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

◆ findJetConstituents()

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

Definition at line 278 of file MCRecoToTruth.cxx.

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

◆ fracParticleInJet()

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

Definition at line 310 of file MCRecoToTruth.cxx.

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

◆ 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
finaloverridevirtualinherited

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 (theGenParticle->status() == 3) {
225  ATH_MSG_WARNING("track matched to the truth with status " << theGenParticle->status());
226  }
227  else if (MC::isDecayed(theGenParticle)) {
228  // Matching to status == 2 particles is to be expected if
229  // quasi-stable particle simulation was used.
230  ATH_MSG_DEBUG("track matched to the truth with status " << theGenParticle->status());
231  }
232 
233  if (MC::isDecayed(theGenParticle) && (MC::isElectron(theGenParticle) || MC::isMuon(theGenParticle))) {
234  const xAOD::TruthVertex* EndVrtx = theGenParticle->decayVtx();
235  const xAOD::TruthParticle* theGenPartTmp(nullptr);
236 
237  if (EndVrtx != nullptr) {
238  int itr = 0;
239  do {
240  theGenPartTmp = nullptr;
241  for (const auto & theDaugt: EndVrtx->particles_out()) {
242  if (!theDaugt) continue;
243  if (theDaugt->pdgId() == theGenParticle->pdgId()) theGenPartTmp = theDaugt;
244  if (theDaugt->pdgId() != theGenParticle->pdgId() && !MC::isPhoton(theDaugt)) theGenPartTmp = nullptr;
245  }
246  itr++;
247  if (itr > 100) {
248  ATH_MSG_WARNING("getGenPart infinite while");
249  break;
250  }
251  EndVrtx = theGenPartTmp ? theGenPartTmp->decayVtx() : nullptr;
252  } while (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->pdgId() && MC::isDecayed(theGenPartTmp) && EndVrtx != nullptr);
253 
254  if (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->pdgId()) theGenParticle = theGenPartTmp;
255  }
256  }
257 
258  if (!trk->summaryValue(NumOfSCTHits, xAOD::numberOfSCTHits)) ATH_MSG_DEBUG("Could not retrieve number of SCT hits");
259  if (!trk->summaryValue(NumOfPixHits, xAOD::numberOfPixelHits)) ATH_MSG_DEBUG("Could not retrieve number of Pixel hits");
260 
261  uint8_t NumOfSiHits = NumOfSCTHits + NumOfPixHits;
262 
263  float deltaPhi = detPhi(theGenParticle->phi(), trk->phi());
264  float deteta = detEta(theGenParticle->eta(), trk->eta());
265  float deltaRMatch = std::hypot(deltaPhi, deteta);
266  if ((NumOfSiHits > m_NumOfSiHitsCut && deltaRMatch > m_deltaRMatchCut) ||
267  (NumOfSiHits <= m_NumOfSiHitsCut && deltaPhi > m_deltaPhiMatchCut)) theGenParticle = nullptr;
268 
269  if (info) {
270  info->deltaRMatch = deltaRMatch;
271  info->deltaPhi = deltaPhi;
272  info->numOfSiHits = NumOfSiHits;
273  }
274  ATH_MSG_DEBUG("getGenPart succeeded ");
275  return (theGenParticle);
276 }

◆ 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
finaloverride

Definition at line 133 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 162 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 153 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 165 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::findParticleAncestors(thePart, allJetMothers);
151  //AV: probably skip ME particles
152  if (!MC::isPhysical(thePart)) 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
finaloverridevirtualinherited

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::findParticleAncestors(thePart, allJetMothers);
151  //AV: probably skip ME particles
152  if (!MC::isPhysical(thePart)) 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
finaloverride

Definition at line 159 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 156 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 150 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
finaloverridevirtualinherited

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
finaloverride

Definition at line 129 of file MCTruthClassifierGen.cxx.

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

◆ particleTruthClassifier() [19/21]

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

Implements IMCTruthClassifier.

Definition at line 75 of file MCTruthClassifierGen.cxx.

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

◆ particleTruthClassifier() [20/21]

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

Definition at line 136 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  for (const auto *const entry : *truthParticleLinkVecReadHandle) {
57  if (entry->first.isValid() && entry->second.isValid() && HepMC::is_same_particle(entry->first,theGenPart)) {
58  const xAOD::TruthParticle* truthParticle = *entry->second;
59  if (!theGenPart || !truthParticle ||
60  theGenPart->pdg_id() != truthParticle->pdgId() ||
61  theGenPart->status() != truthParticle->status() ||
62  HepMC::is_same_particle(theGenPart,truthParticle)) {
64  "HepMC::GenParticle and xAOD::TruthParticle do not match");
65  return std::make_pair(partType, partOrig);
66  }
67  return particleTruthClassifier(truthParticle, info);
68  }
69  }
70  return std::make_pair(partType, partOrig);
71 }

◆ particleTruthClassifier() [21/21]

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

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  for (const auto *const entry : *truthParticleLinkVecReadHandle) {
57  if (entry->first.isValid() && entry->second.isValid() && HepMC::is_same_particle(entry->first,theGenPart)) {
58  const xAOD::TruthParticle* truthParticle = *entry->second;
59  if (!theGenPart || !truthParticle ||
60  theGenPart->pdg_id() != truthParticle->pdgId() ||
61  theGenPart->status() != truthParticle->status() ||
62  HepMC::is_same_particle(theGenPart,truthParticle)) {
64  "HepMC::GenParticle and xAOD::TruthParticle do not match");
65  return std::make_pair(partType, partOrig);
66  }
67  return particleTruthClassifier(truthParticle, info);
68  }
69  }
70  return std::make_pair(partType, partOrig);
71 }

◆ 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 224 of file MCTruthClassifier.h.

◆ m_caloMgrKey

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

Definition at line 225 of file MCTruthClassifier.h.

◆ m_deltaPhiMatchCut

float MCTruthClassifier::m_deltaPhiMatchCut
privateinherited

Definition at line 252 of file MCTruthClassifier.h.

◆ m_deltaRMatchCut

float MCTruthClassifier::m_deltaRMatchCut
privateinherited

Definition at line 251 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 230 of file MCTruthClassifier.h.

◆ m_FwdElectronTruthExtrEtaWindowCut

float MCTruthClassifier::m_FwdElectronTruthExtrEtaWindowCut
privateinherited

Definition at line 231 of file MCTruthClassifier.h.

◆ m_FwdElectronUseG4Sel

bool MCTruthClassifier::m_FwdElectronUseG4Sel
privateinherited

Definition at line 229 of file MCTruthClassifier.h.

◆ m_fwrdEledRtoTrCut

float MCTruthClassifier::m_fwrdEledRtoTrCut
privateinherited

Definition at line 238 of file MCTruthClassifier.h.

◆ m_inclG4part

bool MCTruthClassifier::m_inclG4part
privateinherited

Definition at line 243 of file MCTruthClassifier.h.

◆ m_jetPartDRMatch

float MCTruthClassifier::m_jetPartDRMatch
privateinherited

Definition at line 254 of file MCTruthClassifier.h.

◆ m_NumOfSiHitsCut

int MCTruthClassifier::m_NumOfSiHitsCut
privateinherited

Definition at line 253 of file MCTruthClassifier.h.

◆ m_partExtrConeEta

float MCTruthClassifier::m_partExtrConeEta
privateinherited

Definition at line 232 of file MCTruthClassifier.h.

◆ m_partExtrConePhi

float MCTruthClassifier::m_partExtrConePhi
privateinherited

Definition at line 233 of file MCTruthClassifier.h.

◆ m_phtClasConeEta

float MCTruthClassifier::m_phtClasConeEta
privateinherited

Definition at line 236 of file MCTruthClassifier.h.

◆ m_phtClasConePhi

float MCTruthClassifier::m_phtClasConePhi
privateinherited

Definition at line 235 of file MCTruthClassifier.h.

◆ m_phtdRtoTrCut

float MCTruthClassifier::m_phtdRtoTrCut
privateinherited

Definition at line 237 of file MCTruthClassifier.h.

◆ m_pTChargePartCut

float MCTruthClassifier::m_pTChargePartCut
privateinherited

Definition at line 241 of file MCTruthClassifier.h.

◆ m_pTNeutralPartCut

float MCTruthClassifier::m_pTNeutralPartCut
privateinherited

Definition at line 242 of file MCTruthClassifier.h.

◆ m_ROICone

bool MCTruthClassifier::m_ROICone
privateinherited

Definition at line 239 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 227 of file MCTruthClassifier.h.

◆ m_truthLinkVecReadHandleKey

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

Definition at line 248 of file MCTruthClassifier.h.

◆ m_truthParticleContainerKey

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

Definition at line 221 of file MCTruthClassifier.h.

◆ m_useCaching

bool MCTruthClassifier::m_useCaching
privateinherited

Definition at line 234 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
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.
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
NuRMu
@ NuRMu
Definition: TruthClasses.h:73
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
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
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
isNucleus
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
Definition: AtlasPID.h:644
HepMC::is_same_vertex
bool is_same_vertex(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same vertex.
Definition: MagicNumbers.h:370
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:231
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:395
isHeavyBoson
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier)
Definition: AtlasPID.h:359
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:59
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
MC::findParticleAncestors
void findParticleAncestors(T thePart, std::set< T > &allancestors)
Function to find all ancestors of the particle.
Definition: HepMCHelpers.h:140
WBosonLRSM
@ WBosonLRSM
Definition: TruthClasses.h:71
columnar::ContainerId::particle0
@ particle0
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
SingleTau
@ SingleTau
Definition: TruthClasses.h:57
MCTruthClassifier::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MCTruthClassifier.h:101
MCTruthClassifier::defOrigOfNeutrino
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
Definition: MCTruthClassifierGen.cxx:1187
isBSM
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition: AtlasPID.h:783
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:278
SG::ReadHandle< xAOD::TruthParticleContainer >
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:236
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
MCTruthClassifier::m_partExtrConeEta
float m_partExtrConeEta
Definition: MCTruthClassifier.h:232
isNeutrino
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition: AtlasPID.h:201
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:859
IsoElectron
@ IsoElectron
Definition: TruthClasses.h:11
SingleElec
@ SingleElec
Definition: TruthClasses.h:54
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
athena.value
value
Definition: athena.py:124
MCTruthClassifier::m_caloExtensionTool
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
Definition: MCTruthClassifier.h:224
MCTruthClassifier::defOrigOfMuon
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
Definition: MCTruthClassifierGen.cxx:526
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:260
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:634
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
MCTruthPartClassifier::defTypeOfElectron
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
Definition: TruthClassifiers.h:61
BottomMesonPart
@ BottomMesonPart
Definition: TruthClasses.h:34
NuRTau
@ NuRTau
Definition: TruthClasses.h:74
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:242
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
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
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:52
HepMC::is_same_particle
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
Definition: MagicNumbers.h:367
StrangeMesonPart
@ StrangeMesonPart
Definition: TruthClasses.h:41
MCTruthClassifier::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Definition: MCTruthClassifier.h:221
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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:183
isSMQuark
bool isSMQuark(const T &p)
Definition: AtlasPID.h:162
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:346
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
isHiggs
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
Definition: AtlasPID.h:363
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
NuclFrag
@ NuclFrag
Definition: TruthClasses.h:28
MCTruthClassifier::defOrigOfPhoton
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
Definition: MCTruthClassifierGen.cxx:933
BBbarMesonPart
@ BBbarMesonPart
Definition: TruthClasses.h:33
MCTruthPartClassifier::defTypeOfMuon
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
Definition: TruthClassifiers.h:80
MCTruthClassifier::defOrigOfTau
MCTruthPartClassifier::ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info &info) const
Definition: MCTruthClassifierGen.cxx:759
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
MCTruthClassifier::m_NumOfSiHitsCut
int m_NumOfSiHitsCut
Definition: MCTruthClassifier.h:253
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:628
MC::isPhysical
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Definition: HepMCHelpers.h:51
CCbarMesonPart
@ CCbarMesonPart
Definition: TruthClasses.h:35
MCTruthClassifier::m_jetPartDRMatch
float m_jetPartDRMatch
Definition: MCTruthClassifier.h:254
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:158
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:62
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:892
TrackParticleTruthCollection::trackParticleContainerLink
DataLink< Rec::TrackParticleContainer > trackParticleContainerLink() const
Definition: TrackParticleTruthCollection.h:26
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MCTruthClassifier::m_FwdElectronTruthExtrEtaCut
float m_FwdElectronTruthExtrEtaCut
Definition: MCTruthClassifier.h:230
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:364
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
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:116
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:355
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:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TruthLink_t
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
Definition: TauxAODHelpers.cxx:7
MC::findMatching
T findMatching(C TruthContainer, T p)
Function to find a particle in container.
Definition: HepMCHelpers.h:127
UnknownElectron
@ UnknownElectron
Definition: TruthClasses.h:10
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:259
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:12
MultiBoson
@ MultiBoson
Definition: TruthClasses.h:101
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:352
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:548
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
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
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition: CaloCluster_v1.h:887
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
MCTruthClassifier::egammaClusMatch
virtual const xAOD::TruthParticle * egammaClusMatch(const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const override final
Definition: MCTruthClassifierAthena.cxx:44
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:248
MC::findParticleStableDescendants
void findParticleStableDescendants(T thePart, std::set< T > &allstabledescendants)
Function to get the particle stable MC daughters.
Definition: HepMCHelpers.h:152
MC::findMother
T findMother(T thePart)
Function to get a mother of particle. MCTruthClassifier legacy.
Definition: HepMCHelpers.h:94
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:69
IsoMuon
@ IsoMuon
Definition: TruthClasses.h:15
StrangeBaryonPart
@ StrangeBaryonPart
Definition: TruthClasses.h:39
MCTruthClassifier::m_phtClasConePhi
float m_phtClasConePhi
Definition: MCTruthClassifier.h:235
MCTruthClassifier::m_partExtrConePhi
float m_partExtrConePhi
Definition: MCTruthClassifier.h:233
CharmedBaryonPart
@ CharmedBaryonPart
Definition: TruthClasses.h:38
MCTruthPartClassifier::defTypeOfHadron
ParticleType defTypeOfHadron(int pdg)
Definition: TruthClassifiers.h:46
isSUSY
bool isSUSY(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:428
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:197
MC::Pythia8::isConditionA
bool isConditionA(const T &p)
To be understood.
Definition: HepMCHelpers.h:23
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
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:37
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:240
SUSY
@ SUSY
Definition: TruthClasses.h:77
HeavyBoson
@ HeavyBoson
Definition: TruthClasses.h:70
MCTruthClassifier::m_inclG4part
bool m_inclG4part
Definition: MCTruthClassifier.h:243
isHadron
bool isHadron(const T &p)
Definition: AtlasPID.h:324
isNeutrinoRH
bool isNeutrinoRH(const T &p)
PDG Rule 12: APID: Helper function for right-handed neutrino states These are generator defined PDG I...
Definition: AtlasPID.h:393
xAOD::TruthVertex_v1::particles_out
std::vector< const TruthParticle * > particles_out() const
Get the outgoing particles.
Definition: TruthVertex_v1.cxx:64
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
NucReact
@ NucReact
Definition: TruthClasses.h:97
NonInteract
@ NonInteract
Definition: TruthClasses.h:110
MCTruthClassifier::defOrigOfElectron
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
Definition: MCTruthClassifierGen.cxx:225
MCTruthClassifier::MCTruthClassifier
MCTruthClassifier(const std::string &type)
Definition: MCTruthClassifier.h:65
QuarkWeakDec
@ QuarkWeakDec
Definition: TruthClasses.h:65
MCTruthClassifier::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: MCTruthClassifier.h:225
isW
bool isW(const T &p)
Definition: AtlasPID.h:355
xAOD::TruthParticle_v1::status
int status() const
Status code.
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:514
SUSYParticle
@ SUSYParticle
Definition: TruthClasses.h:31
a
TList * a
Definition: liststreamerinfos.cxx:10
isTop
bool isTop(const T &p)
Definition: AtlasPID.h:175
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 point B' along the line B that's closest to a second line A.
Definition: GeoPrimitivesHelpers.h:347
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:47
MC::isDecayed
bool isDecayed(const T &p)
Identify if the particle decayed.
Definition: HepMCHelpers.h:42
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:21
TrackParticleTruthCollection
Definition: TrackParticleTruthCollection.h:18
MC::isBeam
bool isBeam(const T &p)
Identify if the particle is beam particle.
Definition: HepMCHelpers.h:39
MCTruthClassifier::m_deltaRMatchCut
float m_deltaRMatchCut
Definition: MCTruthClassifier.h:251
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:252
MCTruthPartClassifier::defJetOrig
ParticleOrigin defJetOrig(const T &allJetMothers)
Definition: TruthClassifiers.h:131
isSMNeutrino
bool isSMNeutrino(const T &p)
Definition: AtlasPID.h:204
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
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
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:269
MCTruthClassifier::m_pTChargePartCut
float m_pTChargePartCut
Definition: MCTruthClassifier.h:241
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:227
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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:537
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 final
Definition: MCTruthClassifierGen.cxx:75
MCTruthClassifier::m_FwdElectronUseG4Sel
bool m_FwdElectronUseG4Sel
Definition: MCTruthClassifier.h:229
SG::DataProxy
Definition: DataProxy.h:45
ParticleType
ParticleType
Definition: TruthClasses.h:8
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
MCTruthClassifier::m_fwrdEledRtoTrCut
float m_fwrdEledRtoTrCut
Definition: MCTruthClassifier.h:238
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:119
MCTruthClassifier::detEta
double detEta(double x, double y) const
Definition: MCTruthClassifier.h:169
MCTruthClassifier::m_ROICone
bool m_ROICone
Definition: MCTruthClassifier.h:239
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
isMSSMHiggs
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier)
Definition: AtlasPID.h:367
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
MC::isHardScatteringVertex
bool isHardScatteringVertex(T pVert)
Function to classify the vertex as hard scattering vertex.
Definition: HepMCHelpers.h:168
MCTruthClassifier::m_phtdRtoTrCut
float m_phtdRtoTrCut
Definition: MCTruthClassifier.h:237
MCTruthClassifier::detPhi
double detPhi(double x, double y) const
Definition: MCTruthClassifier.h:170
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:194
isLeptoQuark
bool isLeptoQuark(const T &p)
PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.
Definition: AtlasPID.h:381
MCTruthClassifier::getGenPart
virtual const xAOD::TruthParticle * getGenPart(const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
Definition: MCRecoToTruth.cxx:181