114 std::string hname_accept =
"hInvariantMassInclusiveDeltaRSqrIncl1_accept_bit"+std::to_string((
int)i);
115 std::string hname_reject =
"hInvariantMassInclusiveDeltaRSqrIncl1_reject_bit"+std::to_string((
int)i);
129 const std::vector<TCS::TOBArray *> & output,
133 if(input.size() == 1) {
136 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
143 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
154 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " << deltaR2);
162 const bool fillReject =
fillHistos() and not fillAccept;
163 const bool alreadyFilled = decision.
bit(i);
168 if(fillAccept and not alreadyFilled) {
170 }
else if(fillReject) {
173 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2 <<
" deltaR2 = " << deltaR2 );
180 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
184 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1 alg must have either 1 inputs, but got " << input.size());
194 const std::vector<TCS::TOBArray *> & output,
198 if(input.size() == 1) {
200 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
207 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
215 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
217 unsigned int deltaR2 =
calcDeltaR2( *tob1, *tob2 );
218 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " << deltaR2);
227 const bool fillReject =
fillHistos() and not fillAccept;
228 const bool alreadyFilled = decision.
bit(i);
233 if(fillAccept and not alreadyFilled) {
235 }
else if(fillReject) {
238 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2 <<
" deltaR2 = " << deltaR2 );
244 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1 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_histAcceptM
void setNumberOutputBits(unsigned int numberOutputBits)
DecisionAlg(const std::string &name)
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)
parType_t p_NumberLeading1
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_InvMassMax[6]
parType_t p_NumberLeading2
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
parType_t p_InvMassMin[6]
InvariantMassInclusiveDeltaRSqrIncl1(const std::string &name)
virtual ~InvariantMassInclusiveDeltaRSqrIncl1()
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)