67 const L1GtCondition *cond1Condition,
const int cond0NrL1Objects,
68 const int cond1NrL1Objects,
const int cond0EtaBits,
const int cond1EtaBits,
165 bool condResult =
false;
166 bool reqObjResult =
false;
171 std::vector<L1GtObject> cndObjTypeVec(nObjInCond);
188 switch (cond0Categ) {
198 cndObjTypeVec[0] = (corrMuon->
objectType())[0];
201 std::ostringstream myCout;
202 muCondition.
print(myCout);
204 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
219 cndObjTypeVec[0] = (corrCalo->
objectType())[0];
222 std::ostringstream myCout;
223 caloCondition.
print(myCout);
225 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
236 cndObjTypeVec[0] = (corrEnergySum->
objectType())[0];
239 std::ostringstream myCout;
240 eSumCondition.
print(myCout);
242 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
256 <<
"\n First sub-condition false, second sub-condition not " 257 "evaluated and not printed." 264 reqObjResult =
false;
266 switch (cond1Categ) {
276 cndObjTypeVec[1] = (corrMuon->
objectType())[0];
279 std::ostringstream myCout;
280 muCondition.
print(myCout);
282 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
296 cndObjTypeVec[1] = (corrCalo->
objectType())[0];
299 std::ostringstream myCout;
300 caloCondition.
print(myCout);
302 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
313 cndObjTypeVec[1] = (corrEnergySum->
objectType())[0];
316 std::ostringstream myCout;
317 eSumCondition.
print(myCout);
319 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
335 <<
" Both sub-conditions true for object requirements." 336 <<
" Evaluate correlation requirements.\n" 353 std::vector<unsigned long long> deltaEtaRangeConv(deltaEtaRangeConvSize);
362 std::vector<unsigned long long> deltaPhiRangeConv(deltaPhiRangeConvSize);
370 cndObjTypeVec[0], cndObjTypeVec[1]));
373 unsigned int corrParDeltaPhiNrBins =
379 objectsInComb.reserve(nObjInCond);
385 const std::vector<const L1MuGMTCand *> *candMuVec =
nullptr;
386 const std::vector<const L1GctCand *> *candCaloVec =
nullptr;
394 unsigned int phiIndex0 = 0;
395 unsigned int phiIndex1 = 0;
397 unsigned int phiIndex0Converted = 0;
398 unsigned int phiIndex1Converted = 0;
400 unsigned int etaIndex0 = 0;
401 unsigned int etaIndex1 = 0;
403 unsigned int etaIndex0Converted = 0;
404 unsigned int etaIndex1Converted = 0;
407 <<
" Sub-condition 0: std::vector<SingleCombInCond> size: " 408 << (cond0Comb.size()) << std::endl;
410 <<
" Sub-condition 1: std::vector<SingleCombInCond> size: " 411 << (cond1Comb.size()) << std::endl;
414 for (std::vector<SingleCombInCond>::const_iterator it0Comb =
416 it0Comb != cond0Comb.end(); it0Comb++) {
423 if (!(*it0Comb).empty()) {
424 obj0Index = (*it0Comb)[0];
426 LogTrace(
"L1GlobalTrigger") <<
"\n SingleCombInCond (*it0Comb).size() " 427 << ((*it0Comb).size()) << std::endl;
431 bool convStatus =
false;
433 switch (cond0Categ) {
436 phiIndex0 = (*candMuVec)[obj0Index]->phiIndex();
437 etaIndex0 = (*candMuVec)[obj0Index]->etaIndex();
440 objPairIndex, 0, phiIndex0, phiIndex0Converted);
457 switch (cndObjTypeVec[0]) {
478 phiIndex0 = (*candCaloVec)[obj0Index]->phiIndex();
479 etaIndex0 = (*candCaloVec)[obj0Index]->etaIndex();
482 objPairIndex, 0, phiIndex0, phiIndex0Converted);
490 cndObjTypeVec[0], etaIndex0, etaIndex0Converted);
498 switch (cndObjTypeVec[0]) {
501 phiIndex0 = candETM->
phi();
504 objPairIndex, 0, phiIndex0, phiIndex0Converted);
514 phiIndex0 = candHTM->
phi();
517 objPairIndex, 0, phiIndex0, phiIndex0Converted);
537 for (std::vector<SingleCombInCond>::const_iterator it1Comb =
539 it1Comb != cond1Comb.end(); it1Comb++) {
545 if (!(*it1Comb).empty()) {
546 obj1Index = (*it1Comb)[0];
548 LogTrace(
"L1GlobalTrigger") <<
"\n SingleCombInCond (*it1Comb).size() " 549 << ((*it1Comb).size()) << std::endl;
553 switch (cond1Categ) {
556 phiIndex1 = (*candMuVec)[obj1Index]->phiIndex();
557 etaIndex1 = (*candMuVec)[obj1Index]->etaIndex();
560 objPairIndex, 1, phiIndex1, phiIndex1Converted);
568 cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
576 switch (cndObjTypeVec[1]) {
597 phiIndex1 = (*candCaloVec)[obj1Index]->phiIndex();
598 etaIndex1 = (*candCaloVec)[obj1Index]->etaIndex();
601 objPairIndex, 1, phiIndex1, phiIndex1Converted);
609 cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
618 switch (cndObjTypeVec[1]) {
621 phiIndex1 = candETM->
phi();
624 objPairIndex, 1, phiIndex1, phiIndex1Converted);
633 phiIndex1 = candHTM->
phi();
636 objPairIndex, 1, phiIndex1, phiIndex1Converted);
657 <<
" Correlation pair [" 660 <<
"] with collection indices [" << obj0Index <<
", " << obj1Index
662 <<
" has: \n phi indices = [" << phiIndex0 <<
", " << phiIndex1
663 <<
"] converted to [" << phiIndex0Converted <<
", " 664 << phiIndex1Converted <<
"] \n eta indices [" << etaIndex0
665 <<
", " << etaIndex1 <<
"] converted to [" << etaIndex0Converted
666 <<
", " << etaIndex1Converted <<
"] \n" 672 bool reqEtaPhiResult =
false;
676 unsigned int candDeltaPhi;
679 if (phiIndex0Converted > phiIndex1Converted) {
680 candDeltaPhi = phiIndex0Converted - phiIndex1Converted;
682 candDeltaPhi = phiIndex1Converted - phiIndex0Converted;
692 while (candDeltaPhi >= corrParDeltaPhiNrBins) {
694 unsigned int candDeltaPhiInitial = candDeltaPhi;
697 candDeltaPhi = (corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
700 <<
" Initial candDeltaPhi = " << candDeltaPhiInitial
701 <<
" > corrParDeltaPhiNrBins = " << corrParDeltaPhiNrBins
702 <<
" ==> candDeltaPhi rescaled to: " << candDeltaPhi
703 <<
" [ loop index " << iLoop <<
"; breaks after " << nMaxLoop
709 if (iLoop > nMaxLoop) {
716 bool indResult =
true;
718 for (
size_t iDeltaPhi = 0; iDeltaPhi < deltaPhiRangeConv.size();
720 if (!
checkBit(deltaPhiRangeConv[iDeltaPhi], candDeltaPhi)) {
729 <<
" object delta phi = " << candDeltaPhi
730 <<
" fails delta phi requirements." 731 <<
"\n Pair fails correlation condition.\n" 735 reqEtaPhiResult =
false;
741 <<
" object delta phi = " << candDeltaPhi
742 <<
" passes delta phi requirements." << std::endl;
748 unsigned int candDeltaEta;
751 if (etaIndex0Converted > etaIndex1Converted) {
752 candDeltaEta = etaIndex0Converted - etaIndex1Converted;
754 candDeltaEta = etaIndex1Converted - etaIndex0Converted;
761 for (
size_t iDeltaEta = 0; iDeltaEta < deltaEtaRangeConv.size();
763 if (!
checkBit(deltaEtaRangeConv[iDeltaEta], candDeltaEta)) {
772 <<
" object delta eta = " << candDeltaEta
773 <<
" fails delta eta requirements." 774 <<
"\n Pair fails correlation condition.\n" 778 reqEtaPhiResult =
false;
784 <<
" object delta eta = " << candDeltaEta
785 <<
" passes delta eta requirements." 786 <<
"\n Pair passes correlation condition.\n" 790 reqEtaPhiResult =
true;
794 objectsInComb.clear();
796 objectsInComb.push_back(obj0Index);
797 objectsInComb.push_back(obj1Index);
802 if (reqEtaPhiResult) {
815 <<
"] pass(es) the correlation condition.\n"
const std::vector< const L1GctCand * > * getCandL1IsoEG() const
pointer to IsoEG data list
L1GtCorrelationCondition & operator=(const L1GtCorrelationCondition &)
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
void print(std::ostream &myCout) const override
print condition
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
int m_verbosity
verbosity level
typedef for correlation parameters
const std::vector< const L1GctCand * > * getCandL1ForJet() const
pointer to ForJet data list
bool m_condLastResult
the last result of evaluateCondition()
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const bool evaluateCondition() const override
the core function to check if the condition matches
unsigned int m_nrBinsPhi
number of bins for delta phi
std::vector< int > SingleCombInCond
typedefs
const L1GtCorrelationTemplate * m_gtCorrelationTemplate
pointer to a L1GtCorrelationTemplate
Persistable copy of missing Et measured at Level-1.
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
void setGtNrBinsPhi(const unsigned int)
unsigned phi() const
get the Et
std::string l1GtObjectEnumToString(const L1GtObject &)
const unsigned int gtObjectPairIndex(const L1GtObject &, const L1GtObject &) const
std::string deltaEtaRange
void print(std::ostream &myCout) const override
print the condition
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
L1GtCorrelationCondition()
const L1GtCondition * m_gtCond0
pointer to first sub-condition
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
L1GtConditionCategory
condition categories
~L1GtCorrelationCondition() override
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
const L1GctHtMiss * getCandL1HTM() const
pointer to HTM data list
int m_condMaxNumberObjects
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
void copy(const L1GtCorrelationCondition &cp)
copy function for copy constructor and operator=
const bool convertEtaIndex(const L1GtObject &, const unsigned int initialIndex, unsigned int &convertedIndex) const
std::string deltaPhiRange
Persistable copy of missing Et measured at Level-1.
void print(std::ostream &myCout) const override
print condition
const L1GctEtMiss * getCandL1ETM() const
pointer to ETM data list
void setGtPSB(const L1GlobalTriggerPSB *)
bool hexStringToInt64(const std::string &, std::vector< unsigned long long > &)
void print(std::ostream &myCout) const override
print condition
const bool convertPhiIndex(const unsigned int pairIndex, const unsigned int positionPair, const unsigned int initialIndex, unsigned int &convertedIndex) const
const std::vector< const L1GctCand * > * getCandL1TauJet() const
pointer to TauJet data list
void setGtGTL(const L1GlobalTriggerGTL *)
virtual void print(std::ostream &myCout) const
print condition
const std::vector< const L1GctCand * > * getCandL1CenJet() const
pointer to CenJet data list
const std::vector< const L1GctCand * > * getCandL1NoIsoEG() const
pointer to NoIsoEG data list
const CorrelationParameter * correlationParameter() const
get / set correlation parameters
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
void setGtCorrelationTemplate(const L1GtCorrelationTemplate *)
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
void print(std::ostream &myCout) const override
print condition
const L1GlobalTriggerGTL * m_gtGTL
pointer to GTL, to be able to get the trigger objects
unsigned phi() const
get the Et
const L1GtCondition * m_gtCond1
pointer to second sub-condition
const L1GtEtaPhiConversions * m_gtEtaPhiConversions
pointer to eta and phi conversion class
bool condLastResult() const
get the latest result for the condition