28#define LOG std::cout << "TCS::DeltaRSqrIncl1Charge: "
83 std::string hname_accept =
"hDeltaRSqrIncl1Charge_accept_bit"+std::to_string(
static_cast<int>(i));
84 std::string hname_reject =
"hDeltaRSqrIncl1Charge_reject_bit"+std::to_string(
static_cast<int>(i));
100 const std::vector<TCS::TOBArray *> & output,
104 if(input.size() == 1) {
106 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
112 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
121 int charge1 = (*tob1)->charge();
122 int charge2 = (*tob2)->charge();
123 int totalCharge = charge1 + charge2;
124 bool acceptCharge =
true;
125 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
130 const bool fillReject =
fillHistos() and not fillAccept;
131 const bool alreadyFilled = decision.
bit(i);
136 if(fillAccept and not alreadyFilled) {
139 }
else if(fillReject) {
143 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
150 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
153 TCS_EXCEPTION(
"DeltaRSqrIncl1Charge alg must have either 1 input, but got " << input.size());
160 const std::vector<TCS::TOBArray *> & output,
163 if(input.size() == 1) {
165 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
171 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
178 unsigned int deltaR2 =
calcDeltaR2( *tob1, *tob2 );
180 int charge1 = (*tob1)->charge();
181 int charge2 = (*tob2)->charge();
182 int totalCharge = charge1 + charge2;
183 bool acceptCharge =
true;
184 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
189 const bool fillReject =
fillHistos() and not fillAccept;
190 const bool alreadyFilled = decision.
bit(i);
195 if(fillAccept and not alreadyFilled) {
198 }
else if(fillReject) {
202 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
207 TCS_EXCEPTION(
"DeltaRSqrIncl1Charge 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)
void fillHist2D(const std::string &histName, double x, double y)
data_t::const_iterator const_iterator
std::vector< std::string > m_histAcceptEta1Eta2
void setNumberOutputBits(unsigned int numberOutputBits)
DecisionAlg(const std::string &name)
std::vector< std::string > m_histRejectEta1Eta2
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)
virtual ~DeltaRSqrIncl1Charge()
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
virtual StatusCode initialize()
parType_t p_NumberLeading1
DeltaRSqrIncl1Charge(const std::string &name)
parType_t p_NumberLeading2
virtual StatusCode processBitCorrect(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)