ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
TeATIME.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*********************************
5
* TeATIME.cpp
6
* Created by Jack Harrison on 23/05/25.
7
*
8
* @brief Total Energy Anti-Trigger for Imminent Massive Events / Total energy Ahead-of-Time Indicator for Massive Events:
9
* Dummy algorithm in simulation to allow athena to run properly, allowing FW algorithm comparing current (BC+0) with next (BC+1) TE values.
10
* Algorithm never fires, purely dummy in simulation, as we don't simulate BC+1 values.
11
*
12
* @param
13
**********************************/
14
15
16
17
#include "
L1TopoAlgorithms/TeATIME.h
"
18
#include "
L1TopoCommon/Exception.h
"
19
#include "
L1TopoInterfaces/Decision.h
"
20
21
REGISTER_ALG_TCS
(TeATIME)
22
23
24
TCS
::
TeATIME
::
TeATIME
(
const
std
::
string
&
name
) :
DecisionAlg
(
name
)
25
{
26
27
defineParameter
(
"InputWidth"
, 1);
28
defineParameter
(
"MaxTob"
, 0);
29
defineParameter
(
"NumResultBits"
, 4);
30
setNumberOutputBits
(4);
31
for
(
unsigned
int
i=0;i<
numberOutputBits
();i++){
32
// Algo parameters
33
defineParameter
(
"algoLogic"
, 0, i);
34
defineParameter
(
"nextBcFactor"
, 0, i);
35
defineParameter
(
"nextBcOffset"
, 0, i);
36
}
37
38
}
39
40
TCS::StatusCode
41
TCS::TeATIME::initialize
() {
42
43
// book histograms
44
for
(
unsigned
int
i=0; i<
numberOutputBits
(); ++i) {
45
std::string hname_accept =
"hTeATIME_accept_bit"
+std::to_string((
int
)i);
46
std::string hname_reject =
"hTeATIME_reject_bit"
+std::to_string((
int
)i);
47
bookHist
(
m_histAccept
, hname_accept,
"TeTIME accept"
, 1, 0, 2);
48
bookHist
(
m_histReject
, hname_reject,
"TeTIME accept"
, 1, 0, 2);
49
}
50
51
return
StatusCode::SUCCESS
;
52
}
53
54
55
TCS::StatusCode
56
TCS::TeATIME::processBitCorrect
(
const
std::vector<TCS::TOBArray const *> & input,
57
const
std::vector<TCS::TOBArray *> & output,
58
Decision
& decision )
59
{
60
if
(input.size() == 1) {
61
62
for
(
TOBArray::const_iterator
jte = input[0]->begin();
63
jte != input[0]->end();
64
++jte)
65
{
66
67
for
(
unsigned
int
i=0; i<
numberOutputBits
(); ++i) {
68
69
decision.
setBit
(i,
false
);
70
fillHist1D
(
m_histReject
[i], 1);
71
output[i]->push_back(
TCS::CompositeTOB
(*jte) );
72
}
73
74
}
75
76
return
TCS::StatusCode::SUCCESS
;
77
}
else
{
78
TCS_EXCEPTION
(
"TeATIME alg must have 1 input, but got "
<< input.size());
79
}
80
}
81
82
TCS::StatusCode
83
TCS::TeATIME::process
(
const
std::vector<TCS::TOBArray const *> & input,
84
const
std::vector<TCS::TOBArray *> & output,
85
Decision
& decision )
86
{
87
return
processBitCorrect
(input, output, decision);
88
}
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
Decision.h
TeATIME.h
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::bookHist
void bookHist(std::vector< std::string > ®Name, std::string_view name, std::string_view title, const int binx, const int xmin, const int xmax)
Definition
ConfigurableAlg.cxx:272
TCS::ConfigurableAlg::fillHist1D
void fillHist1D(const std::string &histName, double x)
Definition
ConfigurableAlg.cxx:474
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::m_histAccept
std::vector< std::string > m_histAccept
Definition
DecisionAlg.h:72
TCS::DecisionAlg::m_histReject
std::vector< std::string > m_histReject
Definition
DecisionAlg.h:73
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::StatusCode
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::TeATIME::initialize
virtual StatusCode initialize() override
Definition
TeATIME.cxx:41
TCS::TeATIME::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition
TeATIME.cxx:83
TCS::TeATIME::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition
TeATIME.cxx:56
TCS::TeATIME::TeATIME
TeATIME(const std::string &name)
Definition
TeATIME.cxx:24
const
TCS
Definition
AnomalyDetectionBDT.h:18
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0