ATLAS Offline Software
Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 // DecisionAlg.cxx
5 // TopoCore
6 // Created by Joerg Stelzer on 11/15/12.
7 
9 
12  return StatusCode::SUCCESS;
13 }
14 
16 
18 TCS::DecisionAlg::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
19  const std::vector<TCS::TOBArray *> & output,
20  Decision & decision )
21 {
22  return process(input,output,decision);
23 }
24 
25 TCS::DecisionAlg& TCS::DecisionAlg::setHardwareBits(const unsigned int &bitNumber,
26  const bool &valueDecision,
27  const bool &valueOverflow)
28 {
29  if(bitNumber<m_numberOutputBits){
30  if(valueDecision)
31  m_hardwareDecisionBits |= (1 << bitNumber);
32  if(valueOverflow)
33  m_hardwareOverflowBits |= (1 << bitNumber);
34  } else if(bitNumber<32) {
35  TRG_MSG_WARNING("Cannot set hardware bits for bit number "<<bitNumber
36  <<" > "<<m_numberOutputBits<<" N output bits "
37  <<" for algo "<<name());
38  } else {
39  TRG_MSG_WARNING("Cannot set hardware bits for bit number "<<bitNumber
40  <<" > 31 N output bits for algo "<<name());
41  }
42  return *this;
43 }
44 //----------------------------------------------------------
46 {
47  m_hardwareDecisionBits = 0;
48  m_hardwareOverflowBits = 0;
49  return *this;
50 }
51 //----------------------------------------------------------
52 bool TCS::DecisionAlg::getDecisionHardwareBit(const unsigned int &bitNumber) const
53 {
54  bool value = false;
55  if(bitNumber<m_numberOutputBits){
56  value = (m_hardwareDecisionBits >> bitNumber) & 1;
57  } else {
58  TRG_MSG_WARNING("Cannot get hardware decision bit "<<bitNumber
59  <<" > "<<m_numberOutputBits<<" N output bits "
60  <<" for algo "<<name());
61  }
62  return value;
63 }
64 //----------------------------------------------------------
65 bool TCS::DecisionAlg::getOverflowHardwareBit(const unsigned int &bitNumber) const
66 {
67  bool value = false;
68  if(bitNumber<m_numberOutputBits){
69  value = (m_hardwareOverflowBits >> bitNumber) & 1;
70  } else {
71  TRG_MSG_WARNING("Cannot get hardware overflow bit "<<bitNumber
72  <<" > "<<m_numberOutputBits<<" N output bits "
73  <<" for algo "<<name());
74  }
75  return value;
76 }
77 //----------------------------------------------------------
79 {
80  m_fillHistosBasedOnHardware = value;
81  return *this;
82 }
83 //----------------------------------------------------------
85 {
86  return m_fillHistosBasedOnHardware;
87 }
88 //----------------------------------------------------------
90 {
91  m_skipHistos = value;
92  return *this;
93 }
94 //----------------------------------------------------------
96 {
97  return m_skipHistos;
98 }
99 //----------------------------------------------------------
101 {
102  return (not m_fillHistosBasedOnHardware or not m_skipHistos);
103 }
104 //----------------------------------------------------------
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DecisionAlg::fillHistosBasedOnHardware
bool fillHistosBasedOnHardware() const
! getter
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:84
TCS::DecisionAlg::setFillHistosBasedOnHardware
DecisionAlg & setFillHistosBasedOnHardware(const bool &value)
! toggle m_fillHistosBasedOnHardware
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:78
athena.value
value
Definition: athena.py:122
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
TCS::DecisionAlg::setSkipHistos
DecisionAlg & setSkipHistos(const bool &value)
! toggle m_skipHistos (see TopoSteering::setOutputAlgosSkipHistograms)
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:89
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::DecisionAlg::getDecisionHardwareBit
bool getDecisionHardwareBit(const unsigned int &bitNumber) const
! get one hardware decision bit from this algo
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:52
TCS::DecisionAlg::setHardwareBits
DecisionAlg & setHardwareBits(const unsigned int &bitNumber, const bool &valueDecision, const bool &valueOverflow)
propagate the hardware decision bits for each output bit of this algo
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:25
TCS::DecisionAlg::fillHistos
bool fillHistos() const
whether the monitoring histograms should be filled
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:100
TCS::DecisionAlg::~DecisionAlg
virtual ~DecisionAlg()
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
merge.output
output
Definition: merge.py:17
TRG_MSG_WARNING
#define TRG_MSG_WARNING(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:28
DecisionAlg.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TCS::DecisionAlg::resetHardwareBits
DecisionAlg & resetHardwareBits()
! reset all hardware bits for this algo
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:45
TCS::DecisionAlg::doReset
virtual StatusCode doReset()
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:11
TCS::DecisionAlg::processBitCorrect
virtual TCS::StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)=0
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:18
TCS::DecisionAlg::skipHistos
bool skipHistos() const
! getter
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:95
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::DecisionAlg::getOverflowHardwareBit
bool getOverflowHardwareBit(const unsigned int &bitNumber) const
! get one hardware overflow bit from this algo
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx:65