ATLAS Offline Software
ElectronTAccept.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RINGER_STANDALONE
6 
7 #ifndef RINGERSELECTORTOOLS_ELECTRONTACCEPT_H
8 #define RINGERSELECTORTOOLS_ELECTRONTACCEPT_H
9 
10 // Athena includes:
12 #include "PATCore/AcceptInfo.h"
13 
14 // Local includes:
16 
17 namespace Ringer {
18 
19 class BitdefElectron_v1;
20 
26  public:
33 #ifdef XAOD_ANALYSIS
34  typedef std::bitset<32> bitMskWord;
35 #else
36  typedef std::bitset<asg::AcceptInfo::NBITS> bitMskWord;
37 #endif
38 
39  // Grant access to m_accept for BitdefElectron_v1
40  friend class BitdefElectron_v1;
41 
44 
47  static unsigned int getAppliedCutMsk(const Requirement cut,
48  bool withCutIDTrack = false);
52  static const asg::AcceptInfo& retrieveTAcceptTemplate(){ return m_accept;}
54 
55 
58 
61  static void resetMsk(bitMskWord& word);
65  static void addLooseAppliedCuts(bitMskWord& word);
69  static void addMediumAppliedCuts(bitMskWord& word);
73  static void addTightAppliedCuts(bitMskWord& word);
79 
80  private:
85 
87  static asg::AcceptInfo m_accept ATLAS_THREAD_SAFE; // read-only except for declareBit below
88 };
89 
95 /*
96  * NOTE:
97  *
98  * Should new implementation inherit from this? That is, new bits
99  * can only be defined for positions that weren't yet defined:
100  *
101  * Example:
102  *
103  * \code
104  * class BitdefElectron_v2 : public BitdefElectron_v2
105  * {
106  * static const int NewBit;
107  * }
108  *
109  * \endcode
110  */
111 
112  public:
114  static const int NoErrorBit;
116  static const int ExecCutID;
118  static const int CutIDDec;
120  static const int RingerChainDec;
121 
123  static unsigned NUsedBits() { return m_nUsedBits; }
124 
125  private:
129  static int declareBit ATLAS_NOT_THREAD_SAFE (
130  const char* cutName,
131  const char* cutDescr)
132  {
133  int bit = ElectronTAccept_v1::m_accept.addCut(cutName,cutDescr);
134  ++m_nUsedBits;
135  return bit;
136  }
137 
138  // only modified by above "unsafe" method
139  static unsigned m_nUsedBits ATLAS_THREAD_SAFE;
140 
145 };
146 
147 // Definition of the current Electron TAccept version:
149 // And the Electron Bitdef as well:
151 
152 } // namespace Ringer
153 
154 #endif // RINGERSELECTORTOOLS_ELECTRONTACCEPT_H
155 
156 
157 #endif // RINGER_STANDALONE
Ringer::ElectronTAccept_v1::addLooseAppliedCuts
static void addLooseAppliedCuts(bitMskWord &word)
Add loose applied cuts to bitmask (IsEM mask):
Ringer::ElectronTAccept_v1::ATLAS_THREAD_SAFE
static asg::AcceptInfo m_accept ATLAS_THREAD_SAFE
The AcceptInfo:
Definition: ElectronTAccept.h:87
Ringer::BitdefElectron_v1::ATLAS_THREAD_SAFE
static unsigned m_nUsedBits ATLAS_THREAD_SAFE
Definition: ElectronTAccept.h:139
Ringer::ElectronTAccept_v1::getAppliedCutMsk
static unsigned int getAppliedCutMsk(const Requirement cut, bool withCutIDTrack=false)
Main methods.
Ringer::BitdefElectron_v1::BitdefElectron_v1
BitdefElectron_v1()
Standard ctor (ensure abstract class).
Ringer::BitdefElectron_v1::ExecCutID
static const int ExecCutID
Whether CutID was run:
Definition: ElectronTAccept.h:116
Ringer::ElectronTAccept_v1::addCutIDTrackAppliedCuts
static void addCutIDTrackAppliedCuts(bitMskWord &word)
Add CutID Track applied cuts to bitmask (IsEM mask):
Ringer::ElectronTAccept_v1
Get electron defined TAccept and its masks.
Definition: ElectronTAccept.h:25
Ringer::BitdefElectron_v1
Define electron bits (v1)
Definition: ElectronTAccept.h:94
Ringer::ElectronTAccept_v1::bitMskWord
std::bitset< asg::AcceptInfo::NBITS > bitMskWord
Bit mask word used.
Definition: ElectronTAccept.h:36
Ringer::ElectronTAccept_v1::resetMsk
static void resetMsk(bitMskWord &word)
Auxiliar methods.
Ringer::Requirement
Requirement
the cut requirement
Definition: RingerSelectorToolsEnums.h:104
Ringer::ElectronTAccept_v1::retrieveTAcceptTemplate
static const asg::AcceptInfo & retrieveTAcceptTemplate()
Retrieve copy of the ElectronTAccept_v1 template.
Definition: ElectronTAccept.h:52
asg::AcceptInfo
Definition: AcceptInfo.h:28
Ringer::BitdefElectron
BitdefElectron_v1 BitdefElectron
Definition: ElectronTAccept.h:150
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
RingerSelectorToolsDefs.h
Ringer::BitdefElectron_v1::NUsedBits
static unsigned NUsedBits()
Number of bits:
Definition: ElectronTAccept.h:123
Ringer::BitdefElectron_v1::CutIDDec
static const int CutIDDec
The decision position of the CutID:
Definition: ElectronTAccept.h:118
AcceptInfo.h
Ringer::ElectronTAccept_v1::addTightAppliedCuts
static void addTightAppliedCuts(bitMskWord &word)
Add tight applied cuts bitmask (IsEM mask):
Ringer::ElectronTAccept_v1::ElectronTAccept_v1
ElectronTAccept_v1()
Standard ctor (ensure abstract class).
Ringer::BitdefElectron_v1::RingerChainDec
static const int RingerChainDec
The decision position of the Ringer algorithm's discrimation chain:
Definition: ElectronTAccept.h:120
checker_macros.h
Define macros for attributes used to control the static checker.
Ringer::ElectronTAccept
ElectronTAccept_v1 ElectronTAccept
Definition: ElectronTAccept.h:148
Ringer::BitdefElectron_v1::NoErrorBit
static const int NoErrorBit
The decision position set to true when no error occurs:
Definition: ElectronTAccept.h:114
Ringer::BitdefElectron_v1::ATLAS_NOT_THREAD_SAFE
static int declareBit ATLAS_NOT_THREAD_SAFE(const char *cutName, const char *cutDescr)
Declare bit to ElectronTAccept_v1 word.
Definition: ElectronTAccept.h:129
Ringer::ElectronTAccept_v1::addMediumAppliedCuts
static void addMediumAppliedCuts(bitMskWord &word)
Add medium applied cuts to bitmask (IsEM mask):
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9