#include <L1GtCorrelationCondition.h>
Public Member Functions | |
const bool | evaluateCondition () const |
the core function to check if the condition matches | |
const L1GtCorrelationTemplate * | gtCorrelationTemplate () const |
get / set the pointer to a L1GtCondition | |
const L1GlobalTriggerGTL * | gtGTL () const |
get / set the pointer to GTL | |
const unsigned int | gtNrBinsPhi () const |
get / set the number of phi bins | |
const L1GlobalTriggerPSB * | gtPSB () const |
get / set the pointer to PSB | |
L1GtCorrelationCondition (const L1GtCondition *, const L1GtCondition *, const L1GtCondition *, const int, const int, const int, const int, const L1GlobalTriggerGTL *, const L1GlobalTriggerPSB *, const L1GtEtaPhiConversions *) | |
from base template condition (from event setup usually) | |
L1GtCorrelationCondition (const L1GtCorrelationCondition &) | |
L1GtCorrelationCondition () | |
L1GtCorrelationCondition & | operator= (const L1GtCorrelationCondition &) |
void | print (std::ostream &myCout) const |
print condition | |
void | setGtCorrelationTemplate (const L1GtCorrelationTemplate *) |
void | setGtGTL (const L1GlobalTriggerGTL *) |
void | setGtNrBinsPhi (const unsigned int) |
void | setGtPSB (const L1GlobalTriggerPSB *) |
virtual | ~L1GtCorrelationCondition () |
Private Member Functions | |
void | copy (const L1GtCorrelationCondition &cp) |
copy function for copy constructor and operator= | |
Private Attributes | |
int | m_cond0EtaBits |
int | m_cond0NrL1Objects |
int | m_cond1EtaBits |
int | m_cond1NrL1Objects |
const L1GtCondition * | m_gtCond0 |
pointer to first sub-condition | |
const L1GtCondition * | m_gtCond1 |
pointer to second sub-condition | |
const L1GtCorrelationTemplate * | m_gtCorrelationTemplate |
pointer to a L1GtCorrelationTemplate | |
const L1GtEtaPhiConversions * | m_gtEtaPhiConversions |
pointer to eta and phi conversion class | |
const L1GlobalTriggerGTL * | m_gtGTL |
pointer to GTL, to be able to get the trigger objects | |
const L1GlobalTriggerPSB * | m_gtPSB |
pointer to PSB, to be able to get the trigger objects | |
bool | m_isDebugEnabled |
unsigned int | m_nrBinsPhi |
number of bins for delta phi |
Description: evaluation of a CondCorrelation condition.
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 36 of file L1GtCorrelationCondition.h.
L1GtCorrelationCondition::L1GtCorrelationCondition | ( | ) |
constructors default
Definition at line 60 of file L1GtCorrelationCondition.cc.
: L1GtConditionEvaluation(), m_isDebugEnabled(edm::isDebugEnabled()) { // empty }
L1GtCorrelationCondition::L1GtCorrelationCondition | ( | const L1GtCondition * | corrTemplate, |
const L1GtCondition * | cond0Condition, | ||
const L1GtCondition * | cond1Condition, | ||
const int | cond0NrL1Objects, | ||
const int | cond1NrL1Objects, | ||
const int | cond0EtaBits, | ||
const int | cond1EtaBits, | ||
const L1GlobalTriggerGTL * | ptrGTL, | ||
const L1GlobalTriggerPSB * | ptrPSB, | ||
const L1GtEtaPhiConversions * | etaPhiConversions | ||
) |
from base template condition (from event setup usually)
Definition at line 70 of file L1GtCorrelationCondition.cc.
References L1GtConditionEvaluation::m_condMaxNumberObjects, and m_nrBinsPhi.
: L1GtConditionEvaluation(), m_gtCorrelationTemplate(static_cast<const L1GtCorrelationTemplate*>(corrTemplate)), m_gtCond0(cond0Condition), m_gtCond1(cond1Condition), m_cond0NrL1Objects(cond0NrL1Objects), m_cond1NrL1Objects(cond1NrL1Objects), m_cond0EtaBits(cond0EtaBits), m_cond1EtaBits(cond1EtaBits), m_gtGTL(ptrGTL), m_gtPSB(ptrPSB), m_gtEtaPhiConversions(etaPhiConversions), m_isDebugEnabled(edm::isDebugEnabled()) { m_condMaxNumberObjects = 2; // irrelevant for correlation conditions m_nrBinsPhi = 0; }
L1GtCorrelationCondition::L1GtCorrelationCondition | ( | const L1GtCorrelationCondition & | cp | ) |
Definition at line 122 of file L1GtCorrelationCondition.cc.
References copy().
: L1GtConditionEvaluation() { copy(cp); }
L1GtCorrelationCondition::~L1GtCorrelationCondition | ( | ) | [virtual] |
Definition at line 129 of file L1GtCorrelationCondition.cc.
{
// empty
}
void L1GtCorrelationCondition::copy | ( | const L1GtCorrelationCondition & | cp | ) | [private] |
copy function for copy constructor and operator=
Definition at line 92 of file L1GtCorrelationCondition.cc.
References L1GtConditionEvaluation::m_combinationsInCond, m_cond0EtaBits, m_cond0NrL1Objects, m_cond1EtaBits, m_cond1NrL1Objects, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtCond0, m_gtCond1, m_gtCorrelationTemplate, m_gtEtaPhiConversions, m_gtGTL, m_gtPSB, m_isDebugEnabled, m_nrBinsPhi, and L1GtConditionEvaluation::m_verbosity.
Referenced by L1GtCorrelationCondition(), and operator=().
{ m_gtCorrelationTemplate = cp.m_gtCorrelationTemplate; m_gtCond0 = cp.m_gtCond0; m_gtCond1 = cp.m_gtCond1; m_cond0NrL1Objects = cp.m_cond0NrL1Objects; m_cond1NrL1Objects = cp.m_cond1NrL1Objects; m_cond0EtaBits = cp.m_cond0EtaBits; m_cond1EtaBits = cp.m_cond1EtaBits; m_nrBinsPhi = cp.m_nrBinsPhi; m_gtCorrelationTemplate = cp.m_gtCorrelationTemplate; m_gtGTL = cp.m_gtGTL; m_gtPSB = cp.m_gtPSB; m_gtEtaPhiConversions = cp.m_gtEtaPhiConversions; m_condMaxNumberObjects = cp.m_condMaxNumberObjects; m_condLastResult = cp.m_condLastResult; m_combinationsInCond = cp.m_combinationsInCond; m_verbosity = cp.m_verbosity; m_isDebugEnabled = cp.m_isDebugEnabled; }
const bool L1GtCorrelationCondition::evaluateCondition | ( | ) | const [virtual] |
the core function to check if the condition matches
Implements L1GtConditionEvaluation.
Definition at line 174 of file L1GtCorrelationCondition.cc.
References CenJet, L1GtConditionEvaluation::checkBit(), hitfit::clear(), L1GtConditionEvaluation::combinationsInCond(), L1GtCorrelationTemplate::cond0Category(), L1GtCorrelationTemplate::cond1Category(), CondCalo, CondEnergySum, L1GtConditionEvaluation::condLastResult(), CondMuon, L1GtEtaPhiConversions::convertEtaIndex(), L1GtEtaPhiConversions::convertPhiIndex(), L1GtCorrelationTemplate::correlationParameter(), L1GtCorrelationTemplate::CorrelationParameter::deltaEtaRange, L1GtCorrelationTemplate::CorrelationParameter::deltaPhiRange, ETM, L1GtConditionEvaluation::evaluateConditionStoreResult(), ForJet, L1GlobalTriggerPSB::getCandL1CenJet(), L1GlobalTriggerPSB::getCandL1ETM(), L1GlobalTriggerPSB::getCandL1ForJet(), L1GlobalTriggerPSB::getCandL1HTM(), L1GlobalTriggerPSB::getCandL1IsoEG(), L1GlobalTriggerGTL::getCandL1Mu(), L1GlobalTriggerPSB::getCandL1NoIsoEG(), L1GlobalTriggerPSB::getCandL1TauJet(), L1GtConditionEvaluation::getCombinationsInCond(), L1GtEtaPhiConversions::gtObjectNrBinsPhi(), L1GtEtaPhiConversions::gtObjectPairIndex(), hexStringToInt64(), HTM, IsoEG, l1GtObjectEnumToString(), LogTrace, m_cond0EtaBits, m_cond0NrL1Objects, m_cond1EtaBits, m_cond1NrL1Objects, m_gtCond0, m_gtCond1, m_gtCorrelationTemplate, m_gtEtaPhiConversions, m_gtGTL, m_gtPSB, m_isDebugEnabled, L1GtConditionEvaluation::m_verbosity, Mu, NoIsoEG, L1GtCondition::objectType(), L1GctHtMiss::phi(), L1GctEtMiss::phi(), L1GtCaloCondition::print(), L1GtMuonCondition::print(), L1GtEnergySumCondition::print(), findQualityFiles::size, and TauJet.
{ // std::cout << "m_isDebugEnabled = " << m_isDebugEnabled << std::endl; // std::cout << "m_verbosity = " << m_verbosity << std::endl; bool condResult = false; bool reqObjResult = false; // number of objects in condition (it is 2, no need to retrieve from // condition template) and their type int nObjInCond = 2; std::vector<L1GtObject> cndObjTypeVec(nObjInCond); // evaluate first the two sub-conditions (Type1s) const L1GtConditionCategory cond0Categ = m_gtCorrelationTemplate->cond0Category(); const L1GtConditionCategory cond1Categ = m_gtCorrelationTemplate->cond1Category(); const L1GtMuonTemplate* corrMuon = 0; const L1GtCaloTemplate* corrCalo = 0; const L1GtEnergySumTemplate* corrEnergySum = 0; // FIXME copying is slow... CombinationsInCond cond0Comb; CombinationsInCond cond1Comb; switch (cond0Categ) { case CondMuon: { corrMuon = static_cast<const L1GtMuonTemplate*>(m_gtCond0); L1GtMuonCondition muCondition(corrMuon, m_gtGTL, m_cond0NrL1Objects, m_cond0EtaBits); muCondition.evaluateConditionStoreResult(); reqObjResult = muCondition.condLastResult(); cond0Comb = (muCondition.getCombinationsInCond()); cndObjTypeVec[0] = (corrMuon->objectType())[0]; if (m_verbosity && m_isDebugEnabled ) { std::ostringstream myCout; muCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; case CondCalo: { corrCalo = static_cast<const L1GtCaloTemplate*>(m_gtCond0); L1GtCaloCondition caloCondition(corrCalo, m_gtPSB, m_cond0NrL1Objects, m_cond0NrL1Objects, m_cond0NrL1Objects, m_cond0NrL1Objects, m_cond0NrL1Objects, m_cond0EtaBits); caloCondition.evaluateConditionStoreResult(); reqObjResult = caloCondition.condLastResult(); cond0Comb = (caloCondition.getCombinationsInCond()); cndObjTypeVec[0] = (corrCalo->objectType())[0]; if (m_verbosity && m_isDebugEnabled) { std::ostringstream myCout; caloCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; case CondEnergySum: { corrEnergySum = static_cast<const L1GtEnergySumTemplate*>(m_gtCond0); L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB); eSumCondition.evaluateConditionStoreResult(); reqObjResult = eSumCondition.condLastResult(); cond0Comb = (eSumCondition.getCombinationsInCond()); cndObjTypeVec[0] = (corrEnergySum->objectType())[0]; if (m_verbosity && m_isDebugEnabled ) { std::ostringstream myCout; eSumCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; default: { // should not arrive here, there are no correlation conditions defined for this object return false; } break; } // return if first subcondition is false if (!reqObjResult) { if (m_verbosity && m_isDebugEnabled) { LogTrace("L1GlobalTrigger") << "\n First sub-condition false, second sub-condition not evaluated and not printed." << std::endl; } return false; } // second object reqObjResult = false; switch (cond1Categ) { case CondMuon: { corrMuon = static_cast<const L1GtMuonTemplate*>(m_gtCond1); L1GtMuonCondition muCondition(corrMuon, m_gtGTL, m_cond1NrL1Objects, m_cond1EtaBits); muCondition.evaluateConditionStoreResult(); reqObjResult = muCondition.condLastResult(); cond1Comb = (muCondition.getCombinationsInCond()); cndObjTypeVec[1] = (corrMuon->objectType())[0]; if (m_verbosity && m_isDebugEnabled ) { std::ostringstream myCout; muCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; case CondCalo: { corrCalo = static_cast<const L1GtCaloTemplate*>(m_gtCond1); L1GtCaloCondition caloCondition(corrCalo, m_gtPSB, m_cond1NrL1Objects, m_cond1NrL1Objects, m_cond1NrL1Objects, m_cond1NrL1Objects, m_cond1NrL1Objects, m_cond1EtaBits); caloCondition.evaluateConditionStoreResult(); reqObjResult = caloCondition.condLastResult(); cond1Comb = (caloCondition.getCombinationsInCond()); cndObjTypeVec[1] = (corrCalo->objectType())[0]; if (m_verbosity && m_isDebugEnabled) { std::ostringstream myCout; caloCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; case CondEnergySum: { corrEnergySum = static_cast<const L1GtEnergySumTemplate*>(m_gtCond1); L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB); eSumCondition.evaluateConditionStoreResult(); reqObjResult = eSumCondition.condLastResult(); cond1Comb = (eSumCondition.getCombinationsInCond()); cndObjTypeVec[1] = (corrEnergySum->objectType())[0]; if (m_verbosity && m_isDebugEnabled ) { std::ostringstream myCout; eSumCondition.print(myCout); LogTrace("L1GlobalTrigger") << myCout.str() << std::endl; } } break; default: { // should not arrive here, there are no correlation conditions defined for this object return false; } break; } // return if second sub-condition is false if (!reqObjResult) { return false; } else { LogTrace("L1GlobalTrigger") << "\n" << " Both sub-conditions true for object requirements." << " Evaluate correlation requirements.\n" << std::endl; } // // evaluate the delta_eta and delta_phi correlations // if here, the object requirements are satisfied for both sub-conditions // // get the correlation parameters L1GtCorrelationTemplate::CorrelationParameter corrPar = *(m_gtCorrelationTemplate->correlationParameter()); // convert the eta template requirements from string to 64-bit integers // number of 64-bit integers: string length / 16 size_t deltaEtaRangeConvSize = (corrPar.deltaEtaRange).size() / 16 + 1; std::vector<unsigned long long> deltaEtaRangeConv( deltaEtaRangeConvSize); if (!(hexStringToInt64(corrPar.deltaEtaRange, deltaEtaRangeConv))) { return false; } // convert the phi template requirements from string to 64-bit integers // number of 64-bit integers: string length / 16 size_t deltaPhiRangeConvSize = (corrPar.deltaPhiRange).size() / 16 + 1; std::vector<unsigned long long> deltaPhiRangeConv( deltaPhiRangeConvSize); if (!(hexStringToInt64(corrPar.deltaPhiRange, deltaPhiRangeConv))) { return false; } // get the index of L1 GT object pair unsigned int objPairIndex = (m_gtEtaPhiConversions->gtObjectPairIndex( cndObjTypeVec[0], cndObjTypeVec[1])); // get the maximum number of bins for the delta phi scales unsigned int corrParDeltaPhiNrBins = (m_gtEtaPhiConversions->gtObjectNrBinsPhi(objPairIndex)) / 2 + 1; // vector to store the indices of the calorimeter objects // from the combination evaluated in the condition SingleCombInCond objectsInComb; objectsInComb.reserve(nObjInCond); // clear the m_combinationsInCond vector (combinationsInCond()).clear(); // pointers to objects const std::vector<const L1MuGMTCand*>* candMuVec = 0; const std::vector<const L1GctCand*>* candCaloVec = 0; // only ETM and HTM can appear in correlation conditions const L1GctEtMiss* candETM = 0; const L1GctHtMiss* candHTM = 0; // make the conversions of the indices, depending on the combination of objects involved // (via pair index) unsigned int phiIndex0 = 0; unsigned int phiIndex1 = 0; unsigned int phiIndex0Converted = 0; unsigned int phiIndex1Converted = 0; unsigned int etaIndex0 = 0; unsigned int etaIndex1 = 0; unsigned int etaIndex0Converted = 0; unsigned int etaIndex1Converted = 0; LogTrace("L1GlobalTrigger") << " Sub-condition 0: std::vector<SingleCombInCond> size: " << (cond0Comb.size()) << std::endl; LogTrace("L1GlobalTrigger") << " Sub-condition 1: std::vector<SingleCombInCond> size: " << (cond1Comb.size()) << std::endl; // loop over all combinations which produced individually "true" as Type1s for (std::vector<SingleCombInCond>::const_iterator it0Comb = cond0Comb.begin(); it0Comb != cond0Comb.end(); it0Comb++) { // Type1s: there is 1 object only, no need for a loop, index 0 should be OK in (*it0Comb)[0] // ... but add protection to not crash int obj0Index = -1; if ((*it0Comb).size() > 0) { obj0Index = (*it0Comb)[0]; } else { LogTrace("L1GlobalTrigger") << "\n SingleCombInCond (*it0Comb).size() " << ((*it0Comb).size()) << std::endl; return false; } bool convStatus = false; switch (cond0Categ) { case CondMuon: { candMuVec = m_gtGTL->getCandL1Mu(); phiIndex0 = (*candMuVec)[obj0Index]->phiIndex(); etaIndex0 = (*candMuVec)[obj0Index]->etaIndex(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 0, phiIndex0, phiIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } convStatus = m_gtEtaPhiConversions->convertEtaIndex( Mu, etaIndex0, etaIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case CondCalo: { switch (cndObjTypeVec[0]) { case NoIsoEG: { candCaloVec = m_gtPSB->getCandL1NoIsoEG(); } break; case IsoEG: { candCaloVec = m_gtPSB->getCandL1IsoEG(); } break; case CenJet: { candCaloVec = m_gtPSB->getCandL1CenJet(); } break; case ForJet: { candCaloVec = m_gtPSB->getCandL1ForJet(); } break; case TauJet: { candCaloVec = m_gtPSB->getCandL1TauJet(); } break; default: { // do nothing } break; } phiIndex0 = (*candCaloVec)[obj0Index]->phiIndex(); etaIndex0 = (*candCaloVec)[obj0Index]->etaIndex(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 0, phiIndex0, phiIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } convStatus = m_gtEtaPhiConversions->convertEtaIndex( cndObjTypeVec[0], etaIndex0, etaIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case CondEnergySum: { switch (cndObjTypeVec[0]) { case ETM: { candETM = m_gtPSB->getCandL1ETM(); phiIndex0 = candETM->phi(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 0, phiIndex0, phiIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case HTM: { candHTM = m_gtPSB->getCandL1HTM(); phiIndex0 = candHTM->phi(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 0, phiIndex0, phiIndex0Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; default: // do nothing break; } } break; default: { // should not arrive here, there are no correlation conditions defined for this object return false; } break; } for (std::vector<SingleCombInCond>::const_iterator it1Comb = cond1Comb.begin(); it1Comb != cond1Comb.end(); it1Comb++) { // Type1s: there is 1 object only, no need for a loop (*it1Comb)[0] // ... but add protection to not crash int obj1Index = -1; if ((*it1Comb).size() > 0) { obj1Index = (*it1Comb)[0]; } else { LogTrace("L1GlobalTrigger") << "\n SingleCombInCond (*it1Comb).size() " << ((*it1Comb).size()) << std::endl; return false; } switch (cond1Categ) { case CondMuon: { candMuVec = m_gtGTL->getCandL1Mu(); phiIndex1 = (*candMuVec)[obj1Index]->phiIndex(); etaIndex1 = (*candMuVec)[obj1Index]->etaIndex(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 1, phiIndex1, phiIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } convStatus = m_gtEtaPhiConversions->convertEtaIndex( cndObjTypeVec[1], etaIndex1, etaIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case CondCalo: { switch (cndObjTypeVec[1]) { case NoIsoEG: candCaloVec = m_gtPSB->getCandL1NoIsoEG(); break; case IsoEG: candCaloVec = m_gtPSB->getCandL1IsoEG(); break; case CenJet: candCaloVec = m_gtPSB->getCandL1CenJet(); break; case ForJet: candCaloVec = m_gtPSB->getCandL1ForJet(); break; case TauJet: candCaloVec = m_gtPSB->getCandL1TauJet(); break; default: // do nothing break; } phiIndex1 = (*candCaloVec)[obj1Index]->phiIndex(); etaIndex1 = (*candCaloVec)[obj1Index]->etaIndex(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 1, phiIndex1, phiIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } convStatus = m_gtEtaPhiConversions->convertEtaIndex( cndObjTypeVec[1], etaIndex1, etaIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case CondEnergySum: { switch (cndObjTypeVec[1]) { case ETM: { candETM = m_gtPSB->getCandL1ETM(); phiIndex1 = candETM->phi(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 1, phiIndex1, phiIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; case HTM: { candHTM = m_gtPSB->getCandL1HTM(); phiIndex1 = candHTM->phi(); convStatus = m_gtEtaPhiConversions->convertPhiIndex( objPairIndex, 1, phiIndex1, phiIndex1Converted); if (!convStatus) { // conversion failed, message written in L1GtEtaPhiConversions return false; } } break; default: // do nothing break; } } break; default: { // should not arrive here, there are no correlation conditions defined for this object return false; } break; } if (m_verbosity && m_isDebugEnabled ) { LogTrace("L1GlobalTrigger") << " Correlation pair [" << l1GtObjectEnumToString(cndObjTypeVec[0]) << ", " << l1GtObjectEnumToString(cndObjTypeVec[1]) << "] with collection indices [" << obj0Index << ", " << obj1Index << "] " << " has: \n phi indices = [" << phiIndex0 << ", " << phiIndex1 << "] converted to [" << phiIndex0Converted << ", " << phiIndex1Converted << "] \n eta indices [" << etaIndex0 << ", " << etaIndex1 << "] converted to [" << etaIndex0Converted << ", " << etaIndex1Converted << "] \n" << std::endl; } // the conversions were successful, need to evaluate requirements now bool reqEtaPhiResult = false; // evaluate candDeltaPhi requirements unsigned int candDeltaPhi; // calculate absolute value of candDeltaPhi if (phiIndex0Converted > phiIndex1Converted) { candDeltaPhi = phiIndex0Converted - phiIndex1Converted; } else { candDeltaPhi = phiIndex1Converted - phiIndex0Converted; } // check if candDeltaPhi > 180 (via delta_phi_maxbits) // delta_phi contains bits for 0..180 (0 and 180 included) // protect also against infinite loop... int nMaxLoop = 10; int iLoop = 0; while (candDeltaPhi >= corrParDeltaPhiNrBins) { unsigned int candDeltaPhiInitial = candDeltaPhi; // candDeltaPhi > 180 ==> take 360 - candDeltaPhi candDeltaPhi = (corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi; if (m_verbosity) { LogTrace("L1GlobalTrigger") << " Initial candDeltaPhi = " << candDeltaPhiInitial << " > corrParDeltaPhiNrBins = " << corrParDeltaPhiNrBins << " ==> candDeltaPhi rescaled to: " << candDeltaPhi << " [ loop index " << iLoop << "; breaks after " << nMaxLoop << " loops ]\n" << std::endl; } iLoop++; if (iLoop > nMaxLoop) { return false; } } // template requirements already converted from string to 64-bit integers // ...now check for each 64-bit integer against template requirements bool indResult = true; for (size_t iDeltaPhi = 0; iDeltaPhi < deltaPhiRangeConv.size(); ++iDeltaPhi) { if (!checkBit(deltaPhiRangeConv[iDeltaPhi], candDeltaPhi)) { indResult = false; } } if (!indResult) { if (m_verbosity && m_isDebugEnabled ) { LogTrace("L1GlobalTrigger") << " object delta phi = " << candDeltaPhi << " fails delta phi requirements." << "\n Pair fails correlation condition.\n" << std::endl; } reqEtaPhiResult = false; continue; } else { if (m_verbosity && m_isDebugEnabled ) { LogTrace("L1GlobalTrigger") << " object delta phi = " << candDeltaPhi << " passes delta phi requirements." << std::endl; } } // evaluate candDeltaEta requirements unsigned int candDeltaEta; // calculate absolute value of candDeltaEta if (etaIndex0Converted > etaIndex1Converted) { candDeltaEta = etaIndex0Converted - etaIndex1Converted; } else { candDeltaEta = etaIndex1Converted - etaIndex0Converted; } // template requirements already converted from string to 64-bit integers // ...now check for each 64-bit integer against template requirements indResult = true; for (size_t iDeltaEta = 0; iDeltaEta < deltaEtaRangeConv.size(); ++iDeltaEta) { if (!checkBit(deltaEtaRangeConv[iDeltaEta], candDeltaEta)) { indResult = false; } } if (!indResult) { if (m_verbosity && m_isDebugEnabled ) { LogTrace("L1GlobalTrigger") << " object delta eta = " << candDeltaEta << " fails delta eta requirements." << "\n Pair fails correlation condition.\n" << std::endl; } reqEtaPhiResult = false; continue; } else { if (m_verbosity && m_isDebugEnabled ) { LogTrace("L1GlobalTrigger") << " object delta eta = " << candDeltaEta << " passes delta eta requirements." << "\n Pair passes correlation condition.\n" << std::endl; } reqEtaPhiResult = true; } // clear the indices in the combination objectsInComb.clear(); objectsInComb.push_back(obj0Index); objectsInComb.push_back(obj1Index); // if we get here all checks were successful for this combination // set the general result for evaluateCondition to "true" if (reqEtaPhiResult) { condResult = true; (combinationsInCond()).push_back(objectsInComb); } } } if (m_verbosity && m_isDebugEnabled && condResult) { LogTrace("L1GlobalTrigger") << (combinationsInCond()).size() << " correlation pair(s) [" << l1GtObjectEnumToString( cndObjTypeVec[0]) << ", " << l1GtObjectEnumToString( cndObjTypeVec[1]) << "] pass(es) the correlation condition.\n" << std::endl; } return condResult; }
const L1GtCorrelationTemplate* L1GtCorrelationCondition::gtCorrelationTemplate | ( | ) | const [inline] |
get / set the pointer to a L1GtCondition
Definition at line 78 of file L1GtCorrelationCondition.h.
References m_gtCorrelationTemplate.
{ return m_gtCorrelationTemplate; }
const L1GlobalTriggerGTL* L1GtCorrelationCondition::gtGTL | ( | ) | const [inline] |
get / set the pointer to GTL
Definition at line 85 of file L1GtCorrelationCondition.h.
References m_gtGTL.
{ return m_gtGTL; }
const unsigned int L1GtCorrelationCondition::gtNrBinsPhi | ( | ) | const [inline] |
get / set the number of phi bins
Definition at line 71 of file L1GtCorrelationCondition.h.
References m_nrBinsPhi.
{ return m_nrBinsPhi; }
const L1GlobalTriggerPSB* L1GtCorrelationCondition::gtPSB | ( | ) | const [inline] |
get / set the pointer to PSB
Definition at line 92 of file L1GtCorrelationCondition.h.
References m_gtPSB.
{ return m_gtPSB; }
L1GtCorrelationCondition & L1GtCorrelationCondition::operator= | ( | const L1GtCorrelationCondition & | cp | ) |
Definition at line 136 of file L1GtCorrelationCondition.cc.
References copy().
{ copy(cp); return *this; }
void L1GtCorrelationCondition::print | ( | std::ostream & | myCout | ) | const [virtual] |
print condition
Reimplemented from L1GtConditionEvaluation.
Definition at line 863 of file L1GtCorrelationCondition.cc.
References m_gtCorrelationTemplate, and L1GtCorrelationTemplate::print().
Referenced by L1GlobalTriggerGTL::run().
{ m_gtCorrelationTemplate->print(myCout); L1GtConditionEvaluation::print(myCout); }
void L1GtCorrelationCondition::setGtCorrelationTemplate | ( | const L1GtCorrelationTemplate * | corrTempl | ) |
Definition at line 152 of file L1GtCorrelationCondition.cc.
References m_gtCorrelationTemplate.
{ m_gtCorrelationTemplate = corrTempl; }
void L1GtCorrelationCondition::setGtGTL | ( | const L1GlobalTriggerGTL * | ptrGTL | ) |
Definition at line 160 of file L1GtCorrelationCondition.cc.
References m_gtGTL.
{ m_gtGTL = ptrGTL; }
void L1GtCorrelationCondition::setGtNrBinsPhi | ( | const unsigned int | nrBins | ) |
Definition at line 145 of file L1GtCorrelationCondition.cc.
References m_nrBinsPhi.
{ m_nrBinsPhi = nrBins; }
void L1GtCorrelationCondition::setGtPSB | ( | const L1GlobalTriggerPSB * | ptrPSB | ) |
Definition at line 167 of file L1GtCorrelationCondition.cc.
References m_gtPSB.
{ m_gtPSB = ptrPSB; }
int L1GtCorrelationCondition::m_cond0EtaBits [private] |
Definition at line 117 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
int L1GtCorrelationCondition::m_cond0NrL1Objects [private] |
Definition at line 115 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
int L1GtCorrelationCondition::m_cond1EtaBits [private] |
Definition at line 118 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
int L1GtCorrelationCondition::m_cond1NrL1Objects [private] |
Definition at line 116 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
const L1GtCondition* L1GtCorrelationCondition::m_gtCond0 [private] |
pointer to first sub-condition
Definition at line 109 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
const L1GtCondition* L1GtCorrelationCondition::m_gtCond1 [private] |
pointer to second sub-condition
Definition at line 112 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
const L1GtCorrelationTemplate* L1GtCorrelationCondition::m_gtCorrelationTemplate [private] |
pointer to a L1GtCorrelationTemplate
Definition at line 106 of file L1GtCorrelationCondition.h.
Referenced by copy(), evaluateCondition(), gtCorrelationTemplate(), print(), and setGtCorrelationTemplate().
const L1GtEtaPhiConversions* L1GtCorrelationCondition::m_gtEtaPhiConversions [private] |
pointer to eta and phi conversion class
Definition at line 130 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
const L1GlobalTriggerGTL* L1GtCorrelationCondition::m_gtGTL [private] |
pointer to GTL, to be able to get the trigger objects
Definition at line 124 of file L1GtCorrelationCondition.h.
Referenced by copy(), evaluateCondition(), gtGTL(), and setGtGTL().
const L1GlobalTriggerPSB* L1GtCorrelationCondition::m_gtPSB [private] |
pointer to PSB, to be able to get the trigger objects
Definition at line 127 of file L1GtCorrelationCondition.h.
Referenced by copy(), evaluateCondition(), gtPSB(), and setGtPSB().
bool L1GtCorrelationCondition::m_isDebugEnabled [private] |
Definition at line 134 of file L1GtCorrelationCondition.h.
Referenced by copy(), and evaluateCondition().
unsigned int L1GtCorrelationCondition::m_nrBinsPhi [private] |
number of bins for delta phi
Definition at line 121 of file L1GtCorrelationCondition.h.
Referenced by copy(), gtNrBinsPhi(), L1GtCorrelationCondition(), and setGtNrBinsPhi().