ATLAS Offline Software
Loading...
Searching...
No Matches
TeATIME.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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#include <cmath>
17
21
22REGISTER_ALG_TCS(TeATIME)
23
24
26{
27
28 defineParameter("InputWidth", 1);
29 defineParameter("MaxTob", 0);
30 defineParameter("NumResultBits", 4);
32 for (unsigned int i=0;i<numberOutputBits();i++){
33 // Algo parameters
34 defineParameter("algoLogic", 0, i);
35 defineParameter("nextBcFactor", 0, i);
36 defineParameter("nextBcOffset", 0, i);
37 }
38
39}
40
43
44 // book histograms
45 for(unsigned int i=0; i<numberOutputBits(); ++i) {
46 std::string hname_accept = "hTeATIME_accept_bit"+std::to_string((int)i);
47 std::string hname_reject = "hTeATIME_reject_bit"+std::to_string((int)i);
48 bookHist(m_histAccept, hname_accept, "TeTIME accept", 1, 0, 2);
49 bookHist(m_histReject, hname_reject, "TeTIME accept", 1, 0, 2);
50 }
51
53}
54
55
57TCS::TeATIME::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
58 const std::vector<TCS::TOBArray *> & output,
59 Decision & decision )
60{
61 if(input.size() == 1) {
62
63 for( TOBArray::const_iterator jte = input[0]->begin();
64 jte != input[0]->end();
65 ++jte)
66 {
67
68 for(unsigned int i=0; i<numberOutputBits(); ++i) {
69
70 decision.setBit(i, false);
72 output[i]->push_back( TCS::CompositeTOB(*jte) );
73 }
74
75 }
76
78 } else {
79 TCS_EXCEPTION("TeATIME alg must have 1 input, but got " << input.size());
80 }
81}
82
84TCS::TeATIME::process( const std::vector<TCS::TOBArray const *> & input,
85 const std::vector<TCS::TOBArray *> & output,
86 Decision & decision )
87{
88 return processBitCorrect(input, output, decision);
89}
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const std::string & name() const
void bookHist(std::vector< std::string > &regName, const std::string &name, const std::string &title, const int binx, const int xmin, const int xmax)
void fillHist1D(const std::string &histName, double x)
void defineParameter(const std::string &name, TCS::parType_t value)
data_t::const_iterator const_iterator
void setNumberOutputBits(unsigned int numberOutputBits)
Definition DecisionAlg.h:40
DecisionAlg(const std::string &name)
Definition DecisionAlg.h:25
std::vector< std::string > m_histAccept
Definition DecisionAlg.h:73
std::vector< std::string > m_histReject
Definition DecisionAlg.h:74
unsigned int numberOutputBits() const
Definition DecisionAlg.h:39
void setBit(unsigned int index, bool value)
Definition Decision.cxx:12
virtual StatusCode initialize() override
Definition TeATIME.cxx:42
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition TeATIME.cxx:84
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override
Definition TeATIME.cxx:57
TeATIME(const std::string &name)
Definition TeATIME.cxx:25
STL namespace.