ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
LAr.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*********************************
5
* LAr.cpp
6
* Created by Joerg Stelzer on 11/16/12.
7
* Modified by V SOrin 2014
8
*
9
* @brief algorithm calculates the phi-distance between one lists and applies delta-phi criteria
10
*
11
* @param NumberLeading
12
**********************************/
13
14
#include <cmath>
15
16
#include "
L1TopoAlgorithms/LAr.h
"
17
#include "
L1TopoCommon/Exception.h
"
18
#include "
L1TopoInterfaces/Decision.h
"
19
20
REGISTER_ALG_TCS
(
LAr
)
21
22
23
TCS
::
LAr
::
LAr
(
const
std
::
string
&
name
) :
DecisionAlg
(
name
)
24
{
25
defineParameter
(
"InputWidth"
, 3);
26
defineParameter
(
"MaxTob"
, 0);
27
defineParameter
(
"NumResultBits"
, 1);
28
defineParameter
(
"PhiMin"
, 0);
29
defineParameter
(
"PhiMax"
, 63);
30
defineParameter
(
"EtaMin"
, 0);
31
defineParameter
(
"EtaMax"
, 5);
32
defineParameter
(
"MinET"
,1);
33
setNumberOutputBits
(1);
34
}
35
36
TCS::LAr::~LAr
(){}
37
38
39
TCS::StatusCode
40
TCS::LAr::initialize
() {
41
p_NumberLeading1
=
parameter
(
"InputWidth"
).value();
42
if
(
parameter
(
"MaxTob"
).value() > 0)
p_NumberLeading1
=
parameter
(
"MaxTob"
).value();
43
p_PhiMin
=
parameter
(
"PhiMin"
).value();
44
p_PhiMax
=
parameter
(
"PhiMax"
).value();
45
p_EtaMin
=
parameter
(
"EtaMin"
).value();
46
p_EtaMax
=
parameter
(
"EtaMax"
).value();
47
p_MinET
=
parameter
(
"MinET"
).value();
48
49
TRG_MSG_INFO
(
"NumberLeading1 : "
<<
p_NumberLeading1
);
// note that the reading of generic parameters doesn't work yet
50
TRG_MSG_INFO
(
"PhiMin : "
<<
p_PhiMin
);
51
TRG_MSG_INFO
(
"PhiMax : "
<<
p_PhiMax
);
52
TRG_MSG_INFO
(
"EtaMin : "
<<
p_EtaMin
);
53
TRG_MSG_INFO
(
"EtaMax : "
<<
p_EtaMax
);
54
TRG_MSG_INFO
(
"MinET : "
<<
p_MinET
);
55
TRG_MSG_INFO
(
"nummber output : "
<<
numberOutputBits
());
56
57
return
StatusCode::SUCCESS
;
58
}
59
60
TCS::StatusCode
61
TCS::LAr::processBitCorrect
(
const
std::vector<TCS::TOBArray const *> & input,
62
const
std::vector<TCS::TOBArray *> & output,
63
Decision
& decision )
64
65
{
66
if
(input.size() == 1) {
67
68
TRG_MSG_DEBUG
(
"input size : "
<< input[0]->
size
());
69
70
unsigned
int
nLeading =
p_NumberLeading1
;
71
bool
accept{
false
};
72
73
for
(
TOBArray::const_iterator
tob1 = input[0]->begin();
74
tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
75
++tob1)
76
{
77
78
if
(
parType_t
((*tob1)->Et()) <=
p_MinET
)
continue
;
// ET cut
79
if
(
parType_t
((*tob1)->eta()) <=
p_EtaMin
)
continue
;
// ETa cut
80
if
(
parType_t
((*tob1)->eta()) >=
p_EtaMax
)
continue
;
// ETa cut
81
if
(
parType_t
(abs((*tob1)->phi())) <=
p_PhiMin
)
continue
;
// phi cut
82
if
(
parType_t
(abs((*tob1)->phi())) >=
p_PhiMax
)
continue
;
// phi cut
83
84
85
86
accept =
true
;
87
88
output[0]->push_back(
TCS::CompositeTOB
(*tob1));
89
90
TRG_MSG_DEBUG
(
"TOB "
<< distance(input[0]->begin(), tob1) <<
" ET = "
<< (*tob1)->Et() <<
" ETa = "
<< (*tob1)->eta() <<
" phi = "
<< (*tob1)->phi() );
91
}
92
93
decision.
setBit
( 0, accept );
94
95
96
97
}
else
{
98
99
TCS_EXCEPTION
(
"LAr alg must have 1 input, but got "
<< input.size());
100
101
}
102
return
TCS::StatusCode::SUCCESS
;
103
}
104
105
106
TCS::StatusCode
107
TCS::LAr::process
(
const
std::vector<TCS::TOBArray const *> & input,
108
const
std::vector<TCS::TOBArray *> & output,
109
Decision
& decision )
110
{
111
112
if
(input.size() == 1) {
113
114
TRG_MSG_DEBUG
(
"input size : "
<< input[0]->
size
());
115
116
unsigned
int
nLeading =
p_NumberLeading1
;
117
bool
accept{
false
};
118
119
for
(
TOBArray::const_iterator
tob1 = input[0]->begin();
120
tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
121
++tob1)
122
{
123
124
if
(
parType_t
((*tob1)->Et()) <=
p_MinET
)
continue
;
// ET cut
125
if
(
parType_t
((*tob1)->eta()) <=
p_EtaMin
)
continue
;
// ETa cut
126
if
(
parType_t
((*tob1)->eta()) >=
p_EtaMax
)
continue
;
// ETa cut
127
if
(
parType_t
(abs((*tob1)->phi())) <=
p_PhiMin
)
continue
;
// phi cut
128
if
(
parType_t
(abs((*tob1)->phi())) >=
p_PhiMax
)
continue
;
// phi cut
129
130
131
132
accept =
true
;
133
134
output[0]->push_back(
TCS::CompositeTOB
(*tob1));
135
136
TRG_MSG_DEBUG
(
"TOB "
<< distance(input[0]->begin(), tob1) <<
" ET = "
<< (*tob1)->Et() <<
" ETa = "
<< (*tob1)->eta() <<
" phi = "
<< (*tob1)->phi() );
137
}
138
139
decision.
setBit
( 0, accept );
140
141
142
143
}
else
{
144
145
TCS_EXCEPTION
(
"LAr alg must have 1 input, but got "
<< input.size());
146
147
}
148
return
TCS::StatusCode::SUCCESS
;
149
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Decision.h
LAr.h
size
size_t size() const
Number of registered mappings.
TRG_MSG_INFO
#define TRG_MSG_INFO(x)
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:27
TRG_MSG_DEBUG
#define TRG_MSG_DEBUG(x)
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:25
Exception.h
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:15
TCS::CompositeTOB
Definition
CompositeTOB.h:16
TCS::ConfigurableAlg::name
const std::string & name() const
Definition
ConfigurableAlg.h:49
TCS::ConfigurableAlg::parameter
const Parameter & parameter(std::string_view parameterName) const
Definition
ConfigurableAlg.cxx:245
TCS::ConfigurableAlg::defineParameter
void defineParameter(std::string_view name, TCS::parType_t value)
Definition
ConfigurableAlg.cxx:203
TCS::DataArrayImpl< GenericTOB >::const_iterator
data_t::const_iterator const_iterator
Definition
DataArrayImpl.h:18
TCS::DecisionAlg::setNumberOutputBits
void setNumberOutputBits(unsigned int numberOutputBits)
Definition
DecisionAlg.h:39
TCS::DecisionAlg::DecisionAlg
DecisionAlg(const std::string &name)
Definition
DecisionAlg.h:24
TCS::DecisionAlg::numberOutputBits
unsigned int numberOutputBits() const
Definition
DecisionAlg.h:38
TCS::Decision
Definition
Decision.h:19
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition
Decision.cxx:12
TCS::LAr::p_NumberLeading1
parType_t p_NumberLeading1
Definition
LAr.h:34
TCS::LAr::~LAr
virtual ~LAr()
Definition
LAr.cxx:36
TCS::LAr::p_EtaMax
parType_t p_EtaMax
Definition
LAr.h:37
TCS::LAr::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
LAr.cxx:61
TCS::LAr::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
LAr.cxx:107
TCS::LAr::p_EtaMin
parType_t p_EtaMin
Definition
LAr.h:36
TCS::LAr::p_PhiMin
parType_t p_PhiMin
Definition
LAr.h:39
TCS::LAr::p_MinET
parType_t p_MinET
Definition
LAr.h:35
TCS::LAr::initialize
virtual StatusCode initialize()
Definition
LAr.cxx:40
TCS::LAr::p_PhiMax
parType_t p_PhiMax
Definition
LAr.h:38
TCS::StatusCode
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
const
LAr
Definition
LArVolumeBuilder.h:37
TCS
Definition
AnomalyDetectionBDT.h:18
TCS::parType_t
uint32_t parType_t
Definition
Parameter.h:23
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0