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

#include <MCTruthClassifier.h>

Inheritance diagram for MCTruthClassifier:
Collaboration diagram for MCTruthClassifier:

Public Member Functions

 MCTruthClassifier (const std::string &type)
 
virtual ~MCTruthClassifier ()=default
 
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. 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 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 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 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

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

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

Definition at line 55 of file MCTruthClassifier.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

◆ MCTruthClassifier()

MCTruthClassifier::MCTruthClassifier ( const std::string &  type)
inline

Definition at line 65 of file MCTruthClassifier.h.

96  {
97  ATH_MSG_INFO(" Initializing MCTruthClassifier");

◆ ~MCTruthClassifier()

virtual MCTruthClassifier::~MCTruthClassifier ( )
virtualdefault

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
private

Definition at line 226 of file MCTruthClassifierGen.cxx.

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

◆ defOrigOfMuon()

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

Definition at line 531 of file MCTruthClassifierGen.cxx.

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

◆ defOrigOfNeutrino()

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

Definition at line 1203 of file MCTruthClassifierGen.cxx.

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

◆ defOrigOfPhoton()

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

Definition at line 944 of file MCTruthClassifierGen.cxx.

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

◆ defOrigOfTau()

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

Definition at line 767 of file MCTruthClassifierGen.cxx.

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

◆ detEta()

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

Definition at line 169 of file MCTruthClassifier.h.

◆ detPhi()

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

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
finaloverridevirtual

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
private

Definition at line 273 of file MCRecoToTruth.cxx.

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

◆ fracParticleInJet()

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

Definition at line 305 of file MCRecoToTruth.cxx.

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

◆ genPartToCalo()

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

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 }

◆ getGenPart()

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

Implements IMCTruthClassifier.

Definition at line 181 of file MCRecoToTruth.cxx.

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

◆ getKey()

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

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

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

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

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

Definition at line 119 of file AsgTool.cxx.

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

◆ getName()

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

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

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

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

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

Definition at line 106 of file AsgTool.cxx.

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

◆ getProperty()

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

Get one of the tool's properties.

◆ initialize()

virtual StatusCode MCTruthClassifier::initialize ( )
inlineoverridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Reimplemented in D3PD::D3PDMCTruthClassifier.

Definition at line 101 of file MCTruthClassifier.h.

107  {
108  ATH_CHECK(m_caloExtensionTool.retrieve());
109  } else {
110  m_caloExtensionTool.disable();
111  }
112 
114 
115  if (!m_truthInConeTool.empty()) {
116  ATH_CHECK(m_truthInConeTool.retrieve());
117  } else {
118  m_truthInConeTool.disable();
119  }
120 #endif
121  return StatusCode::SUCCESS;
122  }
123  virtual std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin>
125 
126 #ifndef XAOD_ANALYSIS /*These can not run in Analysis Base*/
127  virtual std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin>

◆ 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/9]

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

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() [2/9]

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

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() [3/9]

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

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() [4/9]

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

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() [5/9]

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

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() [6/9]

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

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() [7/9]

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

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() [8/9]

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

Implements IMCTruthClassifier.

Definition at line 75 of file MCTruthClassifierGen.cxx.

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

◆ particleTruthClassifier() [9/9]

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

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  }

◆ 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",""}
private

Definition at line 224 of file MCTruthClassifier.h.

◆ m_caloMgrKey

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

Definition at line 225 of file MCTruthClassifier.h.

◆ m_deltaPhiMatchCut

float MCTruthClassifier::m_deltaPhiMatchCut
private

Definition at line 252 of file MCTruthClassifier.h.

◆ m_deltaRMatchCut

float MCTruthClassifier::m_deltaRMatchCut
private

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
private

Definition at line 230 of file MCTruthClassifier.h.

◆ m_FwdElectronTruthExtrEtaWindowCut

float MCTruthClassifier::m_FwdElectronTruthExtrEtaWindowCut
private

Definition at line 231 of file MCTruthClassifier.h.

◆ m_FwdElectronUseG4Sel

bool MCTruthClassifier::m_FwdElectronUseG4Sel
private

Definition at line 229 of file MCTruthClassifier.h.

◆ m_fwrdEledRtoTrCut

float MCTruthClassifier::m_fwrdEledRtoTrCut
private

Definition at line 238 of file MCTruthClassifier.h.

◆ m_inclG4part

bool MCTruthClassifier::m_inclG4part
private

Definition at line 243 of file MCTruthClassifier.h.

◆ m_jetPartDRMatch

float MCTruthClassifier::m_jetPartDRMatch
private

Definition at line 254 of file MCTruthClassifier.h.

◆ m_NumOfSiHitsCut

int MCTruthClassifier::m_NumOfSiHitsCut
private

Definition at line 253 of file MCTruthClassifier.h.

◆ m_partExtrConeEta

float MCTruthClassifier::m_partExtrConeEta
private

Definition at line 232 of file MCTruthClassifier.h.

◆ m_partExtrConePhi

float MCTruthClassifier::m_partExtrConePhi
private

Definition at line 233 of file MCTruthClassifier.h.

◆ m_phtClasConeEta

float MCTruthClassifier::m_phtClasConeEta
private

Definition at line 236 of file MCTruthClassifier.h.

◆ m_phtClasConePhi

float MCTruthClassifier::m_phtClasConePhi
private

Definition at line 235 of file MCTruthClassifier.h.

◆ m_phtdRtoTrCut

float MCTruthClassifier::m_phtdRtoTrCut
private

Definition at line 237 of file MCTruthClassifier.h.

◆ m_pTChargePartCut

float MCTruthClassifier::m_pTChargePartCut
private

Definition at line 241 of file MCTruthClassifier.h.

◆ m_pTNeutralPartCut

float MCTruthClassifier::m_pTNeutralPartCut
private

Definition at line 242 of file MCTruthClassifier.h.

◆ m_ROICone

bool MCTruthClassifier::m_ROICone
private

Definition at line 239 of file MCTruthClassifier.h.

◆ m_truthInConeTool

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

Definition at line 227 of file MCTruthClassifier.h.

◆ m_truthLinkVecReadHandleKey

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

Definition at line 248 of file MCTruthClassifier.h.

◆ m_truthParticleContainerKey

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

Definition at line 221 of file MCTruthClassifier.h.

◆ m_useCaching

bool MCTruthClassifier::m_useCaching
private

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
MCTruthClassifier::defOrigOfNeutrino
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:1203
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
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
TauLep
@ TauLep
Definition: TruthClasses.h:63
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:392
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
SingleTau
@ SingleTau
Definition: TruthClasses.h:57
isBSM
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition: AtlasPID.h:591
PionDecay
@ PionDecay
Definition: TruthClasses.h:90
MCTruthClassifier::findJetConstituents
void findJetConstituents(const xAOD::Jet *, std::set< const xAOD::TruthParticle * > &constituents, bool DR) const
Definition: MCRecoToTruth.cxx:273
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MCTruthPartClassifier::defOutComeOfTau
ParticleOutCome defOutComeOfTau(T thePart)
Definition: TruthClassifiers.h:240
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
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:177
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
IsoElectron
@ IsoElectron
Definition: TruthClasses.h:11
SingleElec
@ SingleElec
Definition: TruthClasses.h:54
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
MCTruthClassifier::m_caloExtensionTool
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
Definition: MCTruthClassifier.h:224
CharmedMesonPart
@ CharmedMesonPart
Definition: TruthClasses.h:36
ISRPhot
@ ISRPhot
Definition: TruthClasses.h:95
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::Electron_v1::trackParticle
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Definition: Electron_v1.cxx:55
PromptPhot
@ PromptPhot
Definition: TruthClasses.h:93
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
MCTruthPartClassifier::defTypeOfElectron
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
Definition: TruthClassifiers.h:61
BottomMesonPart
@ BottomMesonPart
Definition: TruthClasses.h:34
NuRTau
@ NuRTau
Definition: TruthClasses.h:74
MCTruthClassifier::defOrigOfElectron
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:226
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
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
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
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:159
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:322
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
NuclFrag
@ NuclFrag
Definition: TruthClasses.h:28
BBbarMesonPart
@ BBbarMesonPart
Definition: TruthClasses.h:33
MCTruthPartClassifier::defTypeOfMuon
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
Definition: TruthClassifiers.h:80
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
MCTruthClassifier::m_NumOfSiHitsCut
int m_NumOfSiHitsCut
Definition: MCTruthClassifier.h: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:644
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:134
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Neutrino
@ Neutrino
Definition: TruthClasses.h:27
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
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
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
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
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
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:328
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:538
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:896
DiBoson
@ DiBoson
Definition: TruthClasses.h:99
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
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::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:388
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:173
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.
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
BottomBaryonPart
@ BottomBaryonPart
Definition: TruthClasses.h:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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:300
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
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
QuarkWeakDec
@ QuarkWeakDec
Definition: TruthClasses.h:65
MCTruthClassifier::defOrigOfMuon
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:531
MCTruthClassifier::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: MCTruthClassifier.h:225
isW
bool isW(const T &p)
Definition: AtlasPID.h:331
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:521
SUSYParticle
@ SUSYParticle
Definition: TruthClasses.h:31
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the 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
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
MCTruthClassifier::defOrigOfTau
MCTruthPartClassifier::ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:767
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
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:268
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:527
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
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
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
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::defOrigOfPhoton
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info *info) const
Definition: MCTruthClassifierGen.cxx:944
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:170
MCTruthClassifier::getGenPart
virtual const xAOD::TruthParticle * getGenPart(const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
Definition: MCRecoToTruth.cxx:181