78 std::string hname_accept =
"hDeltaRSqrIncl2Charge_accept_bit"+std::to_string(
static_cast<int>(i));
79 std::string hname_reject =
"hDeltaRSqrIncl2Charge_reject_bit"+std::to_string(
static_cast<int>(i));
94 const std::vector<TCS::TOBArray *> & output,
98 if( input.size() == 2) {
101 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
m_NumberLeading1;
105 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
m_NumberLeading2;
109 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", deltaR2 = " << deltaR2);
111 int charge1 = (*tob1)->charge();
112 int charge2 = (*tob2)->charge();
113 int totalCharge = charge1 + charge2;
114 bool acceptCharge =
true;
115 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
122 const bool fillReject =
fillHistos() and not fillAccept;
123 const bool alreadyFilled = decision.
bit(i);
128 if(fillAccept and not alreadyFilled) {
131 }
else if(fillReject) {
135 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
142 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
145 TCS_EXCEPTION(
"DeltaRSqrIncl2Charge alg must have 2 inputs, but got " << input.size());
152 const std::vector<TCS::TOBArray *> & output,
156 if( input.size() == 2) {
159 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
m_NumberLeading1;
165 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
m_NumberLeading2;
168 unsigned int deltaR2 =
calcDeltaR2( *tob1, *tob2 );
169 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", deltaR2 = " << deltaR2);
171 int charge1 = (*tob1)->charge();
172 int charge2 = (*tob2)->charge();
173 int totalCharge = charge1 + charge2;
174 bool acceptCharge =
true;
175 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
182 const bool fillReject =
fillHistos() and not fillAccept;
183 const bool alreadyFilled = decision.
bit(i);
188 if(fillAccept and not alreadyFilled) {
191 }
else if(fillReject) {
195 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" deltaR2 = " << deltaR2);
200 TCS_EXCEPTION(
"DeltaRSqrIncl2Charge 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 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 StatusCode initialize()
parType_t m_NumberLeading2
parType_t m_NumberLeading1
DeltaRSqrIncl2Charge(const std::string &name)
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
virtual ~DeltaRSqrIncl2Charge()
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)