72 const L1GtCondition* cond1Condition,
const int cond0NrL1Objects,
73 const int cond1NrL1Objects,
const int cond0EtaBits,
79 m_gtCond0(cond0Condition), m_gtCond1(cond1Condition),
80 m_cond0NrL1Objects(cond0NrL1Objects),
81 m_cond1NrL1Objects(cond1NrL1Objects), m_cond0EtaBits(cond0EtaBits),
82 m_cond1EtaBits(cond1EtaBits), m_gtGTL(ptrGTL), m_gtPSB(ptrPSB),
83 m_gtEtaPhiConversions(etaPhiConversions),
179 bool condResult =
false;
180 bool reqObjResult =
false;
185 std::vector<L1GtObject> cndObjTypeVec(nObjInCond);
200 switch (cond0Categ) {
210 cndObjTypeVec[0] = (corrMuon->
objectType())[0];
213 std::ostringstream myCout;
214 muCondition.
print(myCout);
216 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
231 cndObjTypeVec[0] = (corrCalo->
objectType())[0];
234 std::ostringstream myCout;
235 caloCondition.
print(myCout);
237 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
249 cndObjTypeVec[0] = (corrEnergySum->
objectType())[0];
252 std::ostringstream myCout;
253 eSumCondition.
print(myCout);
255 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
270 <<
"\n First sub-condition false, second sub-condition not evaluated and not printed."
277 reqObjResult =
false;
279 switch (cond1Categ) {
289 cndObjTypeVec[1] = (corrMuon->
objectType())[0];
292 std::ostringstream myCout;
293 muCondition.
print(myCout);
295 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
309 cndObjTypeVec[1] = (corrCalo->
objectType())[0];
312 std::ostringstream myCout;
313 caloCondition.
print(myCout);
315 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
327 cndObjTypeVec[1] = (corrEnergySum->
objectType())[0];
330 std::ostringstream myCout;
331 eSumCondition.
print(myCout);
333 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
349 <<
" Both sub-conditions true for object requirements."
350 <<
" Evaluate correlation requirements.\n" << std::endl;
368 std::vector<unsigned long long> deltaEtaRangeConv(
369 deltaEtaRangeConvSize);
379 std::vector<unsigned long long> deltaPhiRangeConv(
380 deltaPhiRangeConvSize);
388 cndObjTypeVec[0], cndObjTypeVec[1]));
391 unsigned int corrParDeltaPhiNrBins =
398 objectsInComb.reserve(nObjInCond);
404 const std::vector<const L1MuGMTCand*>* candMuVec = 0;
405 const std::vector<const L1GctCand*>* candCaloVec = 0;
413 unsigned int phiIndex0 = 0;
414 unsigned int phiIndex1 = 0;
416 unsigned int phiIndex0Converted = 0;
417 unsigned int phiIndex1Converted = 0;
419 unsigned int etaIndex0 = 0;
420 unsigned int etaIndex1 = 0;
422 unsigned int etaIndex0Converted = 0;
423 unsigned int etaIndex1Converted = 0;
426 <<
" Sub-condition 0: std::vector<SingleCombInCond> size: "
427 << (cond0Comb.size()) << std::endl;
429 <<
" Sub-condition 1: std::vector<SingleCombInCond> size: "
430 << (cond1Comb.size()) << std::endl;
434 for (std::vector<SingleCombInCond>::const_iterator it0Comb =
435 cond0Comb.begin(); it0Comb != cond0Comb.end(); it0Comb++) {
441 if ((*it0Comb).size() > 0) {
442 obj0Index = (*it0Comb)[0];
445 <<
"\n SingleCombInCond (*it0Comb).size() "
446 << ((*it0Comb).size()) << std::endl;
450 bool convStatus =
false;
452 switch (cond0Categ) {
455 phiIndex0 = (*candMuVec)[obj0Index]->phiIndex();
456 etaIndex0 = (*candMuVec)[obj0Index]->etaIndex();
459 objPairIndex, 0, phiIndex0, phiIndex0Converted);
467 Mu, etaIndex0, etaIndex0Converted);
477 switch (cndObjTypeVec[0]) {
504 phiIndex0 = (*candCaloVec)[obj0Index]->phiIndex();
505 etaIndex0 = (*candCaloVec)[obj0Index]->etaIndex();
508 objPairIndex, 0, phiIndex0, phiIndex0Converted);
516 cndObjTypeVec[0], etaIndex0, etaIndex0Converted);
525 switch (cndObjTypeVec[0]) {
528 phiIndex0 = candETM->
phi();
531 objPairIndex, 0, phiIndex0, phiIndex0Converted);
542 phiIndex0 = candHTM->
phi();
545 objPairIndex, 0, phiIndex0, phiIndex0Converted);
567 for (std::vector<SingleCombInCond>::const_iterator it1Comb =
568 cond1Comb.begin(); it1Comb != cond1Comb.end(); it1Comb++) {
574 if ((*it1Comb).size() > 0) {
575 obj1Index = (*it1Comb)[0];
578 <<
"\n SingleCombInCond (*it1Comb).size() "
579 << ((*it1Comb).size()) << std::endl;
583 switch (cond1Categ) {
586 phiIndex1 = (*candMuVec)[obj1Index]->phiIndex();
587 etaIndex1 = (*candMuVec)[obj1Index]->etaIndex();
590 objPairIndex, 1, phiIndex1, phiIndex1Converted);
598 cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
607 switch (cndObjTypeVec[1]) {
628 phiIndex1 = (*candCaloVec)[obj1Index]->phiIndex();
629 etaIndex1 = (*candCaloVec)[obj1Index]->etaIndex();
632 objPairIndex, 1, phiIndex1, phiIndex1Converted);
640 cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
650 switch (cndObjTypeVec[1]) {
653 phiIndex1 = candETM->
phi();
656 objPairIndex, 1, phiIndex1, phiIndex1Converted);
666 phiIndex1 = candHTM->
phi();
669 objPairIndex, 1, phiIndex1, phiIndex1Converted);
691 LogTrace(
"L1GlobalTrigger") <<
" Correlation pair ["
694 <<
"] with collection indices [" << obj0Index <<
", "
695 << obj1Index <<
"] " <<
" has: \n phi indices = ["
696 << phiIndex0 <<
", " << phiIndex1 <<
"] converted to ["
697 << phiIndex0Converted <<
", " << phiIndex1Converted
698 <<
"] \n eta indices [" << etaIndex0 <<
", "
699 << etaIndex1 <<
"] converted to ["
700 << etaIndex0Converted <<
", " << etaIndex1Converted
701 <<
"] \n" << std::endl;
706 bool reqEtaPhiResult =
false;
710 unsigned int candDeltaPhi;
713 if (phiIndex0Converted > phiIndex1Converted) {
714 candDeltaPhi = phiIndex0Converted - phiIndex1Converted;
716 candDeltaPhi = phiIndex1Converted - phiIndex0Converted;
726 while (candDeltaPhi >= corrParDeltaPhiNrBins) {
728 unsigned int candDeltaPhiInitial = candDeltaPhi;
731 candDeltaPhi = (corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
734 <<
" Initial candDeltaPhi = "
735 << candDeltaPhiInitial
736 <<
" > corrParDeltaPhiNrBins = "
737 << corrParDeltaPhiNrBins
738 <<
" ==> candDeltaPhi rescaled to: "
739 << candDeltaPhi <<
" [ loop index " << iLoop
740 <<
"; breaks after " << nMaxLoop <<
" loops ]\n"
745 if (iLoop > nMaxLoop) {
753 bool indResult =
true;
755 for (
size_t iDeltaPhi = 0; iDeltaPhi < deltaPhiRangeConv.size(); ++iDeltaPhi) {
756 if (!
checkBit(deltaPhiRangeConv[iDeltaPhi], candDeltaPhi)) {
764 LogTrace(
"L1GlobalTrigger") <<
" object delta phi = "
765 << candDeltaPhi <<
" fails delta phi requirements."
766 <<
"\n Pair fails correlation condition.\n"
770 reqEtaPhiResult =
false;
775 LogTrace(
"L1GlobalTrigger") <<
" object delta phi = "
777 <<
" passes delta phi requirements."
785 unsigned int candDeltaEta;
788 if (etaIndex0Converted > etaIndex1Converted) {
789 candDeltaEta = etaIndex0Converted - etaIndex1Converted;
791 candDeltaEta = etaIndex1Converted - etaIndex0Converted;
798 for (
size_t iDeltaEta = 0; iDeltaEta < deltaEtaRangeConv.size(); ++iDeltaEta) {
799 if (!
checkBit(deltaEtaRangeConv[iDeltaEta], candDeltaEta)) {
807 LogTrace(
"L1GlobalTrigger") <<
" object delta eta = "
808 << candDeltaEta <<
" fails delta eta requirements."
809 <<
"\n Pair fails correlation condition.\n"
813 reqEtaPhiResult =
false;
818 LogTrace(
"L1GlobalTrigger") <<
" object delta eta = "
820 <<
" passes delta eta requirements."
821 <<
"\n Pair passes correlation condition.\n"
825 reqEtaPhiResult =
true;
831 objectsInComb.clear();
833 objectsInComb.push_back(obj0Index);
834 objectsInComb.push_back(obj1Index);
839 if (reqEtaPhiResult) {
854 cndObjTypeVec[1]) <<
"] pass(es) the correlation condition.\n"
L1GtCorrelationCondition & operator=(const L1GtCorrelationCondition &)
virtual ~L1GtCorrelationCondition()
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
const std::vector< const L1GctCand * > * getCandL1TauJet() const
pointer to TauJet data list
void print(std::ostream &myCout) const
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 * > * getCandL1CenJet() const
pointer to CenJet 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 std::vector< const L1GctCand * > * getCandL1NoIsoEG() const
pointer to NoIsoEG data list
unsigned int m_nrBinsPhi
number of bins for delta phi
const std::vector< const L1GctCand * > * getCandL1ForJet() const
pointer to ForJet data list
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)
void print(std::ostream &myCout) const
print condition
unsigned phi() const
get the Et
std::string l1GtObjectEnumToString(const L1GtObject &)
const unsigned int gtObjectPairIndex(const L1GtObject &, const L1GtObject &) const
void print(std::ostream &myCout) const
print condition
std::string deltaEtaRange
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
L1GtCorrelationCondition()
const std::vector< const L1GctCand * > * getCandL1IsoEG() const
pointer to IsoEG data list
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
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
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.
const L1GctEtMiss * getCandL1ETM() const
pointer to ETM data list
virtual void print(std::ostream &myCout) const
print the condition
void setGtPSB(const L1GlobalTriggerPSB *)
bool hexStringToInt64(const std::string &, std::vector< unsigned long long > &)
void print(std::ostream &myCout) const
print condition
const bool convertPhiIndex(const unsigned int pairIndex, const unsigned int positionPair, const unsigned int initialIndex, unsigned int &convertedIndex) const
void setGtGTL(const L1GlobalTriggerGTL *)
virtual void print(std::ostream &myCout) const
print condition
const bool evaluateCondition() const
the core function to check if the condition matches
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
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
tuple size
Write out results.
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