28#define LOG cout << "TCS::InvariantMassInclusive1: "
102 std::string hname_accept =
"hInvariantMassInclusive1_accept_bit"+std::to_string((
int)i);
103 std::string hname_reject =
"hInvariantMassInclusive1_reject_bit"+std::to_string((
int)i);
116 const std::vector<TCS::TOBArray *> & output,
120 if(input.size() == 1) {
123 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
130 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
146 const bool fillReject =
fillHistos() and not fillAccept;
147 const bool alreadyFilled = decision.
bit(i);
152 if(fillAccept and not alreadyFilled) {
154 }
else if(fillReject) {
157 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
164 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
168 TCS_EXCEPTION(
"InvariantMassInclusive1 alg must have either 1 inputs, but got " << input.size());
178 const std::vector<TCS::TOBArray *> & output,
182 if(input.size() == 1) {
184 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
191 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading2;
200 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
210 const bool fillReject =
fillHistos() and not fillAccept;
211 const bool alreadyFilled = decision.
bit(i);
216 if(fillAccept and not alreadyFilled) {
218 }
else if(fillReject) {
221 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
227 TCS_EXCEPTION(
"InvariantMassInclusive1 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)
void fillHist1D(const std::string &histName, double x)
unsigned int calcInvMassBW(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
void defineParameter(const std::string &name, TCS::parType_t value)
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)
parType_t p_NumberLeading1
virtual ~InvariantMassInclusive1()
parType_t p_NumberLeading2
virtual StatusCode initialize()
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_InvMassMax[6]
parType_t p_InvMassMin[6]
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
InvariantMassInclusive1(const std::string &name)
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)