123 std::string hname_accept =
"hInvariantMassInclusiveDeltaRSqrIncl1Charge_accept_bit"+std::to_string(
static_cast<int>(i));
124 std::string hname_reject =
"hInvariantMassInclusiveDeltaRSqrIncl1Charge_reject_bit"+std::to_string(
static_cast<int>(i));
141 const std::vector<TCS::TOBArray *> & output,
145 if(input.size() == 1) {
148 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
155 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
166 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " << deltaR2);
168 int charge1 = (*tob1)->charge();
169 int charge2 = (*tob2)->charge();
170 int totalCharge = charge1 + charge2;
171 bool acceptCharge =
true;
172 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
180 const bool fillReject =
fillHistos() and not fillAccept;
181 const bool alreadyFilled = decision.
bit(i);
186 if(fillAccept and not alreadyFilled) {
189 }
else if(fillReject) {
193 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2 <<
" deltaR2 = " << deltaR2 );
200 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
204 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1Charge alg must have either 1 inputs, but got " << input.size());
214 const std::vector<TCS::TOBArray *> & output,
218 if(input.size() == 1) {
220 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
227 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
235 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
237 unsigned int deltaR2 =
calcDeltaR2( *tob1, *tob2 );
238 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " << deltaR2);
240 int charge1 = (*tob1)->charge();
241 int charge2 = (*tob2)->charge();
242 int totalCharge = charge1 + charge2;
243 bool acceptCharge =
true;
244 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
252 const bool fillReject =
fillHistos() and not fillAccept;
253 const bool alreadyFilled = decision.
bit(i);
258 if(fillAccept and not alreadyFilled) {
261 }
else if(fillReject) {
265 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2 <<
" deltaR2 = " << deltaR2 );
271 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1Charge alg must have either 1 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)
unsigned int calcDeltaR2BW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
unsigned int calcInvMassBW(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)
unsigned int calcInvMass(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
std::vector< std::string > m_histAcceptM
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
unsigned int numberOutputBits() const
bool getDecisionHardwareBit(const unsigned int &bitNumber) const
! get one hardware decision bit from this algo
std::vector< std::string > m_histRejectM
bool bit(unsigned int index) const
void setBit(unsigned int index, bool value)
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
virtual StatusCode initialize() override final
parType_t p_NumberLeading1
parType_t p_InvMassMin[6]
parType_t p_NumberLeading2
InvariantMassInclusiveDeltaRSqrIncl1Charge(const std::string &name)
virtual ~InvariantMassInclusiveDeltaRSqrIncl1Charge()
parType_t p_InvMassMax[6]
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)