92 std::string hname_accept =
"hInvariantMassThreeTOBsIncl1Charge_accept_bit"+std::to_string(
static_cast<int>(i));
93 std::string hname_reject =
"hInvariantMassThreeTOBsIncl1Charge_reject_bit"+std::to_string(
static_cast<int>(i));
94 std::string hname_acceptEta1Eta2 =
"hInvariantMassThreeTOBsIncl1Charge_acceptEta1Eta2_bit"+std::to_string(
static_cast<int>(i));
95 std::string hname_rejectEta1Eta2 =
"hInvariantMassThreeTOBsIncl1Charge_rejectEta1Eta2_bit"+std::to_string(
static_cast<int>(i));
96 std::string hname_acceptEta2Eta3 =
"hInvariantMassThreeTOBsIncl1Charge_acceptEta2Eta3_bit"+std::to_string(
static_cast<int>(i));
97 std::string hname_rejectEta2Eta3 =
"hInvariantMassThreeTOBsIncl1Charge_rejectEta2Eta3_bit"+std::to_string(
static_cast<int>(i));
98 std::string hname_acceptEta3Eta1 =
"hInvariantMassThreeTOBsIncl1Charge_acceptEta3Eta1_bit"+std::to_string(
static_cast<int>(i));
99 std::string hname_rejectEta3Eta1 =
"hInvariantMassThreeTOBsIncl1Charge_rejectEta3Eta1_bit"+std::to_string(
static_cast<int>(i));
121 const std::vector<TCS::TOBArray *> & output,
125 if(input.size() == 1) {
128 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
133 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading1;
138 tob3 != input[0]->end() && distance( input[0]->begin(), tob3) <
p_NumberLeading1;
142 if (
p_OneBarrel &&
static_cast<parType_t>(std::abs((*tob1)->eta())) > 10 &&
static_cast<parType_t>(std::abs((*tob2)->eta())) > 10 &&
static_cast<parType_t>(std::abs((*tob3)->eta())) > 10 )
continue;
148 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
150 int charge1 = (*tob1)->charge();
151 int charge2 = (*tob2)->charge();
152 int charge3 = (*tob3)->charge();
153 int totalCharge = charge1 + charge2 +
charge3;
154 bool acceptCharge =
true;
155 if ( std::abs(totalCharge) == 3 ) { acceptCharge =
false; }
164 const bool fillReject =
fillHistos() and not fillAccept;
165 const bool alreadyFilled = decision.
bit(i);
167 std::vector<TCS::GenericTOB*> TOBvector;
168 TOBvector.push_back( *tob1 );
169 TOBvector.push_back( *tob2 );
170 TOBvector.push_back( *tob3 );
175 if(fillAccept and not alreadyFilled) {
180 }
else if(fillReject) {
186 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
194 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
198 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1Charge alg must have 1 input list, but got " << input.size());
208 const std::vector<TCS::TOBArray *> & output,
212 if(input.size() == 1) {
215 tob1 != input[0]->end() && distance( input[0]->begin(), tob1) <
p_NumberLeading1;
220 tob2 != input[0]->end() && distance( input[0]->begin(), tob2) <
p_NumberLeading1;
225 tob3 != input[0]->end() && distance( input[0]->begin(), tob3) <
p_NumberLeading1;
229 if (
p_OneBarrel &&
static_cast<parType_t>(std::abs((*tob1)->eta())) > 10 &&
static_cast<parType_t>(std::abs((*tob2)->eta())) > 10 &&
static_cast<parType_t>(std::abs((*tob3)->eta())) > 10 )
continue;
232 unsigned int invmass2_12 =
calcInvMass( *tob1, *tob2 );
233 unsigned int invmass2_13 =
calcInvMass( *tob1, *tob3 );
234 unsigned int invmass2_23 =
calcInvMass( *tob2, *tob3 );
235 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
237 int charge1 = (*tob1)->charge();
238 int charge2 = (*tob2)->charge();
239 int charge3 = (*tob3)->charge();
240 int totalCharge = charge1 + charge2 +
charge3;
241 bool acceptCharge =
true;
242 if ( std::abs(totalCharge) == 3 ) { acceptCharge =
false; }
251 const bool fillReject =
fillHistos() and not fillAccept;
252 const bool alreadyFilled = decision.
bit(i);
254 std::vector<TCS::GenericTOB*> TOBvector;
255 TOBvector.push_back( *tob1 );
256 TOBvector.push_back( *tob2 );
257 TOBvector.push_back( *tob3 );
262 if(fillAccept and not alreadyFilled) {
267 }
else if(fillReject) {
273 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
281 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1Charge 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)
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_histRejectEta2Eta3
std::vector< std::string > m_histRejectEta3Eta1
void setNumberOutputBits(unsigned int numberOutputBits)
std::vector< std::string > m_histAcceptEta2Eta3
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
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
std::vector< std::string > m_histAcceptEta3Eta1
bool bit(unsigned int index) const
void setBit(unsigned int index, bool value)
parType_t p_NumberLeading1
parType_t p_InvMassMax[6]
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
virtual ~InvariantMassThreeTOBsIncl1Charge()
parType_t p_InvMassMin[6]
virtual StatusCode initialize() override final
InvariantMassThreeTOBsIncl1Charge(const std::string &name)
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)