ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
16
18TCS::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
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//----------------------------------------------------------
51//----------------------------------------------------------
52bool 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//----------------------------------------------------------
65bool 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//----------------------------------------------------------
83//----------------------------------------------------------
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//----------------------------------------------------------
const std::string & name() const
DecisionAlg & setHardwareBits(const unsigned int &bitNumber, const bool &valueDecision, const bool &valueOverflow)
propagate the hardware decision bits for each output bit of this algo
unsigned int m_numberOutputBits
Definition DecisionAlg.h:94
uint32_t m_hardwareDecisionBits
! decision bits from hardware (assume the algo won't have >31 output bits)
Definition DecisionAlg.h:96
uint32_t m_hardwareOverflowBits
! overflow bits from hardware (assume the algo won't have >31 output bits)
Definition DecisionAlg.h:98
bool fillHistosBasedOnHardware() const
! getter
bool fillHistos() const
whether the monitoring histograms should be filled
bool skipHistos() const
! getter
bool m_skipHistos
! skip filling monitoring histos, used only when m_fillHistosBasedOnHardware==true
bool m_fillHistosBasedOnHardware
! fill accept/reject monitoring histos based on hdw decision
virtual TCS::StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)=0
bool getOverflowHardwareBit(const unsigned int &bitNumber) const
! get one hardware overflow bit from this algo
virtual ~DecisionAlg()
bool getDecisionHardwareBit(const unsigned int &bitNumber) const
! get one hardware decision bit from this algo
DecisionAlg & setSkipHistos(const bool &value)
! toggle m_skipHistos (see TopoSteering::setOutputAlgosSkipHistograms)
DecisionAlg & setFillHistosBasedOnHardware(const bool &value)
! toggle m_fillHistosBasedOnHardware
virtual StatusCode doReset()
DecisionAlg & resetHardwareBits()
! reset all hardware bits for this algo
const std::string process