Skip to content

Commit

Permalink
Splitting in condEnergySum and condZdcEnergySum to avoid the overwrit…
Browse files Browse the repository at this point in the history
…ing of standard ESum with ZDC ESum
  • Loading branch information
Elisa Fontanesi committed Aug 29, 2023
1 parent 8d5dd02 commit ef810e2
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 26 deletions.
1 change: 1 addition & 0 deletions L1Trigger/L1TGlobal/interface/GlobalDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ namespace l1t {
CondMuon,
CondCalo,
CondEnergySum,
CondZdcEnergySum,
CondCorrelation,
CondExternal,
CondCorrelationWithOverlapRemoval,
Expand Down
15 changes: 8 additions & 7 deletions L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) "
Expand All @@ -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;
Expand All @@ -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<L1TUtmObject>& objects = condEnergySum.getObjects();
const std::vector<L1TUtmObject>& objects = condZdcEnergySum.getObjects();
for (size_t jj = 0; jj < objects.size(); jj++) {
const L1TUtmObject& object = objects.at(jj);
gEq = (object.getComparisonOperator() == esComparisonOperator::GE);
Expand Down Expand Up @@ -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;

Expand Down
13 changes: 11 additions & 2 deletions L1Trigger/L1TGlobal/src/GlobalBoard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions L1Trigger/L1TGlobal/src/GlobalCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/L1TGlobal/src/GlobalDefinitions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
24 changes: 11 additions & 13 deletions L1Trigger/L1TGlobal/src/ZdcEnergySumCondition.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
1;95;0c* \class ZdcEnergySumCondition
\class ZdcEnergySumCondition
*
*
* Description: evaluation of a CondEnergySum condition for ZDC objects.
Expand All @@ -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
*
*/

Expand Down Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions L1Trigger/L1TGlobal/src/ZdcEnergySumTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ef810e2

Please sign in to comment.