97 std::string hname_accept =
"hInvariantMassInclusive1Disambiguation2_accept_bit"+std::to_string((
int)i);
98 std::string hname_reject =
"hInvariantMassInclusive1Disambiguation2_reject_bit"+std::to_string((
int)i);
111 const std::vector<TCS::TOBArray *> & output,
115 if(input.size() == 2) {
118 tob1a != input[0]->end() && distance( input[0]->begin(), tob1a) <
p_NumberLeading1a;
123 tob1b != input[0]->end() && distance( input[0]->begin(), tob1b) <
p_NumberLeading1b;
138 tob2 != input[1]->end() && distance( input[1]->begin(), tob2) <
p_NumberLeading2;
148 const bool fillReject =
fillHistos() and not fillAccept;
149 const bool alreadyFilled = decision.
bit(i);
154 if(fillAccept and not alreadyFilled) {
156 }
else if(fillReject) {
159 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
168 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
172 TCS_EXCEPTION(
"InvariantMassInclusive1Disambiguation2 alg must have 2 inputs, but got " << input.size());
182 const std::vector<TCS::TOBArray *> & output,
186 if(input.size() == 2) {
189 tob1a != input[0]->end() && distance( input[0]->begin(), tob1a) <
p_NumberLeading1a;
194 tob1b != input[0]->end() && distance( input[0]->begin(), tob1b) <
p_NumberLeading1b;
198 unsigned int invmass2 =
calcInvMass( *tob1a, *tob1b );
211 tob2 != input[1]->end() && distance( input[1]->begin(), tob2) <
p_NumberLeading2;
216 unsigned int deltaR2a =
calcDeltaR2( *tob1a, *tob2 );
217 unsigned int deltaR2b =
calcDeltaR2( *tob1b, *tob2 );
221 const bool fillReject =
fillHistos() and not fillAccept;
222 const bool alreadyFilled = decision.
bit(i);
227 if(fillAccept and not alreadyFilled) {
229 }
else if(fillReject) {
232 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
239 TCS_EXCEPTION(
"InvariantMassInclusive1Disambiguation2 alg must have either 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)
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)
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)
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_NumberLeading1a
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_NumberLeading2
parType_t p_InvMassMin[6]
parType_t p_InvMassMax[6]
parType_t p_NumberLeading1b
virtual ~InvariantMassInclusive1Disambiguation2()
virtual StatusCode initialize()
InvariantMassInclusive1Disambiguation2(const std::string &name)
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)