ATLAS Offline Software
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 
19 #include "L1TopoCommon/Exception.h"
21 
22 REGISTER_ALG_TCS(TeATIME)
23 
24 
26 {
27 
28  defineParameter("InputWidth", 1);
29  defineParameter("MaxTob", 0);
30  defineParameter("NumResultBits", 4);
31  setNumberOutputBits(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 
52  return StatusCode::SUCCESS;
53 }
54 
55 
57 TCS::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);
71  fillHist1D(m_histReject[i], 1);
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 
84 TCS::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 }
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DataArrayImpl< GenericTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TCS::TeATIME
Definition: TeATIME.h:18
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:57
Decision.h
TCS::DecisionAlg::numberOutputBits
unsigned int numberOutputBits() const
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:39
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::DecisionAlg::m_histReject
std::vector< std::string > m_histReject
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:74
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
TCS::DecisionAlg::m_histAccept
std::vector< std::string > m_histAccept
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:73
TCS::CompositeTOB
Definition: CompositeTOB.h:16
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
TeATIME.h
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
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:84
TCS::ConfigurableAlg::bookHist
void bookHist(std::vector< std::string > &regName, const std::string &name, const std::string &title, const int binx, const int xmin, const int xmax)
Definition: ConfigurableAlg.cxx:270
TCS::TeATIME::initialize
virtual StatusCode initialize() override
Definition: TeATIME.cxx:42
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
Exception.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15