ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
EnergyThreshold.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*********************************
5
* EnergyThreshold.cpp
6
* Created by Jack Harrison on 16/12/21.
7
*
8
* @brief algorithm that computes the multiplicity for a specified list and ET threshold
9
* line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
10
*
11
* @param NumberLeading MinET
12
13
**********************************/
14
15
16
#include <
L1TopoAlgorithms/EnergyThreshold.h
>
17
#include "
L1TopoCommon/Exception.h
"
18
#include "
L1TopoInterfaces/Count.h
"
19
#include "
L1TopoEvent/TOBArray.h
"
20
#include "
L1TopoEvent/jXETOBArray.h
"
21
#include "
L1TopoEvent/jTETOBArray.h
"
22
#include "
L1TopoEvent/gXETOBArray.h
"
23
#include "
L1TopoEvent/gTETOBArray.h
"
24
#include <cmath>
25
26
27
REGISTER_ALG_TCS
(EnergyThreshold)
28
29
using namespace
std
;
30
31
TCS::EnergyThreshold::EnergyThreshold
(
const
std::string &
name
) :
CountingAlg
(
name
) {
32
33
setNumberOutputBits
(12);
//To-Do: Make this flexible to adapt to the menu. Each counting requires more than one bit
34
35
}
36
37
38
TCS::StatusCode
TCS::EnergyThreshold::initialize
(){
39
40
41
m_threshold
=
getThreshold
();
42
43
// book histograms
44
std::string hname_accept =
"EnergyThreshold_accept_EtaPt_"
+
m_threshold
->name();
45
bookHistMult
(
m_histAccept
, hname_accept,
"Mult_"
+
m_threshold
->name(),
"E_{t} [GeV]"
, 200, 0, 1000);
46
47
hname_accept =
"EnergyThreshold_accept_counts_"
+
m_threshold
->name();
48
bookHistMult
(
m_histAccept
, hname_accept,
"Mult_"
+
m_threshold
->name(),
"counts"
, 15, 0, 15);
49
50
return
StatusCode::SUCCESS
;
51
52
}
53
54
TCS::StatusCode
TCS::EnergyThreshold::processBitCorrect
(
const
TCS::InputTOBArray
& input,
55
Count
&
count
){
56
return
process
(input,
count
);
57
}
58
59
60
TCS::StatusCode
TCS::EnergyThreshold::process
(
const
TCS::InputTOBArray
& input,
61
Count
&
count
)
62
{
63
64
65
if
(
m_threshold
->type() ==
"jXE"
) {
66
67
// Grab the threshold and cast it into the right type
68
const
auto
& jXEThr =
dynamic_cast<
const
TrigConf::L1Threshold_jXE
&
>
(*m_threshold);
69
// Grab inputs
70
const
jXETOBArray
& jXEArray =
dynamic_cast<
const
jXETOBArray
&
>
(input);
71
72
int
counting = 0;
73
74
// Loop over input TOBs
75
for
(
jXETOBArray::const_iterator
jxe = jXEArray.
begin
();
76
jxe != jXEArray.
end
();
77
++jxe ) {
78
79
bool
passed
= (*jxe)->Et2() > std::pow(jXEThr.thrValue100MeV(), 2);
80
if
(
passed
) {
81
counting++;
82
fillHist1D
(
m_histAccept
[0], ((*jxe)->EtDouble()));
83
}
84
}
85
86
fillHist1D
(
m_histAccept
[1], counting);
87
88
// Pass counting to TCS::Count object - output bits are composed there
89
count
.setSizeCount(counting);
90
91
}
92
93
else
if
(
m_threshold
->type() ==
"jTE"
) {
94
95
// Grab the threshold and cast it into the right type
96
const
auto
& jTEThr =
dynamic_cast<
const
TrigConf::L1Threshold_jTE
&
>
(*m_threshold);
97
// Grab inputs
98
const
jTETOBArray
& jTEArray =
dynamic_cast<
const
jTETOBArray
&
>
(input);
99
100
int
counting = 0;
101
102
// Loop over input TOBs
103
for
(
jTETOBArray::const_iterator
jte = jTEArray.
begin
();
104
jte != jTEArray.
end
();
105
++jte ) {
106
107
bool
passed
= (*jte)->sumEt() > jTEThr.thrValue100MeV();
108
if
(
passed
) {
109
counting++;
110
fillHist1D
(
m_histAccept
[0], ((*jte)->sumEtDouble()));
111
}
112
}
113
114
fillHist1D
(
m_histAccept
[1], counting);
115
116
// Pass counting to TCS::Count object - output bits are composed there
117
count
.setSizeCount(counting);
118
119
}
120
121
else
if
(
m_threshold
->type() ==
"gXE"
) {
122
123
// Grab the threshold and cast it into the right type
124
const
auto
& gXEThr =
dynamic_cast<
const
TrigConf::L1Threshold_gXE
&
>
(*m_threshold);
125
// Grab inputs
126
const
gXETOBArray
& gXEArray =
dynamic_cast<
const
gXETOBArray
&
>
(input);
127
128
int
counting = 0;
129
130
// Loop over input TOBs
131
for
(
gXETOBArray::const_iterator
gxe = gXEArray.
begin
();
132
gxe != gXEArray.
end
();
133
++gxe ) {
134
135
bool
passed
= (*gxe)->Et2() > std::pow(gXEThr.thrValue100MeV(), 2);
136
if
(
passed
) {
137
counting++;
138
fillHist1D
(
m_histAccept
[0], ((*gxe)->EtDouble()));
139
}
140
}
141
142
fillHist1D
(
m_histAccept
[1], counting);
143
144
// Pass counting to TCS::Count object - output bits are composed there
145
count
.setSizeCount(counting);
146
147
}
148
149
else
if
(
m_threshold
->type() ==
"gTE"
) {
150
151
// Grab the threshold and cast it into the right type
152
const
auto
& gTEThr =
dynamic_cast<
const
TrigConf::L1Threshold_gTE
&
>
(*m_threshold);
153
// Grab inputs
154
const
gTETOBArray
& gTEArray =
dynamic_cast<
const
gTETOBArray
&
>
(input);
155
156
int
counting = 0;
157
158
// Loop over input TOBs
159
for
(
gTETOBArray::const_iterator
gte = gTEArray.
begin
();
160
gte != gTEArray.
end
();
161
++gte ) {
162
163
bool
passed
= (*gte)->sumEt() > gTEThr.thrValue100MeV();
164
if
(
passed
) {
165
counting++;
166
fillHist1D
(
m_histAccept
[0], ((*gte)->sumEtDouble()));
167
}
168
}
169
170
fillHist1D
(
m_histAccept
[1], counting);
171
172
// Pass counting to TCS::Count object - output bits are composed there
173
count
.setSizeCount(counting);
174
175
}
176
177
else
{ std::cout <<
"WARNING: threshold type "
<<
m_threshold
->type() <<
" not included in EnergyThreshold algorithm. Skipping."
<< std::endl; }
178
179
return
TCS::StatusCode::SUCCESS
;
180
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Count.h
EnergyThreshold.h
passed
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
Definition
TrigCompositeUtilsRoot.cxx:118
getThreshold
CP::CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger)
Definition
MuonTriggerSFRootCoreTest.cxx:44
TOBArray.h
Exception.h
TCS::ConfigurableAlg::name
const std::string & name() const
Definition
ConfigurableAlg.h:49
TCS::ConfigurableAlg::fillHist1D
void fillHist1D(const std::string &histName, double x)
Definition
ConfigurableAlg.cxx:470
TCS::ConfigurableAlg::bookHistMult
void bookHistMult(std::vector< std::string > ®Name, const std::string &name, const std::string &title, const std::string &xtitle, const int binx, const int xmin, const int xmax)
Definition
ConfigurableAlg.cxx:341
TCS::Count
Definition
Count.h:20
TCS::CountingAlg::m_histAccept
std::vector< std::string > m_histAccept
Definition
CountingAlg.h:51
TCS::CountingAlg::CountingAlg
CountingAlg(const std::string &name)
Definition
CountingAlg.h:28
TCS::CountingAlg::setNumberOutputBits
void setNumberOutputBits(unsigned int numberOutputBits)
Definition
CountingAlg.h:41
TCS::DataArrayImpl::begin
iterator begin()
Definition
DataArrayImpl.h:40
TCS::DataArrayImpl< jXETOB >::const_iterator
data_t::const_iterator const_iterator
Definition
DataArrayImpl.h:18
TCS::DataArrayImpl::end
iterator end()
Definition
DataArrayImpl.h:43
TCS::EnergyThreshold::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition
EnergyThreshold.cxx:60
TCS::EnergyThreshold::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition
EnergyThreshold.cxx:54
TCS::EnergyThreshold::m_threshold
TrigConf::L1Threshold const * m_threshold
Definition
EnergyThreshold.h:41
TCS::EnergyThreshold::initialize
virtual StatusCode initialize() override
Definition
EnergyThreshold.cxx:38
TCS::EnergyThreshold::EnergyThreshold
EnergyThreshold(const std::string &name)
Definition
EnergyThreshold.cxx:31
TCS::InputTOBArray
Definition
InputTOBArray.h:15
TCS::StatusCode
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::gTETOBArray
Definition
gTETOBArray.h:14
TCS::gXETOBArray
Definition
gXETOBArray.h:14
TCS::jTETOBArray
Definition
jTETOBArray.h:14
TCS::jXETOBArray
Definition
jXETOBArray.h:14
TrigConf::L1Threshold_gTE
Definition
L1Threshold.h:385
TrigConf::L1Threshold_gXE
Definition
L1Threshold.h:370
TrigConf::L1Threshold_jTE
Definition
L1Threshold.h:355
TrigConf::L1Threshold_jXE
Definition
L1Threshold.h:340
process
const std::string process
Definition
fbtTestBasics.cxx:76
gTETOBArray.h
gXETOBArray.h
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
jTETOBArray.h
jXETOBArray.h
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0