28#define LOG cout << fullname() << ": "
91 std::string hname_accept =
"hDeltaEtaIncl1_accept_bit"+std::to_string((
int)i);
92 std::string hname_reject =
"hDeltaEtaIncl1_reject_bit"+std::to_string((
int)i);
105 const std::vector<TCS::TOBArray *> & output,
109 if(input.size() == 1) {
113 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
118 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < nLeading2;
127 std::stringstream msgss;
128 msgss <<
"Combination : " << distance( input[0]->begin(), tob1)
129 <<
" x " << distance( input[0]->begin(), tob2)
130 <<
" eta=" << (*tob1)->eta()
131 <<
" , eta=" << (*tob2)->eta()
132 <<
", DeltaEta = " << deltaEta <<
" -> ";
135 const bool fillReject =
fillHistos() and not fillAccept;
136 const bool alreadyFilled = decision.
bit(i);
141 if(fillAccept and not alreadyFilled) {
143 }
else if(fillReject) {
146 msgss << (accept?
"pass":
"fail") <<
"|";
154 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
157 TCS_EXCEPTION(
"DeltaEtaIncl1 alg must have 1 input, but got " << input.size());
164 const std::vector<TCS::TOBArray *> & output,
167 if(input.size() == 1) {
171 if (nLeading < input[0]->size() && nLeading2 < input[0]->size()) { output[0]->setAmbiguityFlag(
false); }
173 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading;
178 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < nLeading2;
181 if (input[0]->size() >= nLeading2+1) {
183 if ((*tob2)->Et() == (*tob3)->Et() && distance(input[0]->begin(), tob2) == nLeading2 - 1) {
184 output[0]->setAmbiguityFlag(
true);
193 std::stringstream msgss;
194 msgss <<
"Combination : " << distance( input[0]->begin(), tob1)
195 <<
" x " << distance( input[0]->begin(), tob2)
196 <<
" eta=" << (*tob1)->eta()
197 <<
" , eta=" << (*tob2)->eta()
198 <<
", DeltaEta = " << deltaEta <<
" -> ";
201 const bool fillReject =
fillHistos() and not fillAccept;
202 const bool alreadyFilled = decision.
bit(i);
207 if(fillAccept and not alreadyFilled) {
209 }
else if(fillReject) {
212 msgss << (accept?
"pass":
"fail") <<
"|";
220 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
223 TCS_EXCEPTION(
"DeltaEtaIncl1 alg must have 1 input, 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_DeltaEtaMax[4]
virtual StatusCode initialize()
parType_t p_DeltaEtaMin[4]
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_NumberLeading1
DeltaEtaIncl1(const std::string &name)
parType_t p_NumberLeading2
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)