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 initialize () override final
 
virtual StatusCode addBranches (const EventContext &ctx) const override
 

Private Member Functions

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

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_mcName { this,"MCCollectionName", "TruthParticles", "MC Collection Key"}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoName { this, "EventInfoName", "EventInfo", "Event Info Key"}
 
SG::WriteDecorHandleKey< xAOD::EventInfom_dec_procIDKey {this, "SUSY_procIDKey", m_eventInfoName, "SUSY_procID"}
 
SG::WriteDecorHandleKey< xAOD::EventInfom_dec_pdgId1Key {this, "SUSY_pid1Key", m_eventInfoName, "SUSY_pid1"}
 
SG::WriteDecorHandleKey< xAOD::EventInfom_dec_pdgId2Key {this, "SUSY_pid2Key", m_eventInfoName, "SUSY_pid2"}
 

Detailed Description

Definition at line 28 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 18 of file SUSYSignalTagger.cxx.

18  :
19  base_class(t,n,p){
20  }

◆ ~SUSYSignalTagger()

DerivationFramework::SUSYSignalTagger::~SUSYSignalTagger ( )
default

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::SUSYSignalTagger::addBranches ( const EventContext &  ctx) const
overridevirtual

Definition at line 31 of file SUSYSignalTagger.cxx.

31  {
33  if (!eventInfo.isValid()) {
34  ATH_MSG_ERROR("could not retrieve event info " <<m_eventInfoName);
35  return StatusCode::FAILURE;
36  }
37 
39  if (!truthPC.isValid()) {
40  ATH_MSG_ERROR("WARNING could not retrieve TruthParticleContainer " <<m_mcName);
41  return StatusCode::FAILURE;
42  }
43 
47 
48  //Identify SUSY hard proc
49  int pdgId1(0);
50  int pdgId2(0);
51  bool found = FindSusyHardProc( *truthPC, pdgId1, pdgId2);
52  if (!found) {
53  ATH_MSG_DEBUG("could not identify SUSY process! ");
54  dec_procID(*eventInfo) = 0;
55  dec_pdgId1(*eventInfo) = -99;
56  dec_pdgId2(*eventInfo) = -99;
57  return StatusCode::SUCCESS;
58  }
59  //Get SUSY proc ID
60  unsigned int procID = finalStateID(pdgId1, pdgId2);
61  if (procID == 0) ATH_MSG_WARNING("could not identify SUSY procID! ");
62  dec_procID(*eventInfo) = procID;
63  dec_pdgId1(*eventInfo) = pdgId1;
64  dec_pdgId2(*eventInfo) = pdgId2;
65  return StatusCode::SUCCESS;
66  }

◆ FindSusyHardProc()

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

Definition at line 70 of file SUSYSignalTagger.cxx.

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

◆ initialize()

StatusCode DerivationFramework::SUSYSignalTagger::initialize ( )
finaloverridevirtual

Definition at line 22 of file SUSYSignalTagger.cxx.

Member Data Documentation

◆ m_dec_pdgId1Key

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::SUSYSignalTagger::m_dec_pdgId1Key {this, "SUSY_pid1Key", m_eventInfoName, "SUSY_pid1"}
private

Definition at line 42 of file SUSYSignalTagger.h.

◆ m_dec_pdgId2Key

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::SUSYSignalTagger::m_dec_pdgId2Key {this, "SUSY_pid2Key", m_eventInfoName, "SUSY_pid2"}
private

Definition at line 43 of file SUSYSignalTagger.h.

◆ m_dec_procIDKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::SUSYSignalTagger::m_dec_procIDKey {this, "SUSY_procIDKey", m_eventInfoName, "SUSY_procID"}
private

Definition at line 41 of file SUSYSignalTagger.h.

◆ m_eventInfoName

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::SUSYSignalTagger::m_eventInfoName { this, "EventInfoName", "EventInfo", "Event Info Key"}
private

Definition at line 40 of file SUSYSignalTagger.h.

◆ m_mcName

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::SUSYSignalTagger::m_mcName { this,"MCCollectionName", "TruthParticles", "MC Collection Key"}
private

Definition at line 39 of file SUSYSignalTagger.h.


The documentation for this class was generated from the following files:
isGaugino
bool isGaugino(const T &p)
Definition: AtlasPID.h:504
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
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)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:458
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
DerivationFramework::SUSYSignalTagger::m_dec_pdgId1Key
SG::WriteDecorHandleKey< xAOD::EventInfo > m_dec_pdgId1Key
Definition: SUSYSignalTagger.h:42
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:727
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
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::SUSYSignalTagger::m_mcName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_mcName
Definition: SUSYSignalTagger.h:39
isSUSY
bool isSUSY(const T &p)
Definition: AtlasPID.h:623
DerivationFramework::SUSYSignalTagger::FindSusyHardProc
bool FindSusyHardProc(const xAOD::TruthParticleContainer &truthP, int &pdgid1, int &pdgid2) const
Definition: SUSYSignalTagger.cxx:70
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328
DerivationFramework::SUSYSignalTagger::m_dec_pdgId2Key
SG::WriteDecorHandleKey< xAOD::EventInfo > m_dec_pdgId2Key
Definition: SUSYSignalTagger.h:43
isSlepton
bool isSlepton(const T &p)
Definition: AtlasPID.h:482
DerivationFramework::SUSYSignalTagger::m_eventInfoName
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoName
Definition: SUSYSignalTagger.h:40
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::SUSYSignalTagger::m_dec_procIDKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_dec_procIDKey
Definition: SUSYSignalTagger.h:41
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.