24#define LOG std::cout << "TCS::DeltaRSqrIncl1: "
79 std::string hname_accept =
"hDeltaRSqrIncl1_accept_bit"+std::to_string((
int)i);
80 std::string hname_reject =
"hDeltaRSqrIncl1_reject_bit"+std::to_string((
int)i);
93 const std::vector<TCS::TOBArray *> & output,
96 if(input.size() == 1) {
98 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
104 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
116 const bool fillReject =
fillHistos() and not fillAccept;
117 const bool alreadyFilled = decision.
bit(i);
122 if(fillAccept and not alreadyFilled) {
124 }
else if(fillReject) {
127 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
134 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
137 TCS_EXCEPTION(
"DeltaRSqrIncl1 alg must have either 1 input, but got " << input.size());
144 const std::vector<TCS::TOBArray *> & output,
147 if(input.size() == 1) {
149 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
155 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
162 unsigned int deltaR2 =
calcDeltaR2( *tob1, *tob2 );
167 const bool fillReject =
fillHistos() and not fillAccept;
168 const bool alreadyFilled = decision.
bit(i);
173 if(fillAccept and not alreadyFilled) {
175 }
else if(fillReject) {
178 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
183 TCS_EXCEPTION(
"DeltaRSqrIncl1 alg must have either 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 calcDeltaR2BW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
void defineParameter(const std::string &name, TCS::parType_t value)
unsigned int calcDeltaR2(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
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_NumberLeading1
virtual StatusCode initialize()
DeltaRSqrIncl1(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)
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
virtual ~DeltaRSqrIncl1()
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)