122 std::string hname_accept =
"hInvariantMassDeltaPhiInclusive2Charge_accept_bit"+std::to_string(
static_cast<int>(i));
123 std::string hname_reject =
"hInvariantMassDeltaPhiInclusive2Charge_reject_bit"+std::to_string(
static_cast<int>(i));
138 const std::vector<TCS::TOBArray *> & output,
142 if( input.size() == 2) {
144 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
150 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
156 const int eta1 = (*tob1)->eta();
157 const int eta2 = (*tob2)->eta();
158 const unsigned int aeta1 = std::abs(eta1);
159 const unsigned int aeta2 = std::abs(eta2);
161 int charge1 = (*tob1)->charge();
162 int charge2 = (*tob2)->charge();
163 int totalCharge = charge1 + charge2;
164 bool acceptCharge =
true;
165 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
171 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
172 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
175 const bool fillReject =
fillHistos() and not fillAccept;
176 const bool alreadyFilled = decision.
bit(i);
181 if(fillAccept and not alreadyFilled) {
184 }
else if(fillReject) {
188 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
195 output[i]->setAmbiguityFlag(hasAmbiguousInputs);
199 TCS_EXCEPTION(
"InvariantMassDeltaPhiInclusive2Charge alg must have 2 inputs, but got " << input.size());
208 const std::vector<TCS::TOBArray *> & output,
213 if( input.size() == 2) {
215 tob1 != input[0]->end() && distance(input[0]->begin(), tob1) <
p_NumberLeading1;
219 tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <
p_NumberLeading2;
222 unsigned int invmass2 =
calcInvMass( *tob1, *tob2 );
225 const int eta1 = (*tob1)->eta();
226 const int eta2 = (*tob2)->eta();
227 const unsigned int aeta1 = std::abs(eta1);
228 const unsigned int aeta2 = std::abs(eta2);
230 int charge1 = (*tob1)->charge();
231 int charge2 = (*tob2)->charge();
232 int totalCharge = charge1 + charge2;
233 bool acceptCharge =
true;
234 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
true; }
239 ((aeta1 < p_MinEta1 || aeta1 >
p_MaxEta1 ) ||
240 (aeta2 < p_MinEta2 || aeta2 >
p_MaxEta2 ) ))
continue;
243 const bool fillReject =
fillHistos() and not fillAccept;
244 const bool alreadyFilled = decision.
bit(i);
249 if(fillAccept and not alreadyFilled) {
252 }
else if(fillReject) {
256 TRG_MSG_DEBUG(
"Decision " << i <<
": " << (accept ?
"pass":
"fail") <<
" invmass2 = " << invmass2);
261 TCS_EXCEPTION(
"InvariantMassDeltaPhiInclusive2Charge alg must have 2 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)
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decison) override final
parType_t p_NumberLeading2
parType_t p_DeltaPhiMin[6]
virtual StatusCode initialize() override final
virtual ~InvariantMassDeltaPhiInclusive2Charge()
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
parType_t p_InvMassMin[6]
parType_t p_NumberLeading1
InvariantMassDeltaPhiInclusive2Charge(const std::string &name)
parType_t p_DeltaPhiMax[6]
bool isAmbiguousTruncation(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)