ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
eTauMultiplicity.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
* eTauMultiplicity.cpp
6
* Created by Carlos Moreno on 05/06/20.
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
#include <cmath>
16
17
#include "
L1TopoAlgorithms/eTauMultiplicity.h
"
18
#include "
L1TopoCommon/Exception.h
"
19
#include "
L1TopoInterfaces/Count.h
"
20
21
#include "
L1TopoEvent/TOBArray.h
"
22
#include "
L1TopoEvent/eTauTOBArray.h
"
23
24
REGISTER_ALG_TCS
(eTauMultiplicity)
25
26
using namespace
std
;
27
28
29
TCS::eTauMultiplicity::eTauMultiplicity
(
const
std::string &
name
) :
CountingAlg
(
name
)
30
{
31
32
33
setNumberOutputBits
(12);
//To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
34
35
}
36
37
TCS::eTauMultiplicity::~eTauMultiplicity
(){}
38
39
40
TCS::StatusCode
41
TCS::eTauMultiplicity::initialize
() {
42
43
m_threshold
=
getThreshold
();
44
45
// book histograms
46
std::string hname_accept =
"eTauMultiplicity_accept_EtaPt_"
+
m_threshold
->name();
47
bookHistMult
(
m_histAccept
, hname_accept,
"Mult_"
+
m_threshold
->name(),
"#eta#times40"
,
"E_{t} [GeV]"
, 200, -200, 200, 100, 0, 100);
48
49
hname_accept =
"eTauMultiplicity_accept_counts_"
+
m_threshold
->name();
50
bookHistMult
(
m_histAccept
, hname_accept,
"Mult_"
+
m_threshold
->name(),
"counts"
, 15, 0, 15);
51
52
return
StatusCode::SUCCESS
;
53
54
}
55
56
57
TCS::StatusCode
58
TCS::eTauMultiplicity::processBitCorrect
(
const
TCS::InputTOBArray
& input,
59
Count
&
count
)
60
61
{
62
return
process
(input,
count
);
63
}
64
65
TCS::StatusCode
66
TCS::eTauMultiplicity::process
(
const
TCS::InputTOBArray
& input,
67
Count
&
count
)
68
{
69
70
// Grab the threshold and cast it into the right type
71
const
auto
& eTAUThr =
dynamic_cast<
const
TrigConf::L1Threshold_eTAU
&
>
(*m_threshold);
72
73
// Grab inputs
74
const
eTauTOBArray
& etaus =
dynamic_cast<
const
eTauTOBArray
&
>
(input);
75
76
int
counting = 0;
77
78
// loop over input TOBs
79
for
(
eTauTOBArray::const_iterator
etau = etaus.
begin
();
80
etau != etaus.
end
();
81
++etau ) {
82
83
// Menu threshold uses 0.1 eta granularity but eFex objects have 0.025 eta granularity
84
// eFex eta is calculated as 4*eta_tower (0.1 gran.) + seed (0.025 gran.), eta from -25 to 24
85
int
eta_thr;
86
if
( (*etau)->eta()%4 >= 0 ) { eta_thr = (*etau)->eta() - (*etau)->eta()%4; }
87
else
{ eta_thr = (*etau)->eta() - (*etau)->eta()%4 - 4; }
88
89
bool
passed
= (*etau)->Et() > eTAUThr.thrValue100MeV(eta_thr/4);
// Convert eta_thr to units of 0.1 to pass as an argument
90
91
if
( !
isocut
(
TrigConf::Selection::wpToString
(eTAUThr.rCore()), (*etau)->rCore()) ) {
continue
;}
92
if
( !
isocut
(
TrigConf::Selection::wpToString
(eTAUThr.rHad()), (*etau)->rHad()) ) {
continue
;}
93
94
if
(
passed
) {
95
counting++;
96
fillHist2D
(
m_histAccept
[0], (*etau)->eta(), (*etau)->EtDouble() );
97
}
98
99
}
100
101
fillHist1D
(
m_histAccept
[1], counting);
102
103
// Pass counting to TCS::Count object - output bits are composed there
104
count
.setSizeCount(counting);
105
106
return
TCS::StatusCode::SUCCESS
;
107
108
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Count.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::isocut
bool isocut(const std::string &threshold, const unsigned int bit) const
Definition
ConfigurableAlg.cxx:487
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::ConfigurableAlg::fillHist2D
void fillHist2D(const std::string &histName, double x, double y)
Definition
ConfigurableAlg.cxx:474
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< eTauTOB >::const_iterator
data_t::const_iterator const_iterator
Definition
DataArrayImpl.h:18
TCS::DataArrayImpl::end
iterator end()
Definition
DataArrayImpl.h:43
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::eTauMultiplicity::~eTauMultiplicity
virtual ~eTauMultiplicity()
Definition
eTauMultiplicity.cxx:37
TCS::eTauMultiplicity::process
virtual StatusCode process(const TCS::InputTOBArray &input, Count &count) override final
Definition
eTauMultiplicity.cxx:66
TCS::eTauMultiplicity::initialize
virtual StatusCode initialize() override
Definition
eTauMultiplicity.cxx:41
TCS::eTauMultiplicity::processBitCorrect
virtual StatusCode processBitCorrect(const TCS::InputTOBArray &input, Count &count) override final
Definition
eTauMultiplicity.cxx:58
TCS::eTauMultiplicity::eTauMultiplicity
eTauMultiplicity(const std::string &name)
Definition
eTauMultiplicity.cxx:29
TCS::eTauMultiplicity::m_threshold
TrigConf::L1Threshold const * m_threshold
Definition
eTauMultiplicity.h:39
TCS::eTauTOBArray
Definition
eTauTOBArray.h:14
TrigConf::L1Threshold_eTAU
Definition
L1Threshold.h:217
TrigConf::Selection::wpToString
static std::string wpToString(WP)
Definition
L1ThresholdBase.cxx:347
eTauMultiplicity.h
eTauTOBArray.h
process
const std::string process
Definition
fbtTestBasics.cxx:76
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
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0