ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
Multiplicity.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
* Multiplicity.cpp
6
* Created by Joerg Stelzer on 11/16/12.
7
* Modified by V SOrin 2014
8
*
9
* @brief algorithm that check muon multiplicity and return 2 output lines, which will give information on how many muons were found
10
* line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
11
*
12
* @param NumberLeading
13
**********************************/
14
15
#include <cmath>
16
17
#include "
L1TopoAlgorithms/Multiplicity.h
"
18
#include "
L1TopoCommon/Exception.h
"
19
#include "
L1TopoInterfaces/Decision.h
"
20
21
REGISTER_ALG_TCS
(Multiplicity)
22
23
24
TCS
::
Multiplicity
::
Multiplicity
(
const
std
::
string
&
name
) :
DecisionAlg
(
name
)
25
{
26
defineParameter
(
"InputWidth"
, 3);
27
defineParameter
(
"NumResultBits"
, 2);
28
defineParameter
(
"MinET"
,1);
29
setNumberOutputBits
(2);
30
}
31
32
TCS::Multiplicity::~Multiplicity
(){}
33
34
35
TCS::StatusCode
36
TCS::Multiplicity::initialize
() {
37
p_NumberLeading1
=
parameter
(
"InputWidth"
).value();
38
p_MinET
=
parameter
(
"MinET"
).value();
39
40
TRG_MSG_INFO
(
"NumberLeading1 : "
<<
p_NumberLeading1
);
// note that the reading of generic parameters doesn't work yet
41
TRG_MSG_INFO
(
"MinET : "
<<
p_MinET
);
42
TRG_MSG_INFO
(
"number output : "
<<
numberOutputBits
());
43
44
return
StatusCode::SUCCESS
;
45
}
46
47
TCS::StatusCode
48
TCS::Multiplicity::processBitCorrect
(
const
std::vector<TCS::TOBArray const *> & input,
49
const
std::vector<TCS::TOBArray *> & output,
50
Decision
& decision )
51
52
{
53
return
process
(input,output,decision);
54
}
55
56
57
58
TCS::StatusCode
59
TCS::Multiplicity::process
(
const
std::vector<TCS::TOBArray const *> & input,
60
const
std::vector<TCS::TOBArray *> & output,
61
Decision
& decision )
62
{
63
64
if
(input.size() == 1) {
65
66
// loop over muons
67
unsigned
int
nLeading =
p_NumberLeading1
;
68
69
// counter
70
int
nmuon = 0;
71
// vector of tobs passing cuts
72
std::vector<TCS::GenericTOB*> TOBvector;
73
74
for
(
TOBArray::const_iterator
tob1 = input[0]->begin();
75
tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
76
++tob1)
77
{
78
79
if
(
parType_t
((*tob1)->Et()) <=
p_MinET
)
continue
;
// E_T cut
80
//
81
TRG_MSG_DEBUG
(
"Muon : ET = "
<<
parType_t
((*tob1)->Et()));
82
++nmuon;
83
// keep a list of all TOB that contributed
84
TOBvector.push_back( *tob1 );
85
86
}
87
//
88
89
90
91
if
(nmuon == 0 or nmuon == 2) decision.
setBit
( 0,
false
);
92
if
(nmuon == 1 or nmuon > 2) decision.
setBit
( 0,
true
);
93
if
(nmuon < 2 ) decision.
setBit
( 1,
false
);
94
if
(nmuon > 1 ) decision.
setBit
( 1,
true
);
95
96
if
(nmuon == 1) output[0]->push_back(
TCS::CompositeTOB
(TOBvector));
97
else
if
(nmuon > 1 ) output[1]->push_back(
TCS::CompositeTOB
(TOBvector));
98
99
}
else
{
100
101
TCS_EXCEPTION
(
"Multiplicity alg must have 1 input, but got "
<< input.size());
102
103
}
104
return
TCS::StatusCode::SUCCESS
;
105
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Decision.h
Multiplicity.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::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::Multiplicity::p_MinET
parType_t p_MinET
Definition
Multiplicity.h:35
TCS::Multiplicity::p_NumberLeading1
parType_t p_NumberLeading1
Definition
Multiplicity.h:34
TCS::Multiplicity::Multiplicity
Multiplicity(const std::string &name)
Definition
Multiplicity.cxx:24
TCS::Multiplicity::~Multiplicity
virtual ~Multiplicity()
Definition
Multiplicity.cxx:32
TCS::Multiplicity::initialize
virtual StatusCode initialize()
Definition
Multiplicity.cxx:36
TCS::Multiplicity::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
Multiplicity.cxx:59
TCS::Multiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
Definition
Multiplicity.cxx:48
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
const
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