ATLAS Offline Software
Loading...
Searching...
No Matches
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
11const char TRIGGERidentity::s_type_tag[NTYPE][8] = {{"no"}, {"low Pt"}, {"high Pt"}};
12const char TRIGGERidentity::s_threshold_tag[NTHRESHOLD][7] = {{"first"}, {"second"}, {"third"}};
13const float TRIGGERidentity::s_pt_value[NTYPE][NTHRESHOLD] = {{0., 0., 0.}, {6., 8., 10.}, {11., 20., 40.}};
14
16
18
20
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
39bool 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
52TRIGGERidentity::operator bool() {
53 if (m_type == None)
54 return false;
55 else
56 return true;
57}
58
59bool 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
79void 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
@ High
@ Low
@ None
Threshold
@ SecondTh
@ FirstTh
@ ThirdTh
#define NTYPE
#define NTHRESHOLD
bool operator<(const TRIGGERidentity &) const
static const float s_pt_value[NTYPE][NTHRESHOLD]
bool searchForHigh(void) const
bool operator!=(const TRIGGERidentity &) const
void Print(std::ostream &, bool) const
bool highest(TrigType) const
Threshold threshold(void) const
bool overlap(void) const
bool operator==(const TRIGGERidentity &) const
TRIGGERidentity & operator=(const TRIGGERidentity &)
TrigType type(void) const
Threshold m_threshold
static const char s_type_tag[NTYPE][8]
static const char s_threshold_tag[NTHRESHOLD][7]