26#define LOG cout << "TCS::InvariantMassInclusive2: "
110 std::string hname_accept =
"hInvariantMassInclusive2_accept_bit"+std::to_string((
int)i);
111 std::string hname_reject =
"hInvariantMassInclusive2_reject_bit"+std::to_string((
int)i);
127 const std::vector<TCS::TOBArray *> & output,
131 if( input.size() == 2) {
133 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
138 if ((*tob1)->Et() == (*tob1_plus1)->Et() && distance(input[0]->begin(), tob1) ==
p_NumberLeading1 - 1) {
140 output[i]->setAmbiguityFlag(
true);
145 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
149 const int eta1 = (*tob1)->eta();
150 const int eta2 = (*tob2)->eta();
151 const unsigned int aeta1 = std::abs(eta1);
152 const unsigned int aeta2 = std::abs(eta2);
158 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
159 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
162 const bool fillReject =
fillHistos() and not fillAccept;
163 const bool alreadyFilled = decision.
bit(i);
168 if(fillAccept and not alreadyFilled) {
171 }
else if(fillReject) {
175 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
182 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
186 TCS_EXCEPTION(
"InvariantMassInclusive2 alg must have 2 inputs, but got " << input.size());
195 const std::vector<TCS::TOBArray *> & output,
200 if( input.size() == 2) {
202 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
207 if ((*tob1)->Et() == (*tob1_plus1)->Et() && distance(input[0]->begin(), tob1) ==
p_NumberLeading1 - 1) {
209 output[i]->setAmbiguityFlag(
true);
214 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
217 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
218 const int eta1 = (*tob1)->eta();
219 const int eta2 = (*tob2)->eta();
220 const unsigned int aeta1 = std::abs(eta1);
221 const unsigned int aeta2 = std::abs(eta2);
226 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
227 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
230 const bool fillReject =
fillHistos() and not fillAccept;
231 const bool alreadyFilled = decision.
bit(i);
236 if(fillAccept and not alreadyFilled) {
239 }
else if(fillReject) {
243 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept ?
"pass":
"fail") <<
" invmass2 = " << invmass2);
248 TCS_EXCEPTION(
"InvariantMassInclusive2 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 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)
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)
InvariantMassInclusive2(const std::string &name)
parType_t p_NumberLeading1
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison)
parType_t p_InvMassMin[6]
virtual StatusCode initialize()
parType_t p_InvMassMax[6]
virtual ~InvariantMassInclusive2()
parType_t p_NumberLeading2
virtual StatusCode process(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)