Loading [MathJax]/jax/input/TeX/config.js
 |
ATLAS Offline Software
|
Work around MCTruthClassifier brain-damage.
More...
#include <D3PDMCTruthClassifier.h>
|
| D3PDMCTruthClassifier (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard Gaudi tool constructor. More...
|
|
virtual StatusCode | initialize () |
| Standard Gaudi initialize method. More...
|
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Electron *el) |
| Run the classifier for an electron. More...
|
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Photon *el) |
| Run the classifier for a photon. More...
|
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Muon *mu) |
| Run the classifier for a muon. More...
|
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (HepMC::ConstGenParticlePtr, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Electron *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Photon *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Muon *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::CaloCluster *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > | particleTruthClassifier (const xAOD::Jet *, bool DR, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual const xAOD::TruthParticle * | getGenPart (const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final |
|
virtual const xAOD::TruthParticle * | egammaClusMatch (const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const override final |
|
virtual void | print () const =0 |
| Print the state of the tool. More...
|
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
bool | get_tptruth_name (const std::string &tp_name, std::string &tptruth_name) |
| Try to find a TrackParticleTruthCollection pointing at TP_NAME. More...
|
|
void | getProperty1 (const std::string &pname, std::string &value) |
| Helper to retrieve the value of a Gaudi property. More...
|
|
void | setProperty1 (const std::string &pname, const std::string &value) |
| Helper to set the value of a Gaudi property. More...
|
|
double | detEta (double x, double y) const |
|
double | detPhi (double x, double y) const |
|
MCTruthPartClassifier::ParticleOrigin | defOrigOfElectron (const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const |
|
MCTruthPartClassifier::ParticleOrigin | defOrigOfMuon (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const |
|
MCTruthPartClassifier::ParticleOrigin | defOrigOfTau (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info &info) const |
|
MCTruthPartClassifier::ParticleOrigin | defOrigOfPhoton (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const |
|
MCTruthPartClassifier::ParticleOrigin | defOrigOfNeutrino (const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const |
|
bool | genPartToCalo (const EventContext &ctx, const xAOD::CaloCluster *clus, const xAOD::TruthParticle *thePart, bool isFwrdEle, double &dRmatch, bool &isNarrowCone, const CaloDetDescrManager &caloDDMgr) const |
|
double | fracParticleInJet (const xAOD::TruthParticle *, const xAOD::Jet *, bool DR, bool nparts) const |
|
void | findJetConstituents (const xAOD::Jet *, std::set< const xAOD::TruthParticle * > &constituents, bool DR) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
ServiceHandle< StoreGateSvc > | m_sg |
| The StoreGate service. More...
|
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthParticleContainerKey {this,"xAODTruthParticleContainerName","TruthParticles","ReadHandleKey for xAOD::TruthParticleContainer"} |
|
ToolHandle< Trk::IParticleCaloExtensionTool > | m_caloExtensionTool {this,"ParticleCaloExtensionTool",""} |
|
SG::ReadCondHandleKey< CaloDetDescrManager > | m_caloMgrKey {this,"CaloDetDescrManager",""} |
|
ToolHandle< xAOD::ITruthParticlesInConeTool > | m_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< xAODTruthParticleLinkVector > | m_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 |
|
Work around MCTruthClassifier brain-damage.
This avoids having to specify the container names during configuration.
MCTruthClassifier requires specifying, at configuration time, the names of the TrackParticleContainer and TrackParticleTruthCollection objects to use for the mapping. This is painful in for electrons in the case where one may have several different track containers.
What we do to make this easier is to search through SG to find a truth collection that points at the TrackParticleContainer that contains the tracks for the electron we're looking at.
Definition at line 41 of file D3PDMCTruthClassifier.h.
◆ StoreGateSvc_t
◆ D3PDMCTruthClassifier()
D3PD::D3PDMCTruthClassifier::D3PDMCTruthClassifier |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ defOrigOfElectron()
Definition at line 225 of file MCTruthClassifierGen.cxx.
243 int numOfParents = -1;
245 if (numOfParents > 1)
ATH_MSG_DEBUG(
"DefOrigOfElectron:: electron has more than one mother ");
248 info.setMotherProperties(mother);
252 int motherPDG = mother->
pdgId();
253 info.setMotherProperties(mother);
256 bool samePart =
false;
258 if (!theDaug)
continue;
282 parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() :
nullptr;
283 parent_endVtx = MotherParent->decayVtx();
285 if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
286 MotherParent = mother;
290 if (MotherParent) pPDG = MotherParent->
pdgId();
292 if (mother == MotherParent)
break;
301 mother = MotherParent;
304 motherPDG = mother->
pdgId();
310 info.setMotherProperties(mother);
328 if (!theDaug)
continue;
329 int DaugType = theDaug->pdgId();
332 else if (abs(DaugType) == MC::NU_E) NumOfElNeut++;
333 else if (abs(DaugType) == MC::NU_MU) NumOfMuNeut++;
335 else if (DaugType == MC::ELECTRON) NumOfEl++;
336 else if (DaugType == MC::POSITRON) NumOfPos++;
337 else if (DaugType == MC::MUON) NumOfMuMin++;
338 else if (DaugType == -MC::MUON) NumOfMuPl++;
339 else if (
MC::isTau(DaugType)) NumOfTau++;
340 else if (abs(DaugType) == MC::NU_TAU) NumOfTauNeut++;
343 if (numOfParents == 1 &&
345 (
MC::isNucleus(DaugType) || DaugType == 0 || DaugType == MC::PROTON || DaugType == MC::NEUTRON ||
346 abs(DaugType) == MC::PIPLUS || abs(DaugType) == MC::PI0))
350 if (
MC::isPhoton(motherPDG) && mothOriVert !=
nullptr) {
351 for (
const auto& theMother: mothOriVert->
particles_in()) {
352 if (!theMother)
continue;
353 info.photonMother = theMother;
357 if ((
MC::isPhoton(motherPDG) && numOfDaug == 2 && NumOfEl == 1 && NumOfPos == 1) || (
MC::isPhoton(motherPDG) && numOfDaug == 1 && (NumOfEl == 1 || NumOfPos == 1)))
return PhotonConv;
362 if (numOfParents == 1 && abs(motherPDG) == MC::PIPLUS && numOfDaug > 2 && NumOfNucFr != 0)
return ElMagProc;
371 if (motherPDG == MC::ELECTRON && numOfDaug == 2 && NumOfEl == 2 && NumOfPos == 0)
return ElMagProc;
374 if (motherPDG == MC::POSITRON && numOfDaug == 2 && NumOfEl == 0 && NumOfPos == 2)
return ElMagProc;
381 if (numOfDaug == 2 && (NumOfEl == 1 || NumOfPos == 1) && !
MC::isElectron(motherPDG) && samePart)
return ElMagProc;
383 if ((motherPDG == MC::PI0 && numOfDaug == 3 && NumOfPhot == 1 && NumOfEl == 1 && NumOfPos == 1) ||
384 (motherPDG == MC::PI0 && numOfDaug == 4 && NumOfPhot == 0 && NumOfEl == 2 && NumOfPos == 2))
388 if (
MC::isSMQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && NumOfElNeut == 1)
return QuarkWeakDec;
401 }
while (
MC::isW(ptrPart) && prodVert !=
nullptr);
404 if (abs(ptrPart->
pdgId()) == MC::RH_NU_E)
return NuREle;
405 if (abs(ptrPart->
pdgId()) == MC::RH_NU_MU)
return NuRMu;
406 if (abs(ptrPart->
pdgId()) == MC::RH_NU_TAU)
return NuRTau;
420 bool isZboson =
false;
421 bool isWboson =
false;
422 bool skipnext =
false;
424 for (
unsigned int ipOut = 0; ipOut + 1 < partOriVert->
nOutgoingParticles(); ++ipOut) {
426 if (!theDaug)
continue;
428 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->
nOutgoingParticles(); ipOut1++) {
430 if (theNextDaug !=
nullptr)
break;
432 if (!theNextDaug)
continue;
440 if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
447 if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
454 if (isWboson)
return WBoson;
455 if (isZboson)
return ZBoson;
457 if (numOfParents == 2) {
461 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfEl == 1 && NumOfPos == 1)
return ZBoson;
464 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1)
return WBoson;
467 if ((numOfDaug - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
471 if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
476 if (partOriVert == mothOriVert && partOriVert !=
nullptr) {
477 int NumOfEleLoop = 0;
478 int NumOfLepLoop = 0;
479 int NumOfEleNeuLoop = 0;
482 for (
const auto *
const pin: partOriVert->
particles_in()) {
486 if (std::abs(pin->pdgId()) == MC::NU_E) NumOfEleNeuLoop++;
490 if (NumOfEleLoop == 2 && NumOfEleNeuLoop == 0)
return ZBoson;
491 if (NumOfEleLoop == 1 && NumOfEleNeuLoop == 1)
return WBoson;
492 if ((NumOfEleLoop == 4 && NumOfEleNeuLoop == 0) || (NumOfEleLoop == 3 && NumOfEleNeuLoop == 1) ||
493 (NumOfEleLoop == 2 && NumOfEleNeuLoop == 2))
495 if (NumOfLepLoop == 4)
return DiBoson;
513 if (abs(motherPDG) == MC::WBOSON_LRSM)
return WBosonLRSM;
514 if (abs(motherPDG) == MC::RH_NU_E)
return NuREle;
515 if (abs(motherPDG) == MC::RH_NU_MU)
return NuRMu;
516 if (abs(motherPDG) == MC::RH_NU_TAU)
return NuRTau;
◆ defOrigOfMuon()
Definition at line 526 of file MCTruthClassifierGen.cxx.
545 if (numOfParents > 1)
ATH_MSG_DEBUG(
"DefOrigOfMuon:: muon has more than one mother ");
548 info.setMotherProperties(mother);
554 int motherPDG = mother->
pdgId();
556 if ((
MC::isTau(motherPDG)||
MC::isW(motherPDG)) && mothOriVert !=
nullptr) {
573 parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() :
nullptr;
574 parent_endVtx = MotherParent->decayVtx();
577 if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
578 MotherParent = mother;
583 if (mother == MotherParent) {
588 pPDG = MotherParent->
pdgId();
590 mother = MotherParent;
591 info.setMotherProperties(mother);
600 info.setMotherProperties(mother);
604 motherPDG = mother->
pdgId();
610 info.setMotherProperties(mother);
611 auto DP = DecayProducts(partOriVert);
612 const int NumOfPhot = DP.pd(MC::PHOTON);
613 const int NumOfEl = DP.pd(MC::ELECTRON);
614 const int NumOfPos = DP.pd(MC::POSITRON);
615 const int NumOfElNeut = DP.apd(MC::NU_E);
616 const int NumOfMuNeut = DP.apd(MC::NU_MU);
617 const int NumOfLQ = DP.apd(MC::LEPTOQUARK);
618 const int NumOfquark = DP.apd({MC::DQUARK,MC::UQUARK,MC::SQUARK,MC::CQUARK,MC::BQUARK,MC::TQUARK});
619 const int NumOfgluon = DP.apd(MC::GLUON);
620 const int NumOfMuPl = DP.pd(-MC::MUON);
621 const int NumOfMuMin = DP.pd(MC::MUON);
622 const int NumOfTau = DP.apd(MC::TAU);
623 const int NumOfTauNeut = DP.apd(MC::NU_TAU);
624 if (std::abs(motherPDG) == MC::PIPLUS && numOfDaug == 2 && NumOfMuNeut == 1)
return PionDecay;
625 if (std::abs(motherPDG) == MC::KPLUS && numOfDaug == 2 && NumOfMuNeut == 1)
return KaonDecay;
634 if (
MC::isSMQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && NumOfMuNeut == 1)
return QuarkWeakDec;
642 }
while (
MC::isW(itrP) && prodVert !=
nullptr);
645 if (abs(itrP->
pdgId()) == MC::RH_NU_E)
return NuREle;
646 if (abs(itrP->
pdgId()) == MC::RH_NU_MU)
return NuRMu;
647 if (abs(itrP->
pdgId()) == MC::RH_NU_TAU)
return NuRTau;
659 bool isZboson =
false;
660 bool isWboson =
false;
661 bool skipnext =
false;
662 for (
unsigned int ipOut = 0; ipOut + 1 < partOriVert->
nOutgoingParticles(); ipOut++) {
668 if (!theDaug)
continue;
670 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->
nOutgoingParticles(); ipOut1++) {
672 if (theNextDaug !=
nullptr)
break;
674 if (!theNextDaug)
continue;
677 if (thePriPart == theDaug || thePriPart == theNextDaug) {
682 }
else if (
MC::isMuon(theDaug) && abs(theNextDaug->
pdgId()) == MC::NU_MU) {
684 if (thePriPart == theDaug || thePriPart == theNextDaug) {
691 if (isWboson)
return WBoson;
692 if (isZboson)
return ZBoson;
694 if (numOfParents == 2 ) {
698 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfMuPl == 1 && NumOfMuMin == 1)
return ZBoson;
702 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1)
return WBoson;
705 if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
706 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
710 if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
711 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
716 if (partOriVert == mothOriVert) {
718 int NumOfMuNeuLoop = 0;
719 int NumOfLepLoop = 0;
726 if (std::abs(
pout->pdg_id()) == MC::NU_MU) NumOfMuNeuLoop++;
731 if (NumOfMuLoop == 2 && NumOfMuNeuLoop == 0)
return ZBoson;
732 if (NumOfMuLoop == 1 && NumOfMuNeuLoop == 1)
return WBoson;
733 if ((NumOfMuLoop == 4 && NumOfMuNeuLoop == 0) || (NumOfMuLoop == 3 && NumOfMuNeuLoop == 1) || (NumOfMuLoop == 2 && NumOfMuNeuLoop == 2))
return DiBoson;
734 if (NumOfLepLoop == 4)
return DiBoson;
745 if (abs(motherPDG) == MC::WBOSON_LRSM)
return WBosonLRSM;
746 if (abs(motherPDG) == MC::RH_NU_E)
return NuREle;
747 if (abs(motherPDG) == MC::RH_NU_MU)
return NuRMu;
748 if (abs(motherPDG) == MC::RH_NU_TAU)
return NuRTau;
◆ defOrigOfNeutrino()
Definition at line 1187 of file MCTruthClassifierGen.cxx.
1194 const int nuFlav = abs(thePart->
pdgId());
1206 int numOfParents = -1;
1208 if (numOfParents > 1)
ATH_MSG_DEBUG(
"DefOrigOfNeutrino:: neutrino has more than one mother ");
1211 info.mother = mother;
1213 int motherPDG = mother->
pdgId();
1217 bool samePart =
false;
1220 if ((abs(motherPDG) == nuFlav ||
MC::isTau(motherPDG) ||
MC::isW(motherPDG)) && mothOriVert !=
nullptr &&
1232 mother_endVtx = mother->
decayVtx();
1237 parent_prdVtx = MotherParent->hasProdVtx() ? MotherParent->prodVtx() :
nullptr;
1238 parent_endVtx = MotherParent->decayVtx();
1240 if (mother_endVtx == parent_prdVtx && mother_prdVtx == parent_endVtx) {
1241 MotherParent = mother;
1246 pPDG = MotherParent->
pdgId();
1249 if (mother == MotherParent) {
1253 mother = MotherParent;
1254 info.setMotherProperties(mother);
1263 mother = MotherParent;
1264 info.setMotherProperties(mother);
1270 motherPDG = mother->
pdgId();
1276 info.setMotherProperties(mother);
1284 int NumOfTauNeut(0);
1291 if (!theDaug)
continue;
1292 int DaugType = theDaug->pdgId();
1295 else if (abs(DaugType) == MC::NU_E) NumOfElNeut++;
1296 else if (std::abs(DaugType) == MC::NU_MU) NumOfMuNeut++;
1297 else if (std::abs(DaugType) == MC::NU_TAU) NumOfTauNeut++;
1301 else if (
MC::isTau(DaugType)) NumOfTau++;
1307 if (
MC::isQuark(motherPDG) && numOfParents == 1 && numOfDaug == 3 && NumOfquark == 1 && (NumOfEl == 1 || NumOfMu == 1 || NumOfTau == 1))
return QuarkWeakDec;
1316 }
while (
MC::isW(ptrPart) && prodVert !=
nullptr);
1319 if (abs(ptrPart->
pdgId()) == MC::RH_NU_E)
return NuREle;
1320 if (abs(ptrPart->
pdgId()) == MC::RH_NU_MU)
return NuRMu;
1321 if (abs(ptrPart->
pdgId()) == MC::RH_NU_TAU)
return NuRTau;
1337 bool isZboson =
false;
1338 bool isWboson =
false;
1339 bool skipnext =
false;
1341 for (
unsigned int ipOut = 0; ipOut + 1 < partOriVert->
nOutgoingParticles(); ++ipOut) {
1343 if (!theDaug)
continue;
1345 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->
nOutgoingParticles(); ipOut1++) {
1347 if (theNextDaug !=
nullptr)
break;
1349 if (!theNextDaug)
continue;
1356 const int apdgID1 = abs(theDaug->
pdgId());
1357 const int apdgID2 = abs(theNextDaug->
pdgId());
1360 if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1365 }
else if ((apdgID1 == MC::ELECTRON && apdgID2 == MC::NU_E) ||
1366 (apdgID1 == MC::NU_E && apdgID2 == MC::ELECTRON) ||
1367 (apdgID1 == MC::MUON && apdgID2 == MC::NU_MU) ||
1368 (apdgID1 == MC::NU_MU && apdgID2 == MC::MUON) ||
1369 (apdgID1 == MC::TAU && apdgID2 == MC::NU_TAU) ||
1370 (apdgID1 == MC::NU_TAU && apdgID2 == MC::TAU)
1373 if (thePartToCheck == theDaug || thePartToCheck == theNextDaug) {
1380 if (isWboson)
return WBoson;
1381 if (isZboson)
return ZBoson;
1384 if (numOfParents == 2) {
1388 if ( (numOfDaug - NumOfquark - NumOfgluon) == 2 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2))
return ZBoson;
1391 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && ((NumOfEl == 1 && NumOfElNeut == 1) || (NumOfMu == 1 && NumOfMuNeut == 1) || (NumOfTau == 1 && NumOfTauNeut == 1)))
return WBoson;
1394 if ( (numOfDaug - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
1398 if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
1403 if (partOriVert == mothOriVert && partOriVert !=
nullptr) {
1404 int NumOfLepLoop = 0;
1405 int NumOfNeuLoop = 0;
1407 if (!
pout)
continue;
1408 for (
const auto *
const pin: partOriVert->
particles_in()) {
1411 const int apdgid = abs(
pout->pdgId());
1414 else { NumOfLepLoop++; }
1418 if (NumOfNeuLoop == 2 && NumOfLepLoop == 0)
return ZBoson;
1419 if (NumOfNeuLoop == 1 && NumOfLepLoop == 1)
return WBoson;
1420 if (NumOfNeuLoop + NumOfLepLoop == 4)
return DiBoson;
1435 if (abs(motherPDG) == MC::WBOSON_LRSM)
return WBosonLRSM;
1436 if (abs(motherPDG) == MC::RH_NU_E)
return NuREle;
1437 if (abs(motherPDG) == MC::RH_NU_MU)
return NuRMu;
1438 if (abs(motherPDG) == MC::RH_NU_TAU)
return NuRTau;
◆ defOrigOfPhoton()
Definition at line 933 of file MCTruthClassifierGen.cxx.
942 info.resetMotherProperties();
943 info.photonMother =
nullptr;
960 info.setMotherProperties(mother);
962 int motherPDG = mother->
pdgId();
964 info.setMotherProperties(mother);
978 long NumOfPartons(0);
982 DaugType =
pout->pdg_id();
984 (
MC::isNucleus(DaugType) || DaugType == 0 || DaugType == MC::PROTON || DaugType == MC::NEUTRON))
986 if (DaugType == MC::PHOTON) NumOfPht++;
987 else if (DaugType == MC::ELECTRON) NumOfEl++;
988 else if (DaugType == MC::POSITRON) NumOfPos++;
990 else if (
MC::isTau(DaugType)) NumOfTau++;
993 else if (abs(DaugType) == MC::NU_E || abs(DaugType) == MC::NU_MU || abs(DaugType) == MC::NU_TAU) NumOfNeut++;
994 if (abs(DaugType) < MC::ELECTRON || (abs(DaugType) > MC::NU_TAU && abs(DaugType) < 43 && !
MC::isPhoton(DaugType))) NumOfPartons++;
995 if (DaugType == motherPDG) {
1000 bool foundISR =
false;
1001 bool foundFSR =
false;
1017 PartPDG = abs(pin->pdgId());
1018 prodVert = pin->prodVtx();
1026 }
while (prodVert !=
nullptr && abs(motherPDG) == PartPDG);
1037 (numOfParents == 1 && abs(motherPDG) == MC::PIPLUS && numOfDaug > 10 && NumOfNucFr != 0) ||
1039 (numOfParents == 1 &&
MC::isNucleus(motherPDG) && std::abs(motherPDG) != MC::PROTON))
1052 if (!
pout)
continue;
1053 if (motherPDG !=
pout->pdgId())
continue;
1055 if (!Vrtx)
continue;
1068 if (numOfParents == 2 && ((
MC::isElectron(motherPDG) && NumOfEl == 1 && NumOfPos == 1) || (
MC::isMuon(motherPDG) && NumOfMu == 2) || (
MC::isTau(motherPDG) && NumOfTau == 2))) {
1072 if (numOfParents == 2 && NumOfLep == 1 && NumOfNeut == 1 && (
MC::isElectron(motherPDG) || abs(motherPDG) == MC::NU_E))
return FSRPhot;
1075 if (
MC::isElectron(motherPDG) && numOfParents == 1 && numOfDaug == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfPht == 1 &&
1080 if (
MC::isZ(motherPDG) && ((NumOfEl + NumOfPos == 2 || NumOfEl + NumOfPos == 4) || (NumOfMu == 2 || NumOfMu == 4) || (NumOfTau == 2 || NumOfTau == 4)) && NumOfPht > 0)
return FSRPhot;
1084 if (numOfParents == 2 && NumOfLQ == 1)
return FSRPhot;
1091 if (NumOfLep == 1 && NumOfNeut == 1 && numOfDaug == NumOfLep + NumOfNeut + NumOfPht)
return FSRPhot;
1099 }
while (
MC::isW(itrP) && prodVert !=
nullptr);
1104 if ( abs(itrP->
pdgId()) == MC::RH_NU_E)
return NuREle;
1105 if ( abs(itrP->
pdgId()) == MC::RH_NU_MU)
return NuRMu;
1106 if ( abs(itrP->
pdgId()) == MC::RH_NU_TAU)
return NuRTau;
1114 bool isZboson =
false;
1115 bool isWboson =
false;
1116 bool skipnext =
false;
1117 for (
unsigned int ipOut = 0; ipOut + 1 < partOriVert->
nOutgoingParticles(); ipOut++) {
1123 if (!theDaug)
continue;
1125 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->
nOutgoingParticles(); ipOut1++) {
1127 if (theNextDaug !=
nullptr)
break;
1129 if (!theNextDaug)
continue;
1132 if (thePriPart == theDaug || thePriPart == theNextDaug) {
1137 }
else if (
MC::isTau(theDaug) && abs(theNextDaug->
pdgId()) == MC::NU_TAU) {
1139 if (thePriPart == theDaug || thePriPart == theNextDaug) {
1146 if (isWboson)
return WBoson;
1147 if (isZboson)
return ZBoson;
1151 if (numOfParents == 4 && (numOfDaug - NumOfPht) == 4 && (NumOfLep + NumOfNeut == 4)) {
1158 if (partOriVert == mothOriVert && partOriVert !=
nullptr) {
1159 int NumOfPhtLoop = 0;
1161 if (!
pout)
continue;
1162 for (
const auto *
const pin: partOriVert->
particles_in()) {
1171 if (abs(motherPDG) == MC::PI0)
return PiZero;
◆ defOrigOfTau()
Definition at line 759 of file MCTruthClassifierGen.cxx.
777 if (numOfParents > 1)
ATH_MSG_DEBUG(
"DefOrigOfTau:: tau has more than one mother ");
780 info.setMotherProperties(mother);
789 if (
MC::isW(motherPDG) && mothOriVert !=
nullptr) {
794 pPDG = MotherParent->pdgId();
796 mother = MotherParent;
797 info.setMotherProperties(mother);
802 motherPDG = mother->
pdgId();
803 info.setMotherProperties(mother);
809 auto DP = DecayProducts(partOriVert);
810 const int numOfDaug = DP.size();
811 const int NumOfPhot = DP.pd(MC::PHOTON);
812 const int NumOfEl = DP.pd(MC::ELECTRON);
813 const int NumOfPos = DP.pd(MC::POSITRON);
814 const int NumOfElNeut = DP.apd(MC::NU_E);
815 const int NumOfMuNeut = DP.apd(MC::NU_MU);
817 const int NumOfquark = DP.apd({MC::DQUARK,MC::UQUARK,MC::SQUARK,MC::CQUARK,MC::BQUARK,MC::TQUARK});
818 const int NumOfgluon = DP.apd(MC::GLUON);
819 const int NumOfMuPl = DP.pd(-MC::MUON);
820 const int NumOfMuMin = DP.pd(MC::MUON);
821 const int NumOfTau = DP.apd(MC::TAU);
822 const int NumOfTauNeut = DP.apd(MC::NU_TAU);
831 }
while (
MC::isW(itrP) && prodVert !=
nullptr);
834 if (abs(itrP->
pdgId()) == MC::RH_NU_E)
return NuREle;
835 if (abs(itrP->
pdgId()) == MC::RH_NU_MU)
return NuRMu;
836 if (abs(itrP->
pdgId()) == MC::RH_NU_TAU)
return NuRTau;
843 bool isZboson =
false;
844 bool isWboson =
false;
845 bool skipnext =
false;
846 for (
unsigned int ipOut = 0; ipOut + 1 < partOriVert->
nOutgoingParticles(); ipOut++) {
852 if (!theDaug)
continue;
854 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partOriVert->
nOutgoingParticles(); ipOut1++) {
856 if (theNextDaug !=
nullptr)
break;
863 if (thePriPart == theDaug || thePriPart == theNextDaug) {
868 }
else if (
MC::isTau(theDaug) && abs(theNextDaug->
pdgId()) == MC::NU_TAU) {
870 if (thePriPart == theDaug || thePriPart == theNextDaug) {
877 if (isWboson)
return WBoson;
878 if (isZboson)
return ZBoson;
880 if (numOfParents == 2 ) {
887 if ((numOfDaug - NumOfquark - NumOfgluon) == 2 && NumOfTau == 1 && NumOfTauNeut == 1)
return WBoson;
890 if ((numOfDaug - NumOfquark - NumOfgluon) == 4 &&
891 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
895 if ((numOfDaug - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
896 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
900 if (partOriVert == mothOriVert) {
901 int NumOfTauLoop = 0;
902 int NumOfTauNeuLoop = 0;
903 int NumOfLepLoop = 0;
906 for (
const auto *
const pin: partOriVert->
particles_in()) {
910 if (std::abs(
pout->pdgId()) == MC::NU_TAU) NumOfTauNeuLoop++;
914 if (NumOfTauLoop == 2 && NumOfTauNeuLoop == 0)
return ZBoson;
915 if (NumOfTauLoop == 1 && NumOfTauNeuLoop == 1)
return WBoson;
916 if ((NumOfTauLoop == 4 && NumOfTauNeuLoop == 0) || (NumOfTauLoop == 3 && NumOfTauNeuLoop == 1) || (NumOfTauLoop == 2 && NumOfTauNeuLoop == 2))
return DiBoson;
917 if (NumOfLepLoop == 4)
return DiBoson;
923 if (abs(motherPDG) == MC::WBOSON_LRSM)
return WBosonLRSM;
924 if (abs(motherPDG) == MC::RH_NU_TAU)
return NuRTau;
927 if (abs(motherPDG) == MC::JPSI)
return JPsi;
◆ detEta()
double MCTruthClassifier::detEta |
( |
double |
x, |
|
|
double |
y |
|
) |
| const |
|
inlineprivateinherited |
◆ detPhi()
double MCTruthClassifier::detPhi |
( |
double |
x, |
|
|
double |
y |
|
) |
| const |
|
inlineprivateinherited |
◆ detStore()
◆ egammaClusMatch()
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 44 of file MCTruthClassifierAthena.cxx.
48 const EventContext& ctx =
info ?
info->eventContext : Gaudi::Hive::currentContext();
52 if (!truthParticleContainerReadHandle.isValid()) {
53 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
58 if (!caloMgrHandle.isValid()) {
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);
76 etaClus = clus->
eta();
79 phiClus = clus->
phi();
81 std::vector<const xAOD::TruthParticle*> tps;
87 for (
const auto*
const thePart : tps) {
92 long iParticlePDG = thePart->
pdgId();
94 if (std::abs(iParticlePDG) == 12 || std::abs(iParticlePDG) == 14 || std::abs(iParticlePDG) == 16)
continue;
96 double q = thePart?thePart->charge():0.0;
107 (((etaClus < 0) - (thePart->eta() < 0) != 0)
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);
121 info->egPartPtr.push_back(thePart);
122 info->egPartdR.push_back(dR);
129 if ((iParticlePDG == 22 || std::abs(iParticlePDG) == 11) && isNCone &&
pt > LeadingPhtPT) {
136 if ((iParticlePDG != 22 && std::abs(iParticlePDG) != 11) && isNCone &&
pt > LeadingPartPT) {
137 theLeadingPartInCone = thePart;
143 if (!isNCone && dR < BestPartdR) {
144 theBestPartOutCone = thePart;
148 if (dR < BestPartdR) {
149 theBestPartdR = thePart;
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;
168 theMatchPart =
nullptr;
170 if (isFwrdEle || theMatchPart !=
nullptr || !
m_inclG4part)
return theMatchPart;
173 for (
const auto*
const thePart : tps) {
176 long iParticlePDG = thePart->
pdgId();
178 if (std::abs(iParticlePDG) == 12 || std::abs(iParticlePDG) == 14 || std::abs(iParticlePDG) == 16)
continue;
179 if (thePart->decayVtx() !=
nullptr)
continue;
183 double q = thePart->charge();
189 bool isNCone =
false;
190 bool isExt =
genPartToCalo(ctx, clus, thePart, isFwrdEle, dR, isNCone, *caloDDMgr);
191 if (!isExt)
continue;
193 theMatchPart =
MC::findMatching(truthParticleContainerReadHandle.ptr(),thePart);
195 info->egPartPtr.push_back(thePart);
196 info->egPartdR.push_back(dR);
201 if ((iParticlePDG == 22 || std::abs(iParticlePDG) == 11) && isNCone &&
pt > LeadingPhtPT) {
208 if ((iParticlePDG != 22 && std::abs(iParticlePDG) != 11) && isNCone &&
pt > LeadingPartPT) {
209 theLeadingPartInCone = thePart;
215 if (!isNCone && dR < BestPartdR) {
216 theBestPartOutCone = thePart;
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;
231 theMatchPart =
nullptr;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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()
Definition at line 278 of file MCRecoToTruth.cxx.
287 if (!truthParticleContainerReadHandle.isValid()) {
288 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
291 ATH_MSG_DEBUG(
"xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() <<
" has valid ReadHandle ");
293 for (
const auto *
const thePart : *truthParticleContainerReadHandle) {
296 constituents.insert(thePart);
302 for (
const auto *particle0 :
vec) {
305 constituents.insert(thePart);
◆ fracParticleInJet()
Definition at line 310 of file MCRecoToTruth.cxx.
312 std::set<const xAOD::TruthParticle*> constituents;
313 std::set<const xAOD::TruthParticle*> daughters;
314 std::set<const xAOD::TruthParticle*>
intersect;
318 if (daughters.empty()) daughters.insert(thePart);
326 if (nparts)
return 1.0*
intersect.size() / daughters.size();
329 for (
const auto *daughter : daughters) { tot += daughter->pt();}
◆ genPartToCalo()
Definition at line 237 of file MCTruthClassifierAthena.cxx.
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();
253 if (phiClus < -900) {
254 phiClus = clus->
phi();
257 if (isFwrdEle || (etaClus == 0. && phiClus == 0.)) {
258 phiClus = clus->
phi();
259 etaClus = clus->
eta();
271 }
else if (isFwrdEle && clus->
inEndcap()) {
277 std::unique_ptr<Trk::CurvilinearParameters>
params = extractParamFromTruth(*thePart);
278 if (!
params)
return false;
280 std::vector<CaloSampling::CaloSample> samples = {
sample };
282 bool extensionOK = (!extension.empty());
284 ATH_MSG_WARNING(
"extrapolation of Truth Particle with eta " << thePart->
eta() <<
" , charge " << thePart->
charge() <<
" , Pt " << thePart->
pt() <<
" to calo failed");
287 double etaCalo = extension[0].second->position().eta();
288 double phiCalo = extension[0].second->position().phi();
◆ get_tptruth_name()
bool D3PD::D3PDMCTruthClassifier::get_tptruth_name |
( |
const std::string & |
tp_name, |
|
|
std::string & |
tptruth_name |
|
) |
| |
|
private |
Try to find a TrackParticleTruthCollection pointing at TP_NAME.
- Parameters
-
- Returns
- True if we found a good truth collection.
Definition at line 174 of file D3PDMCTruthClassifier.cxx.
179 std::vector<std::string>
keys;
182 for (
size_t i = 0;
i <
keys.size();
i++) {
184 if (
m_sg->retrieve (tptc,
keys[
i]).isFailure() || !tptc)
190 tptruth_name =
keys[
i];
192 std::string target_tp_name;
195 target_tp_name =
"TrackParticleCandidate";
202 if (tp_name == target_tp_name)
◆ getGenPart()
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 181 of file MCRecoToTruth.cxx.
185 if (!trk)
return nullptr;
187 info->deltaRMatch = -999.;
188 info->deltaPhi = -999.;
189 info->probTrkToTruth = 0;
190 info->numOfSiHits = 0;
198 if (!tPL.isAvailable(*trk)) {
199 ATH_MSG_DEBUG(
"Track particle is not associated to truth particle");
203 const auto& truthLink = tPL(*trk);
204 if (!truthLink.isValid()) {
210 if (!theGenParticle) {
217 if (tMP.isAvailable(*trk)) {
218 info->probTrkToTruth = tMP(*trk);
224 if (theGenParticle->
status() == 3) {
237 if (EndVrtx !=
nullptr) {
240 theGenPartTmp =
nullptr;
242 if (!theDaugt)
continue;
243 if (theDaugt->pdgId() == theGenParticle->
pdgId()) theGenPartTmp = theDaugt;
244 if (theDaugt->pdgId() != theGenParticle->
pdgId() && !
MC::isPhoton(theDaugt)) theGenPartTmp =
nullptr;
251 EndVrtx = theGenPartTmp ? theGenPartTmp->decayVtx() :
nullptr;
252 }
while (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->
pdgId() &&
MC::isDecayed(theGenPartTmp) && EndVrtx !=
nullptr);
254 if (theGenPartTmp && theGenPartTmp->pdgId() == theGenParticle->
pdgId()) theGenParticle = theGenPartTmp;
261 uint8_t NumOfSiHits = NumOfSCTHits + NumOfPixHits;
264 float deteta =
detEta(theGenParticle->
eta(), trk->
eta());
265 float deltaRMatch = std::hypot(
deltaPhi, deteta);
267 (NumOfSiHits <= m_NumOfSiHitsCut && deltaPhi >
m_deltaPhiMatchCut)) theGenParticle =
nullptr;
270 info->deltaRMatch = deltaRMatch;
272 info->numOfSiHits = NumOfSiHits;
275 return (theGenParticle);
◆ getKey()
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
-
ptr | The 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.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
-
ptr | The 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.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getProperty1()
void D3PD::D3PDMCTruthClassifier::getProperty1 |
( |
const std::string & |
pname, |
|
|
std::string & |
value |
|
) |
| |
|
private |
Helper to retrieve the value of a Gaudi property.
- Parameters
-
pname | The name of the property. param value[out] The value of the property. |
Definition at line 214 of file D3PDMCTruthClassifier.cxx.
◆ initialize()
StatusCode D3PD::D3PDMCTruthClassifier::initialize |
( |
| ) |
|
|
virtual |
◆ inputHandles()
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]
◆ msg() [2/2]
◆ 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.
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ particleTruthClassifier() [1/21]
Definition at line 133 of file MCTruthClassifierGen.cxx.
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());
◆ particleTruthClassifier() [2/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 26 of file MCTruthClassifierGen.cxx.
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());
◆ particleTruthClassifier() [3/21]
Definition at line 162 of file MCRecoToTruth.cxx.
116 ATH_MSG_DEBUG(
"Executing egamma photon Classifier with cluster Input");
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);
122 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
125 ATH_MSG_WARNING(
"Cluster Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
127 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [4/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 114 of file MCRecoToTruth.cxx.
116 ATH_MSG_DEBUG(
"Executing egamma photon Classifier with cluster Input");
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);
122 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
125 ATH_MSG_WARNING(
"Cluster Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
127 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [5/21]
Definition at line 153 of file MCRecoToTruth.cxx.
35 return std::make_pair(parttype, partorig);
39 #ifndef XAOD_ANALYSIS // cluster matching available only in Athena
43 ATH_MSG_WARNING(
"Forward Electron classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
48 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [6/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 24 of file MCRecoToTruth.cxx.
35 return std::make_pair(parttype, partorig);
39 #ifndef XAOD_ANALYSIS // cluster matching available only in Athena
43 ATH_MSG_WARNING(
"Forward Electron classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
48 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [7/21]
Run the classifier for an electron.
- Parameters
-
Definition at line 65 of file D3PDMCTruthClassifier.cxx.
69 bool got_names =
false;
70 std::string tp_truth_name, tp_name;
71 if (
el->trackParticleLink().isValid()) {
72 tp_name =
el->trackParticleLink().dataID();
78 std::string old_tp_truth_name, old_tp_name;
80 getProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
81 getProperty1 (
"TrackParticleContainerName", old_tp_name);
82 setProperty1 (
"TrackParticleTruthCollection", tp_truth_name);
93 setProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
94 setProperty1 (
"TrackParticleContainerName", old_tp_name);
◆ particleTruthClassifier() [8/21]
Definition at line 165 of file MCRecoToTruth.cxx.
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();
149 for (
const auto& thePart: constituents) {
155 if (tempparttype !=
Hadron)
continue;
163 if (parttype !=
BJet) parttype =
CJet;
167 if (parttype !=
BJet && parttype !=
CJet) parttype =
LJet;
174 allJetMothers.clear();
175 constituents.clear();
177 return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [9/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 134 of file MCRecoToTruth.cxx.
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();
149 for (
const auto& thePart: constituents) {
155 if (tempparttype !=
Hadron)
continue;
163 if (parttype !=
BJet) parttype =
CJet;
167 if (parttype !=
BJet && parttype !=
CJet) parttype =
LJet;
174 allJetMothers.clear();
175 constituents.clear();
177 return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [10/21]
Definition at line 159 of file MCRecoToTruth.cxx.
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();
104 if (!trkPtr)
return std::make_pair(parttype, partorig);
107 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [11/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 93 of file MCRecoToTruth.cxx.
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();
104 if (!trkPtr)
return std::make_pair(parttype, partorig);
107 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [12/21]
Run the classifier for a muon.
This function is here to avoid a problem on the mc12 validation samples.
- Parameters
-
Definition at line 155 of file D3PDMCTruthClassifier.cxx.
158 if(
mu->muonType() == xAOD::Muon::SiliconAssociatedForwardMuon ) {
◆ particleTruthClassifier() [13/21]
Definition at line 156 of file MCRecoToTruth.cxx.
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);
64 if (VxCvPtr !=
nullptr) {
66 if (itrk > 1)
continue;
68 if (!trkPtr)
continue;
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);
81 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
84 ATH_MSG_WARNING(
"Photon Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
86 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [14/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 54 of file MCRecoToTruth.cxx.
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);
64 if (VxCvPtr !=
nullptr) {
66 if (itrk > 1)
continue;
68 if (!trkPtr)
continue;
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);
81 #ifndef XAOD_ANALYSIS // Fwd electron available only in Athena
84 ATH_MSG_WARNING(
"Photon Classification using extrapolation to Calo is available only in Athena , check your enviroment. ");
86 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [15/21]
Run the classifier for a photon.
- Parameters
-
Definition at line 107 of file D3PDMCTruthClassifier.cxx.
111 bool got_names =
false;
112 std::string tp_truth_name, tp_name;
116 for (
auto trklink :
links) {
117 if (trklink.isValid()) {
118 tp_name = trklink.dataID();
120 if (got_names)
break;
127 std::string old_tp_truth_name, old_tp_name;
129 getProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
130 getProperty1 (
"TrackParticleContainerName", old_tp_name);
131 setProperty1 (
"TrackParticleTruthCollection", tp_truth_name);
142 setProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
143 setProperty1 (
"TrackParticleContainerName", old_tp_name);
◆ particleTruthClassifier() [16/21]
Definition at line 150 of file MCRecoToTruth.cxx.
18 if (!genPart)
return std::make_pair(parttype, partorig);
◆ particleTruthClassifier() [17/21]
|
finaloverridevirtualinherited |
◆ particleTruthClassifier() [18/21]
Definition at line 129 of file MCTruthClassifierGen.cxx.
84 return std::make_pair(partType, partOrig);
86 info.genPart = thePart;
90 if (!truthParticleContainerReadHandle.isValid()) {
91 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
92 return std::make_pair(partType, partOrig);
95 ATH_MSG_DEBUG(
"xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() <<
" has valid ReadHandle ");
106 if (endVert !=
nullptr) {
125 if (
MC::isNucleus(thePart) && std::abs(thePart->pdgId()) != MC::PROTON)
return std::make_pair(
NuclFrag, partOrig);
130 const xAOD::TruthVertex* partOriVert = thePart->hasProdVtx() ? thePart->prodVtx() :
nullptr;
133 if (partOriVert !=
nullptr) {
136 int motherPDG = theMoth?theMoth->pdg_id():0;
137 info.setMotherProperties(theMoth);
154 if (!partOriVert &&
MC::isTau(thePart)) {
156 partOrig =
defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG,
info);
168 return std::make_pair(
Neutrino, partOrig);
174 if (isPartHadr)
return std::make_pair(
Hadron, partOrig);
180 return std::make_pair(IsoElectron,
SingleElec);
196 if (motherPDG == thePart->pdg_id() && theMoth && theMoth->status() == 3 &&
MC::isDecayed(thePart))
return std::make_pair(
GenParticle, partOrig);
207 partOrig =
defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG,
info);
220 return std::make_pair(partType, partOrig);
◆ particleTruthClassifier() [19/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 75 of file MCTruthClassifierGen.cxx.
84 return std::make_pair(partType, partOrig);
86 info.genPart = thePart;
90 if (!truthParticleContainerReadHandle.isValid()) {
91 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.key());
92 return std::make_pair(partType, partOrig);
95 ATH_MSG_DEBUG(
"xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.key() <<
" has valid ReadHandle ");
106 if (endVert !=
nullptr) {
133 if (partOriVert !=
nullptr) {
136 int motherPDG = theMoth?theMoth->pdg_id():0;
137 info.setMotherProperties(theMoth);
154 if (!partOriVert &&
MC::isTau(thePart)) {
156 partOrig =
defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG,
info);
168 return std::make_pair(
Neutrino, partOrig);
174 if (isPartHadr)
return std::make_pair(
Hadron, partOrig);
207 partOrig =
defOrigOfTau(truthParticleContainerReadHandle.ptr(), thePart, motherPDG,
info);
220 return std::make_pair(partType, partOrig);
◆ particleTruthClassifier() [20/21]
Definition at line 136 of file MCTruthClassifierGen.cxx.
46 if (!theGenPart)
return std::make_pair(partType, partOrig);
49 const EventContext& ctx =
info ?
info->eventContext : Gaudi::Hive::currentContext();
52 if (!truthParticleLinkVecReadHandle.isValid()) {
53 ATH_MSG_WARNING(
" Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
54 return std::make_pair(partType, partOrig);
56 for (
const auto *
const entry : *truthParticleLinkVecReadHandle) {
59 if (!theGenPart || !truthParticle ||
60 theGenPart->pdg_id() != truthParticle->
pdgId() ||
61 theGenPart->status() != truthParticle->
status() ||
64 "HepMC::GenParticle and xAOD::TruthParticle do not match");
65 return std::make_pair(partType, partOrig);
70 return std::make_pair(partType, partOrig);
◆ particleTruthClassifier() [21/21]
|
finaloverridevirtualinherited |
Implements IMCTruthClassifier.
Definition at line 42 of file MCTruthClassifierGen.cxx.
46 if (!theGenPart)
return std::make_pair(partType, partOrig);
49 const EventContext& ctx =
info ?
info->eventContext : Gaudi::Hive::currentContext();
52 if (!truthParticleLinkVecReadHandle.isValid()) {
53 ATH_MSG_WARNING(
" Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.key());
54 return std::make_pair(partType, partOrig);
56 for (
const auto *
const entry : *truthParticleLinkVecReadHandle) {
59 if (!theGenPart || !truthParticle ||
60 theGenPart->pdg_id() != truthParticle->
pdgId() ||
61 theGenPart->status() != truthParticle->
status() ||
64 "HepMC::GenParticle and xAOD::TruthParticle do not match");
65 return std::make_pair(partType, partOrig);
70 return std::make_pair(partType, partOrig);
◆ print() [1/2]
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ renounce()
◆ renounceArray()
◆ setProperty1()
void D3PD::D3PDMCTruthClassifier::setProperty1 |
( |
const std::string & |
pname, |
|
|
const std::string & |
value |
|
) |
| |
|
private |
Helper to set the value of a Gaudi property.
- Parameters
-
pname | The name of the property. param value The new value of the property. |
Definition at line 228 of file D3PDMCTruthClassifier.cxx.
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_caloExtensionTool
◆ m_caloMgrKey
◆ m_deltaPhiMatchCut
float MCTruthClassifier::m_deltaPhiMatchCut |
|
privateinherited |
◆ m_deltaRMatchCut
float MCTruthClassifier::m_deltaRMatchCut |
|
privateinherited |
◆ m_detStore
◆ m_evtStore
◆ m_FwdElectronTruthExtrEtaCut
float MCTruthClassifier::m_FwdElectronTruthExtrEtaCut |
|
privateinherited |
◆ m_FwdElectronTruthExtrEtaWindowCut
float MCTruthClassifier::m_FwdElectronTruthExtrEtaWindowCut |
|
privateinherited |
◆ m_FwdElectronUseG4Sel
bool MCTruthClassifier::m_FwdElectronUseG4Sel |
|
privateinherited |
◆ m_fwrdEledRtoTrCut
float MCTruthClassifier::m_fwrdEledRtoTrCut |
|
privateinherited |
◆ m_inclG4part
bool MCTruthClassifier::m_inclG4part |
|
privateinherited |
◆ m_jetPartDRMatch
float MCTruthClassifier::m_jetPartDRMatch |
|
privateinherited |
◆ m_NumOfSiHitsCut
int MCTruthClassifier::m_NumOfSiHitsCut |
|
privateinherited |
◆ m_partExtrConeEta
float MCTruthClassifier::m_partExtrConeEta |
|
privateinherited |
◆ m_partExtrConePhi
float MCTruthClassifier::m_partExtrConePhi |
|
privateinherited |
◆ m_phtClasConeEta
float MCTruthClassifier::m_phtClasConeEta |
|
privateinherited |
◆ m_phtClasConePhi
float MCTruthClassifier::m_phtClasConePhi |
|
privateinherited |
◆ m_phtdRtoTrCut
float MCTruthClassifier::m_phtdRtoTrCut |
|
privateinherited |
◆ m_pTChargePartCut
float MCTruthClassifier::m_pTChargePartCut |
|
privateinherited |
◆ m_pTNeutralPartCut
float MCTruthClassifier::m_pTNeutralPartCut |
|
privateinherited |
◆ m_ROICone
bool MCTruthClassifier::m_ROICone |
|
privateinherited |
◆ m_sg
◆ m_truthInConeTool
◆ m_truthLinkVecReadHandleKey
◆ m_truthParticleContainerKey
◆ m_useCaching
bool MCTruthClassifier::m_useCaching |
|
privateinherited |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
virtual double phi() const
The azimuthal angle ( ) of the particle.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
ParticleOutCome defOutComeOfMuon(T thePart)
ParticleType defTypeOfPhoton(ParticleOrigin PhotOrig)
void getProperty1(const std::string &pname, std::string &value)
Helper to retrieve the value of a Gaudi property.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
def pout(output, newline=True)
#define REPORT_ERROR(SC)
Report an error.
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
bool is_same_vertex(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same vertex.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
float m_FwdElectronTruthExtrEtaWindowCut
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier)
std::vector< const TruthParticle * > particles_in() const
Get the incoming particles.
void findParticleAncestors(T thePart, std::set< T > &allancestors)
Function to find all ancestors of the particle.
Helper class to provide type-safe access to aux data.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
void findJetConstituents(const xAOD::Jet *, std::set< const xAOD::TruthParticle * > &constituents, bool DR) const
ParticleOutCome defOutComeOfTau(T thePart)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
const ID_type & dataID() const
Get the key that we reference, as a string.
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
std::vector< size_t > vec
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::Electron *el)
Run the classifier for an electron.
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
const std::string & key() const
Return the StoreGate ID for the referenced object.
int pdg_id() const
PDG ID code.
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
bool isValid() const
Test to see if the link can be dereferenced.
bool isSMLepton(const T &p)
bool isSMQuark(const T &p)
virtual void setOwner(IDataHandleHolder *o)=0
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
MCTruthPartClassifier::ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer *m_xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info &info) const
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to dot...
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Description of a calorimeter cluster.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
DataLink< Rec::TrackParticleContainer > trackParticleContainerLink() const
float m_FwdElectronTruthExtrEtaCut
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.
void setProperty1(const std::string &pname, const std::string &value)
Helper to set the value of a Gaudi property.
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...
virtual double eta() const
The pseudorapidity ( ) of the particle.
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
T findMatching(C TruthContainer, T p)
Function to find a particle in container.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
bool hasProdVtx() const
Check for a production vertex on this particle.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
virtual const xAOD::TruthParticle * egammaClusMatch(const xAOD::CaloCluster *, bool, MCTruthPartClassifier::Info *info) const override final
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthLinkVecReadHandleKey
void findParticleStableDescendants(T thePart, std::set< T > &allstabledescendants)
Function to get the particle stable MC daughters.
T findMother(T thePart)
Function to get a mother of particle. MCTruthClassifier legacy.
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Type for the associated track particles.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool isValid() const
Test to see if the link is dereferencable.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
ParticleType defTypeOfHadron(int pdg)
bool isSUSY(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
bool genPartToCalo(const EventContext &ctx, const xAOD::CaloCluster *clus, const xAOD::TruthParticle *thePart, bool isFwrdEle, double &dRmatch, bool &isNarrowCone, const CaloDetDescrManager &caloDDMgr) const
bool isConditionA(const T &p)
To be understood.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
ServiceHandle< StoreGateSvc > m_sg
The StoreGate service.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Class describing a truth vertex in the MC record.
ParticleOutCome defOutComeOfElectron(T thePart)
bool get_tptruth_name(const std::string &tp_name, std::string &tptruth_name)
Try to find a TrackParticleTruthCollection pointing at TP_NAME.
bool isDefault() const
Test to see if we're in the default state.
bool isHadron(const T &p)
bool isNeutrinoRH(const T &p)
PDG Rule 12: APID: Helper function for right-handed neutrino states These are generator defined PDG I...
std::vector< const TruthParticle * > particles_out() const
Get the outgoing particles.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer *xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
MCTruthClassifier(const std::string &type)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
int status() const
Status code.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
float eSample(const CaloSample sampling) const
Class describing a Vertex.
This class provides the client interface for accessing the detector description information common to...
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.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
#define ATH_MSG_WARNING(x)
size_t nIncomingParticles() const
Get the number of incoming particles.
bool isDecayed(const T &p)
Identify if the particle decayed.
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
bool isBeam(const T &p)
Identify if the particle is beam particle.
ParticleOrigin convHadronTypeToOrig(ParticleType pType, int motherPDG)
ParticleOrigin defJetOrig(const T &allJetMothers)
bool isSMNeutrino(const T &p)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
ParticleType defTypeOfTau(ParticleOrigin TauOrig)
A vector of jet constituents at the scale used during jet finding.
ToolHandle< xAOD::ITruthParticlesInConeTool > m_truthInConeTool
ParticleOutCome defOutComeOfPhoton(T thePart)
Class describing a TrackParticle.
int pdgId() const
PDG ID code.
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
bool m_FwdElectronUseG4Sel
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
double detEta(double x, double y) const
double charge() const
Physical charge.
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier)
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
bool isHardScatteringVertex(T pVert)
Function to classify the vertex as hard scattering vertex.
double detPhi(double x, double y) const
bool isLeptoQuark(const T &p)
PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.
virtual const xAOD::TruthParticle * getGenPart(const xAOD::TrackParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final