ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DerivationFramework::SUSYSignalTagger Class Reference

#include <SUSYSignalTagger.h>

Inheritance diagram for DerivationFramework::SUSYSignalTagger:
Collaboration diagram for DerivationFramework::SUSYSignalTagger:

Public Member Functions

 SUSYSignalTagger (const std::string &t, const std::string &n, const IInterface *p)
 
 ~SUSYSignalTagger ()=default
 
virtual StatusCode addBranches () const override
 

Private Member Functions

bool FindSusyHardProc (const xAOD::TruthParticleContainer *truthP, int &pdgid1, int &pdgid2) const
 

Private Attributes

Gaudi::Property< std::string > m_eventInfoName { this, "EventInfoName", "EventInfo", "Event Info Key"}
 
Gaudi::Property< std::string > m_mcName { this,"MCCollectionName", "TruthParticles", "MC Collection Key"}
 

Detailed Description

Definition at line 26 of file SUSYSignalTagger.h.

Constructor & Destructor Documentation

◆ SUSYSignalTagger()

DerivationFramework::SUSYSignalTagger::SUSYSignalTagger ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 23 of file SUSYSignalTagger.cxx.

23  :
24  base_class(t,n,p){
25  }

◆ ~SUSYSignalTagger()

DerivationFramework::SUSYSignalTagger::~SUSYSignalTagger ( )
default

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::SUSYSignalTagger::addBranches ( ) const
overridevirtual

Definition at line 27 of file SUSYSignalTagger.cxx.

27  {
29  if (evtStore()->retrieve(eventInfo,m_eventInfoName).isFailure()) {
30  ATH_MSG_ERROR("could not retrieve event info " <<m_eventInfoName);
31  return StatusCode::FAILURE;
32  }
33 
34  const xAOD::TruthParticleContainer* truthPC = 0;
35  if (evtStore()->retrieve(truthPC,m_mcName).isFailure()) {
36  ATH_MSG_DEBUG("WARNING could not retrieve TruthParticleContainer " <<m_mcName);
37  return StatusCode::FAILURE;
38  }
39  //Identify SUSY hard proc
40  int pdgId1(0);
41  int pdgId2(0);
42  bool found = FindSusyHardProc( truthPC, pdgId1, pdgId2);
43  if (!found) {
44  ATH_MSG_DEBUG("could not identify SUSY process! ");
45  dec_procID(*eventInfo) = 0;
46  dec_pdgId1(*eventInfo) = -99;
47  dec_pdgId2(*eventInfo) = -99;
48  return StatusCode::SUCCESS;
49  }
50  //Get SUSY proc ID
51  unsigned int procID = finalStateID(pdgId1, pdgId2);
52  if (procID == 0) ATH_MSG_WARNING("could not identify SUSY procID! ");
53  dec_procID(*eventInfo) = procID;
54  dec_pdgId1(*eventInfo) = pdgId1;
55  dec_pdgId2(*eventInfo) = pdgId2;
56  return StatusCode::SUCCESS;
57  }

◆ FindSusyHardProc()

bool DerivationFramework::SUSYSignalTagger::FindSusyHardProc ( const xAOD::TruthParticleContainer truthP,
int &  pdgid1,
int &  pdgid2 
) const
private

Definition at line 61 of file SUSYSignalTagger.cxx.

62  {
63  pdgid1 = 0;
64  pdgid2 = 0;
65  const xAOD::TruthParticle* firstsp(0);
66  const xAOD::TruthParticle* secondsp(0);
67  if (!truthP || truthP->empty()) {
68  return false;
69  }
70  for (const auto tp : *truthP) {
72  if (tp->nParents() != 0) {
73  if ( !MC::isSUSY(tp->parent(0))) {
74  if (!firstsp) {
75  firstsp = tp;
76  } else if (!secondsp) {
77  secondsp = tp;
78  } else {
79  if (firstsp->nChildren() != 0 && HepMC::is_same_particle(tp,firstsp->child(0))) {
80  firstsp = tp;
81  }
82  else if (secondsp->nChildren() != 0 && HepMC::is_same_particle(tp,secondsp->child(0))) {
83  secondsp = tp;
84  }
85  else if (firstsp->nChildren() != 0 && HepMC::is_same_particle(firstsp->child(0),secondsp)) {
86  firstsp = secondsp;
87  secondsp = tp;
88  }
89  else if (secondsp->nChildren() != 0 && HepMC::is_same_particle(secondsp->child(0),firstsp)) {
90  secondsp = firstsp;
91  firstsp = tp;
92  }
93  }
94  }
95  }
96  }
97  }
98  // quit if no sparticles found
99  if (!firstsp && !secondsp) return false; // should find none or two
100 
101  if (firstsp && firstsp->nChildren() == 1) {
102  for (const auto tp : *truthP) {
103  if (HepMC::is_same_particle(firstsp->child(0),tp) && tp->pdgId() != firstsp->pdgId()) {
104  firstsp = tp;
105  break;
106  }
107  }
108  }
109  if (secondsp && secondsp->nChildren() == 1) {
110  for (const auto tp : *truthP) {
111  if (HepMC::is_same_particle(secondsp->child(0),tp) && tp->pdgId() != secondsp->pdgId()) {
112  secondsp = tp;
113  break;
114  }
115  }
116  }
117  if (firstsp && abs(firstsp->pdgId()) > 1000000) pdgid1 = firstsp->pdgId(); // Replace with (firstsp && MC::isSUSY(firstsp)) ?
118  if (secondsp && abs(secondsp->pdgId()) > 1000000) pdgid2 = secondsp->pdgId(); // Replace with (secondsp && MC::isSUSY(secondsp)) ?
119  // Return gracefully:
120  return true;
121  }

Member Data Documentation

◆ m_eventInfoName

Gaudi::Property<std::string> DerivationFramework::SUSYSignalTagger::m_eventInfoName { this, "EventInfoName", "EventInfo", "Event Info Key"}
private

Definition at line 34 of file SUSYSignalTagger.h.

◆ m_mcName

Gaudi::Property<std::string> DerivationFramework::SUSYSignalTagger::m_mcName { this,"MCCollectionName", "TruthParticles", "MC Collection Key"}
private

Definition at line 35 of file SUSYSignalTagger.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
isGaugino
bool isGaugino(const T &p)
Definition: AtlasPID.h:483
DerivationFramework::SUSYSignalTagger::FindSusyHardProc
bool FindSusyHardProc(const xAOD::TruthParticleContainer *truthP, int &pdgid1, int &pdgid2) const
Definition: SUSYSignalTagger.cxx:61
DerivationFramework::finalStateID
unsigned int finalStateID(const int SUSY_Spart1_pdgId, const int SUSY_Spart2_pdgId)
Definition: utilityFunctions.cxx:135
ParticleTest.tp
tp
Definition: ParticleTest.py:25
isSquark
bool isSquark(const T &p)
Definition: AtlasPID.h:434
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
DerivationFramework::SUSYSignalTagger::m_mcName
Gaudi::Property< std::string > m_mcName
Definition: SUSYSignalTagger.h:35
DerivationFramework::SUSYSignalTagger::m_eventInfoName
Gaudi::Property< std::string > m_eventInfoName
Definition: SUSYSignalTagger.h:34
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
isSUSY
bool isSUSY(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:428
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328
columnar::ContainerId::eventInfo
@ eventInfo
isSlepton
bool isSlepton(const T &p)
Definition: AtlasPID.h:465
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.