ATLAS Offline Software
Loading...
Searching...
No Matches
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
20
21REGISTER_ALG_TCS(TeATIME)
22
23
25{
26
27 defineParameter("InputWidth", 1);
28 defineParameter("MaxTob", 0);
29 defineParameter("NumResultBits", 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
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
52}
53
54
56TCS::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);
71 output[i]->push_back( TCS::CompositeTOB(*jte) );
72 }
73
74 }
75
77 } else {
78 TCS_EXCEPTION("TeATIME alg must have 1 input, but got " << input.size());
79 }
80}
81
83TCS::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}
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const std::string & name() const
void bookHist(std::vector< std::string > &regName, std::string_view name, std::string_view title, const int binx, const int xmin, const int xmax)
void fillHist1D(const std::string &histName, double x)
void defineParameter(std::string_view name, TCS::parType_t value)
data_t::const_iterator const_iterator
void setNumberOutputBits(unsigned int numberOutputBits)
Definition DecisionAlg.h:39
DecisionAlg(const std::string &name)
Definition DecisionAlg.h:24
std::vector< std::string > m_histAccept
Definition DecisionAlg.h:72
std::vector< std::string > m_histReject
Definition DecisionAlg.h:73
unsigned int numberOutputBits() const
Definition DecisionAlg.h:38
void setBit(unsigned int index, bool value)
Definition Decision.cxx:12
virtual StatusCode initialize() override
Definition TeATIME.cxx:41
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition TeATIME.cxx:83
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition TeATIME.cxx:56
TeATIME(const std::string &name)
Definition TeATIME.cxx:24
STL namespace.