94 std::string hname_accept =
"hInvariantMassThreeTOBsIncl1_accept_bit"+std::to_string((
int)i);
95 std::string hname_reject =
"hInvariantMassThreeTOBsIncl1_reject_bit"+std::to_string((
int)i);
110 const std::vector<TCS::TOBArray *> & output,
114 if(input.size() == 1) {
117 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
123 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading1;
128 tob3 != input[0]->end() && distance( input[0]->begin(), tob3) <
p_NumberLeading1;
138 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
147 const bool fillReject =
fillHistos() and not fillAccept;
148 const bool alreadyFilled = decision.
bit(i);
150 std::vector<TCS::GenericTOB*> TOBvector;
151 TOBvector.push_back( *tob1 );
152 TOBvector.push_back( *tob2 );
153 TOBvector.push_back( *tob3 );
158 if(fillAccept and not alreadyFilled) {
160 }
else if(fillReject) {
163 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
171 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
175 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1 alg must have 1 input list, but got " << input.size());
185 const std::vector<TCS::TOBArray *> & output,
189 if(input.size() == 1) {
191 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
198 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading1;
203 tob3 != input[0]->end() && distance( input[0]->begin(), tob3) <
p_NumberLeading1;
211 unsigned int invmass2_12 =
calcInvMass( *tob1, *tob2 );
212 unsigned int invmass2_13 =
calcInvMass( *tob1, *tob3 );
213 unsigned int invmass2_23 =
calcInvMass( *tob2, *tob3 );
214 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
223 const bool fillReject =
fillHistos() and not fillAccept;
224 const bool alreadyFilled = decision.
bit(i);
226 std::vector<TCS::GenericTOB*> TOBvector;
227 TOBvector.push_back( *tob1 );
228 TOBvector.push_back( *tob2 );
229 TOBvector.push_back( *tob3 );
234 if(fillAccept and not alreadyFilled) {
236 }
else if(fillReject) {
239 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
247 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1 alg must have either 1 input list, 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 StatusCode initialize() override final
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
InvariantMassThreeTOBsIncl1(const std::string &name)
virtual ~InvariantMassThreeTOBsIncl1()
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
parType_t p_InvMassMin[6]
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)