132 std::string hname_accept =
"hInvariantMassDeltaPhiSumEtInclusive1_accept_bit"+std::to_string((
int)i);
133 std::string hname_reject =
"hInvariantMassDeltaPhiSumEtInclusive1_reject_bit"+std::to_string((
int)i);
148 const std::vector<TCS::TOBArray *> & output,
152 if( input.size() == 1) {
154 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading;
160 if ((*tob1)->Et() == (*tob1_plus1)->Et() && distance(input[0]->begin(), tob1) ==
p_NumberLeading - 1) {
162 output[i]->setAmbiguityFlag(
true);
167 tob2 != input[0]->end() && distance(input[0]->begin(), tob2) <
p_NumberLeading;
169 j++;
if(j==k)
continue;
175 const int eta1 = (*tob1)->eta();
176 const int eta2 = (*tob2)->eta();
177 const unsigned int aeta1 = std::abs(eta1);
178 const unsigned int aeta2 = std::abs(eta2);
186 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
187 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
190 const bool fillReject =
fillHistos() and not fillAccept;
191 const bool alreadyFilled = decision.
bit(i);
196 if(fillAccept and not alreadyFilled) {
199 }
else if(fillReject) {
203 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
210 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
214 TCS_EXCEPTION(
"InvariantMassDeltaPhiSumEtInclusive1 alg must have 1 inputs, but got " << input.size());
223 const std::vector<TCS::TOBArray *> & output,
228 if( input.size() == 1) {
231 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading;
237 if ((*tob1)->Et() == (*tob1_plus1)->Et() && distance(input[0]->begin(), tob1) ==
p_NumberLeading - 1) {
239 output[i]->setAmbiguityFlag(
true);
244 tob2 != input[0]->end() && distance(input[0]->begin(), tob2) <
p_NumberLeading;
246 j++;
if (j==k)
continue;
248 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
251 const int eta1 = (*tob1)->eta();
252 const int eta2 = (*tob2)->eta();
253 const unsigned int aeta1 = std::abs(eta1);
254 const unsigned int aeta2 = std::abs(eta2);
262 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
263 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
266 const bool fillReject =
fillHistos() and not fillAccept;
267 const bool alreadyFilled = decision.
bit(i);
272 if(fillAccept and not alreadyFilled) {
275 }
else if(fillReject) {
279 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept ?
"pass":
"fail") <<
" invmass2 = " << invmass2);
284 TCS_EXCEPTION(
"InvariantMassDeltaPhiSumEtInclusive1 alg must have 1 inputs, but got " << input.size());
#define REGISTER_ALG_TCS(CLASS)
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#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)
unsigned int calcDeltaPhiBW(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 calcDeltaPhi(const TCS::GenericTOB *tob1, const TCS::GenericTOB *tob2)
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)
InvariantMassDeltaPhiSumEtInclusive1(const std::string &name)
parType_t p_InvMassMin[6]
parType_t p_DeltaPhiMax[6]
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 ~InvariantMassDeltaPhiSumEtInclusive1()
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
parType_t p_DeltaPhiMin[6]
parType_t p_NumberLeading
virtual StatusCode initialize() override final
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)