ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
JetMatch.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
* JetMatch.cpp
6
* Created by V.Sorin, Joerg Stelzer on 11/16/12.
7
*
8
* @brief algorithm calculates mult of jets passing cuts on 8x8 and 4x4 sizes, cut on mult of jets
9
*
10
* @param NumberLeading
11
**********************************/
12
13
#include <cmath>
14
15
#include "
L1TopoAlgorithms/JetMatch.h
"
16
#include "
L1TopoCommon/Exception.h
"
17
#include "
L1TopoInterfaces/Decision.h
"
18
19
20
REGISTER_ALG_TCS
(JetMatch)
21
22
23
// not the best solution but we will move to athena where this comes for free
24
#define LOG std::cout << name() << ": "
25
26
27
TCS::JetMatch::JetMatch
(
const
std::string &
name
) :
DecisionAlg
(
name
)
28
{
29
defineParameter
(
"InputWidth"
, 3);
30
defineParameter
(
"MaxTob"
, 0);
31
defineParameter
(
"NumResultBits"
, 1);
32
defineParameter
(
"MinET1"
,0);
33
defineParameter
(
"MinET2"
,0);
34
defineParameter
(
"EtaMin"
,0);
35
defineParameter
(
"EtaMax"
,49);
36
setNumberOutputBits
(1);
37
}
38
39
TCS::JetMatch::~JetMatch
()
40
{}
41
42
43
TCS::StatusCode
44
TCS::JetMatch::initialize
() {
45
p_NumberLeading1
=
parameter
(
"InputWidth"
).value();
46
if
(
parameter
(
"MaxTob"
).value() > 0)
p_NumberLeading1
=
parameter
(
"MaxTob"
).value();
47
p_MinET1
=
parameter
(
"MinET1"
).value();
48
p_MinET2
=
parameter
(
"MinET2"
).value();
49
p_EtaMin
=
parameter
(
"EtaMin"
).value();
50
p_EtaMax
=
parameter
(
"EtaMax"
).value();
51
52
TRG_MSG_INFO
(
"MaxTob : "
<<
p_NumberLeading1
);
53
TRG_MSG_INFO
(
"MinET1 : "
<<
p_MinET1
);
54
TRG_MSG_INFO
(
"MinET2 : "
<<
p_MinET2
);
55
TRG_MSG_INFO
(
"EtaMin : "
<<
p_EtaMin
);
56
TRG_MSG_INFO
(
"EtaMax : "
<<
p_EtaMax
);
57
TRG_MSG_INFO
(
"number output : "
<<
numberOutputBits
());
58
return
StatusCode::SUCCESS
;
59
}
60
61
TCS::StatusCode
62
TCS::JetMatch::processBitCorrect
(
const
std::vector<TCS::TOBArray const *> & input,
63
const
std::vector<TCS::TOBArray *> & output,
64
Decision
& decision )
65
66
{
67
return
process
(input,output,decision);
68
}
69
70
71
TCS::StatusCode
72
TCS::JetMatch::process
(
const
std::vector<TCS::TOBArray const *> & input,
73
const
std::vector<TCS::TOBArray *> & output,
74
Decision
& decision )
75
{
76
77
if
(input.size()!=1) {
78
TCS_EXCEPTION
(
"JetMatch alg must have exactly 1 input list, but got "
<< input.size());
79
}
80
81
// vector of passing tob
82
std::vector<TCS::GenericTOB*> TOBvector;
83
84
// loop over all jets
85
unsigned
int
objC(0);
86
for
(
TCS::GenericTOB
* tob : *input[0]) {
87
++objC;
88
89
if
(
parType_t
(std::abs(tob->eta())) >
p_EtaMax
)
continue
;
// Eta cut
90
if
(
parType_t
(std::abs(tob->eta())) <
p_EtaMin
)
continue
;
// Eta cut
91
if
( tob->EtWide() <=
p_MinET1
)
continue
;
// E_T cut
92
93
if
( tob->EtNarrow() <=
p_MinET2
)
continue
;
// E_T cut
94
95
TRG_MSG_DEBUG
(
"Jet "
<< objC-1 <<
": ETWide = "
<< tob->EtWide() <<
", ETNarrow = "
<< tob->EtNarrow());
96
97
// keep a list of all TOB that contributed
98
TOBvector.push_back( tob );
99
100
}
101
102
for
(
unsigned
int
i=0; i<
numberOutputBits
(); ++i) {
103
104
bool
accept = TOBvector.size() >=
p_NumberLeading1
;
105
106
decision.
setBit
( i, accept );
107
108
if
(accept)
109
output[i]->push_back(
TCS::CompositeTOB
(TOBvector));
110
111
TRG_MSG_DEBUG
(
"Decision "
<< i <<
": "
<< (accept?
"pass"
:
"fail"
) <<
" Njets = "
<< TOBvector.size());
112
113
}
114
115
return
TCS::StatusCode::SUCCESS
;
116
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Decision.h
JetMatch.h
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::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::GenericTOB
Definition
GenericTOB.h:35
TCS::JetMatch::initialize
virtual StatusCode initialize()
Definition
JetMatch.cxx:44
TCS::JetMatch::p_MinET2
parType_t p_MinET2
Definition
JetMatch.h:35
TCS::JetMatch::p_EtaMax
parType_t p_EtaMax
Definition
JetMatch.h:37
TCS::JetMatch::~JetMatch
virtual ~JetMatch()
Definition
JetMatch.cxx:39
TCS::JetMatch::p_MinET1
parType_t p_MinET1
Definition
JetMatch.h:34
TCS::JetMatch::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
JetMatch.cxx:62
TCS::JetMatch::JetMatch
JetMatch(const std::string &name)
Definition
JetMatch.cxx:27
TCS::JetMatch::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
JetMatch.cxx:72
TCS::JetMatch::p_EtaMin
parType_t p_EtaMin
Definition
JetMatch.h:36
TCS::JetMatch::p_NumberLeading1
parType_t p_NumberLeading1
Definition
JetMatch.h:33
TCS::StatusCode
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
process
const std::string process
Definition
fbtTestBasics.cxx:76
TCS::parType_t
uint32_t parType_t
Definition
Parameter.h:23
Generated on
for ATLAS Offline Software by
1.17.0