diff --git a/L1Trigger/L1TGlobal/interface/GlobalDefinitions.h b/L1Trigger/L1TGlobal/interface/GlobalDefinitions.h index 55df592b5de0d..154a131f612b5 100644 --- a/L1Trigger/L1TGlobal/interface/GlobalDefinitions.h +++ b/L1Trigger/L1TGlobal/interface/GlobalDefinitions.h @@ -98,6 +98,7 @@ namespace l1t { CondMuon, CondCalo, CondEnergySum, + CondZdcEnergySum, CondCorrelation, CondExternal, CondCorrelationWithOverlapRemoval, diff --git a/L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc b/L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc index 8c669a522e619..eb8dcf263889f 100644 --- a/L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc +++ b/L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc @@ -2398,7 +2398,7 @@ bool l1t::TriggerMenuParser::parseEnergySum(L1TUtmCondition condEnergySum, unsig * */ -bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condEnergySum, +bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condZdcEnergySum, unsigned int chipNr, const bool corrFlag) { // XERCES_CPP_NAMESPACE_USE @@ -2407,8 +2407,8 @@ bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condEnergySum, // get condition, particle name and type name std::string condition = "calo"; - std::string type = l1t2string(condEnergySum.getType()); - std::string name = l1t2string(condEnergySum.getName()); + std::string type = l1t2string(condZdcEnergySum.getType()); + std::string name = l1t2string(condZdcEnergySum.getName()); LogDebug("TriggerMenuParser") << "\n ****************************************** " << "\n (in parseZdcEnergySum) " @@ -2419,11 +2419,11 @@ bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condEnergySum, GlobalObject energySumObjType; GtConditionType cType; - if (condEnergySum.getType() == esConditionType::ZDCPlus) { + if (condZdcEnergySum.getType() == esConditionType::ZDCPlus) { LogDebug("TriggerMenuParser") << "ZDC signals: esConditionType::ZDCPlus " << std::endl; energySumObjType = GlobalObject::gtZDCP; cType = TypeZDCP; - } else if (condEnergySum.getType() == esConditionType::ZDCMinus) { + } else if (condZdcEnergySum.getType() == esConditionType::ZDCMinus) { LogDebug("TriggerMenuParser") << "ZDC signals: esConditionType::ZDCMinus " << std::endl; energySumObjType = GlobalObject::gtZDCM; cType = TypeZDCM; @@ -2448,10 +2448,10 @@ bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condEnergySum, int relativeBx = 0; bool gEq = false; - // l1t::EnergySumsObjectRequirement objPar = condEnergySum.objectRequirement(); + // l1t::EnergySumsObjectRequirement objPar = condZdcEnergySum.objectRequirement(); // Loop over objects and extract the cuts on the objects - const std::vector& objects = condEnergySum.getObjects(); + const std::vector& objects = condZdcEnergySum.getObjects(); for (size_t jj = 0; jj < objects.size(); jj++) { const L1TUtmObject& object = objects.at(jj); gEq = (object.getComparisonOperator() == esComparisonOperator::GE); @@ -2487,6 +2487,7 @@ bool l1t::TriggerMenuParser::parseZdcEnergySum(L1TUtmCondition condEnergySum, // Output for debugging LogDebug("TriggerMenuParser") << "\n ZdcEnergySum ET high threshold (hex) for energy sum object " << cnt + << "\n ZdcEnergySum ET high threshold (hex) for energy sum object " << cnt << " = " << std::hex << objParameter[cnt].etLowThreshold << " - " << objParameter[cnt].etHighThreshold << std::dec << std::endl; diff --git a/L1Trigger/L1TGlobal/src/GlobalBoard.cc b/L1Trigger/L1TGlobal/src/GlobalBoard.cc index 0935cdf6df929..6bee70017227e 100644 --- a/L1Trigger/L1TGlobal/src/GlobalBoard.cc +++ b/L1Trigger/L1TGlobal/src/GlobalBoard.cc @@ -623,6 +623,16 @@ void l1t::GlobalBoard::runGTL(const edm::Event&, cMapResults[itCond->first] = eSumCondition; + if (m_verbosity && m_isDebugEnabled) { + std::ostringstream myCout; + eSumCondition->print(myCout); + + LogTrace("L1TGlobal") << myCout.str(); + } + // delete eSumCondition; + + } break; + case CondZdcEnergySum: { ZdcEnergySumCondition* ZDCeSumCondition = new ZdcEnergySumCondition(itCond->second, this); ZDCeSumCondition->setVerbosity(m_verbosity); @@ -632,12 +642,11 @@ void l1t::GlobalBoard::runGTL(const edm::Event&, if (m_verbosity && m_isDebugEnabled) { std::ostringstream myCout; - eSumCondition->print(myCout); ZDCeSumCondition->print(myCout); LogTrace("L1TGlobal") << myCout.str(); } - // delete eSumCondition; + // delete ZDCeSumCondition; } break; diff --git a/L1Trigger/L1TGlobal/src/GlobalCondition.cc b/L1Trigger/L1TGlobal/src/GlobalCondition.cc index 3610d8aa0fa37..d9b7bd44a7786 100644 --- a/L1Trigger/L1TGlobal/src/GlobalCondition.cc +++ b/L1Trigger/L1TGlobal/src/GlobalCondition.cc @@ -199,6 +199,12 @@ void GlobalCondition::print(std::ostream& myCout) const { << "CondEnergySum" << std::endl; } + break; + case l1t::CondZdcEnergySum: { + myCout << " Condition category: " + << "CondZdcEnergySum" << std::endl; + } + break; case l1t::CondCorrelation: { myCout << " Condition category: " diff --git a/L1Trigger/L1TGlobal/src/GlobalDefinitions.cc b/L1Trigger/L1TGlobal/src/GlobalDefinitions.cc index 7f3d67a85fae7..6cc0d426b9f45 100644 --- a/L1Trigger/L1TGlobal/src/GlobalDefinitions.cc +++ b/L1Trigger/L1TGlobal/src/GlobalDefinitions.cc @@ -91,6 +91,7 @@ namespace { {"l1t::CondMuon", l1t::CondMuon}, {"l1t::CondCalo", l1t::CondCalo}, {"l1t::CondEnergySum", l1t::CondEnergySum}, + {"l1t::CondZdcEnergySum", l1t::CondZdcEnergySum}, {"l1t::CondCorrelation", l1t::CondCorrelation}, {"l1t::CondCorrelationThreeBody", l1t::CondCorrelationThreeBody}, {"l1t::CondCorrelationWithOverlapRemoval", l1t::CondCorrelationWithOverlapRemoval}, diff --git a/L1Trigger/L1TGlobal/src/ZdcEnergySumCondition.cc b/L1Trigger/L1TGlobal/src/ZdcEnergySumCondition.cc index 69d31e46d2ed2..03488f99b819b 100644 --- a/L1Trigger/L1TGlobal/src/ZdcEnergySumCondition.cc +++ b/L1Trigger/L1TGlobal/src/ZdcEnergySumCondition.cc @@ -1,5 +1,5 @@ /** - 1;95;0c* \class ZdcEnergySumCondition +\class ZdcEnergySumCondition * * * Description: evaluation of a CondEnergySum condition for ZDC objects. @@ -8,7 +8,7 @@ * and is adapted to evaluate a condition on ZDC objects as a threshold on an energy sum value. * The object types are kZDCP and kZDCM and share the standard EtSum DataFormat. * - * \author: Elisa Fontanesi and Christopher MC GINN + * \author: Elisa Fontanesi and Christopher Mc Ginn * */ @@ -131,13 +131,12 @@ const bool l1t::ZdcEnergySumCondition::evaluateCondition(const int bxEval) const bool myres = false; for (int iEtSum = 0; iEtSum < numberObjectsZdc; ++iEtSum) { - l1t::EtSum candZdc = *(candVecZdc->at(useBx + 2, iEtSum)); - // NOTE: usage of Bx 2 has to be fixed. At the moment it corresponds to 0 + l1t::EtSum candZdc = *(candVecZdc->at(useBx, iEtSum)); if (l1t::EtSum::EtSumType::kZDCP == candZdc.getType()) - candZdcPlus = *(candVecZdc->at(useBx + 2, iEtSum)); + candZdcPlus = *(candVecZdc->at(useBx, iEtSum)); else if (l1t::EtSum::EtSumType::kZDCM == candZdc.getType()) - candZdcMinus = *(candVecZdc->at(useBx + 2, iEtSum)); + candZdcMinus = *(candVecZdc->at(useBx, iEtSum)); LogDebug("L1TGlobal") << "CANDZdc: " << candZdc.hwPt() << ", " << useBx << ", " << candZdc.getType() << std::endl; if (candZdc.getType() == l1t::EtSum::EtSumType::kZDCP) { @@ -153,15 +152,14 @@ const bool l1t::ZdcEnergySumCondition::evaluateCondition(const int bxEval) const return false; } - LogDebug("L1TGlobal") - << "----------------------------------------------> ZDC EtSumType object from ZdcEnergySumTemplate" - << "\n objPar.etLowThreshold = " << objPar.etLowThreshold - << "\n objPar.etHighThreshold = " << objPar.etHighThreshold << "\n candZDCPEsum = " << candZDCPEsum - << "\n candZDCMEsum = " << candZDCMEsum << "\n condGEqVal = " << condGEqVal << "\n myres = " << myres - << std::endl; + LogDebug("L1TGlobal") << "ZDC EtSumType object from ZdcEnergySumTemplate: " + << "\n objPar.etLowThreshold = " << objPar.etLowThreshold + << "\n objPar.etHighThreshold = " << objPar.etHighThreshold + << "\n candZDCPEsum = " << candZDCPEsum << "\n candZDCMEsum = " << candZDCMEsum + << "\n condGEqVal = " << condGEqVal << "\n myres = " << myres << std::endl; } - if (!condGEqVal) + if (!(myres && condGEqVal)) return false; // index is always zero, as they are global quantities (there is only one object) diff --git a/L1Trigger/L1TGlobal/src/ZdcEnergySumTemplate.cc b/L1Trigger/L1TGlobal/src/ZdcEnergySumTemplate.cc index 5763a0c4b98c4..af993268bc197 100644 --- a/L1Trigger/L1TGlobal/src/ZdcEnergySumTemplate.cc +++ b/L1Trigger/L1TGlobal/src/ZdcEnergySumTemplate.cc @@ -29,15 +29,15 @@ // forward declarations // constructors -ZdcEnergySumTemplate::ZdcEnergySumTemplate() : GlobalCondition() { m_condCategory = l1t::CondEnergySum; } +ZdcEnergySumTemplate::ZdcEnergySumTemplate() : GlobalCondition() { m_condCategory = l1t::CondZdcEnergySum; } ZdcEnergySumTemplate::ZdcEnergySumTemplate(const std::string& cName) : GlobalCondition(cName) { - m_condCategory = l1t::CondEnergySum; + m_condCategory = l1t::CondZdcEnergySum; } ZdcEnergySumTemplate::ZdcEnergySumTemplate(const std::string& cName, const l1t::GtConditionType& cType) - : GlobalCondition(cName, l1t::CondEnergySum, cType) { - m_condCategory = l1t::CondEnergySum; + : GlobalCondition(cName, l1t::CondZdcEnergySum, cType) { + m_condCategory = l1t::CondZdcEnergySum; // should be always 1 - they are global quantities... int nObjects = nrObjects();