28#define LOG cout << fullname() << ": "
91 std::string hname_accept =
"hDeltaEtaIncl2_accept_bit"+std::to_string((
int)i);
92 std::string hname_reject =
"hDeltaEtaIncl2_reject_bit"+std::to_string((
int)i);
104 const std::vector<TCS::TOBArray *> & output,
108 if( input.size() == 2) {
110 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
114 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
124 const bool fillReject =
fillHistos() and not fillAccept;
125 const bool alreadyFilled = decision.
bit(i);
130 if(fillAccept and not alreadyFilled) {
132 }
else if(fillReject) {
135 TRG_MSG_DEBUG(
"DeltaEta = " << deltaEta <<
" -> accept bit " << i <<
" -> "
136 << (accept?
"pass":
"fail"));
143 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
146 TCS_EXCEPTION(
"DeltaEtaIncl2 alg must have 2 inputs, but got " << input.size());
153 const std::vector<TCS::TOBArray *> & output,
156 if( input.size() == 2) {
158 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
162 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
172 const bool fillReject =
fillHistos() and not fillAccept;
173 const bool alreadyFilled = decision.
bit(i);
178 if(fillAccept and not alreadyFilled) {
180 }
else if(fillReject) {
183 TRG_MSG_DEBUG(
"DeltaEta = " << deltaEta <<
" -> accept bit " << i <<
" -> "
184 << (accept?
"pass":
"fail"));
189 TCS_EXCEPTION(
"DeltaEtaIncl2 alg must have 2 inputs, but got " << input.size());
#define REGISTER_ALG_TCS(CLASS)
#define TCS_EXCEPTION(MSG)
const Parameter & parameter(const std::string ¶meterName) const
const std::string & name() const
void bookHist(std::vector< std::string > ®Name, 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)
unsigned int calcDeltaEta(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcDeltaEtaBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
void defineParameter(const std::string &name, TCS::parType_t value)
data_t::const_iterator const_iterator
void setNumberOutputBits(unsigned int numberOutputBits)
DecisionAlg(const std::string &name)
bool fillHistosBasedOnHardware() const
! getter
bool fillHistos() const
whether the monitoring histograms should be filled
std::vector< std::string > m_histAccept
std::vector< std::string > m_histReject
unsigned int numberOutputBits() const
bool getDecisionHardwareBit(const unsigned int &bitNumber) const
! get one hardware decision bit from this algo
bool bit(unsigned int index) const
void setBit(unsigned int index, bool value)
parType_t p_NumberLeading2
parType_t p_DeltaEtaMax[4]
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_NumberLeading1
virtual StatusCode initialize()
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
DeltaEtaIncl2(const std::string &name)
parType_t p_DeltaEtaMin[4]
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)