ATLAS Offline Software
TRIGGERidentity.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iomanip>
8 
10 
11 const char TRIGGERidentity::s_type_tag[NTYPE][8] = {{"no"}, {"low Pt"}, {"high Pt"}};
12 const char TRIGGERidentity::s_threshold_tag[NTHRESHOLD][7] = {{"first"}, {"second"}, {"third"}};
13 const float TRIGGERidentity::s_pt_value[NTYPE][NTHRESHOLD] = {{0., 0., 0.}, {6., 8., 10.}, {11., 20., 40.}};
14 
16 
17 TRIGGERidentity::TRIGGERidentity() : m_type(None), m_threshold(FirstTh), m_overlap(false) {}
18 
20 
21 TRIGGERidentity::TRIGGERidentity(const TRIGGERidentity& id) : m_type(id.type()), m_threshold(id.threshold()), m_overlap(id.overlap()) {}
22 
24  if (this != &id) {
25  m_type = id.type();
26  m_threshold = id.threshold();
27  m_overlap = id.overlap();
28  }
29  return *this;
30 }
31 
33  if (m_type == id.type() && m_threshold == id.threshold() && m_overlap == id.overlap())
34  return true;
35  else
36  return false;
37 }
38 
39 bool TRIGGERidentity::operator!=(const TRIGGERidentity& id) const { return !(*this == id); }
40 
42  if (m_type < id.type()) return true;
43  if (m_type == id.type()) {
44  if (m_threshold < id.threshold()) return true;
45  if (m_threshold == id.threshold()) {
46  if (m_overlap < id.overlap()) return true;
47  }
48  }
49  return false;
50 }
51 
52 TRIGGERidentity::operator bool() {
53  if (m_type == None)
54  return false;
55  else
56  return true;
57 }
58 
59 bool TRIGGERidentity::operator!() { return !(bool)*this; }
60 
62  if (type == High) {
63  if (m_type == High && m_threshold == SecondTh) return true;
64  }
65  if (type == Low) {
66  if (m_type == Low && m_threshold == ThirdTh) return true;
67  }
68  return false;
69 }
70 
72  TRIGGERidentity maxLow(Low, ThirdTh, false);
73  if (*this < maxLow)
74  return false;
75  else
76  return true;
77 }
78 
79 void TRIGGERidentity::Print(std::ostream& stream, bool detail) const {
80  detail = true;
81  if (detail) {
82  stream << s_type_tag[type()] << " trigger, " << s_threshold_tag[threshold()] << " threshold fired (" << std::setw(4)
83  << s_pt_value[type()][threshold()] << " GeV), overlap flag ";
84  if (overlap())
85  stream << "ON";
86  else
87  stream << "OFF";
88  }
89 }
TrigType
TrigType
Definition: TRIGGERidentity.h:17
ThirdTh
@ ThirdTh
Definition: TRIGGERidentity.h:18
TRIGGERidentity::m_threshold
Threshold m_threshold
Definition: TRIGGERidentity.h:28
TRIGGERidentity::operator!
bool operator!()
Definition: TRIGGERidentity.cxx:59
TRIGGERidentity
Definition: TRIGGERidentity.h:20
NTYPE
#define NTYPE
Definition: TRIGGERidentity.h:14
TRIGGERidentity::s_pt_value
static const float s_pt_value[NTYPE][NTHRESHOLD]
Definition: TRIGGERidentity.h:24
detail
Definition: extract_histogram_tag.cxx:14
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
SecondTh
@ SecondTh
Definition: TRIGGERidentity.h:18
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
TRIGGERidentity::operator!=
bool operator!=(const TRIGGERidentity &) const
Definition: TRIGGERidentity.cxx:39
CaloCellPos2Ntuple.None
None
Definition: CaloCellPos2Ntuple.py:23
TRIGGERidentity.h
TRIGGERidentity::Print
void Print(std::ostream &, bool) const
Definition: TRIGGERidentity.cxx:79
master.flag
bool flag
Definition: master.py:29
TRIGGERidentity::TRIGGERidentity
TRIGGERidentity()
Definition: TRIGGERidentity.cxx:17
TRIGGERidentity::m_type
TrigType m_type
Definition: TRIGGERidentity.h:27
TRIGGERidentity::m_overlap
bool m_overlap
Definition: TRIGGERidentity.h:29
TRIGGERidentity::overlap
bool overlap(void) const
Definition: TRIGGERidentity.h:46
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
threshold
Definition: chainparser.cxx:74
Low
@ Low
Definition: TRIGGERidentity.h:17
TRIGGERidentity::s_type_tag
static const char s_type_tag[NTYPE][8]
Definition: TRIGGERidentity.h:22
TRIGGERidentity::s_threshold_tag
static const char s_threshold_tag[NTHRESHOLD][7]
Definition: TRIGGERidentity.h:23
NTHRESHOLD
#define NTHRESHOLD
Definition: TRIGGERidentity.h:15
TRIGGERidentity::highest
bool highest(TrigType) const
Definition: TRIGGERidentity.cxx:61
Threshold
Threshold
Definition: TRIGGERidentity.h:18
High
@ High
Definition: TRIGGERidentity.h:17
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TRIGGERidentity::searchForHigh
bool searchForHigh(void) const
Definition: TRIGGERidentity.cxx:71
TRIGGERidentity::operator=
TRIGGERidentity & operator=(const TRIGGERidentity &)
Definition: TRIGGERidentity.cxx:23
TRIGGERidentity::operator==
bool operator==(const TRIGGERidentity &) const
Definition: TRIGGERidentity.cxx:32
TRIGGERidentity::threshold
Threshold threshold(void) const
Definition: TRIGGERidentity.h:45
TRIGGERidentity::type
TrigType type(void) const
Definition: TRIGGERidentity.h:44
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
FirstTh
@ FirstTh
Definition: TRIGGERidentity.h:18
TRIGGERidentity::operator<
bool operator<(const TRIGGERidentity &) const
Definition: TRIGGERidentity.cxx:41