Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for proper separation of the ZDCP and ZDCM triggers in the uGT #42778

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions L1Trigger/L1TGlobal/src/EnergySumZdcCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@ const bool l1t::EnergySumZdcCondition::evaluateCondition(const int bxEval) const
}

const EnergySumZdcTemplate::ObjectParameter objPar = (*(m_gtEnergySumZdcTemplate->objectParameter()))[iCondition];
l1t::EtSum::EtSumType type;
switch ((m_gtEnergySumZdcTemplate->objectType())[0]) {
case gtZDCP:
type = l1t::EtSum::EtSumType::kZDCP;
break;
case gtZDCM:
type = l1t::EtSum::EtSumType::kZDCM;
break;
default:
edm::LogError("L1TGlobal")
<< "\n Error: "
<< "Unmatched object type from template to EtSumZdcType, (m_gtEnergySumZdcTemplate->objectType())[0] = "
<< (m_gtEnergySumZdcTemplate->objectType())[0] << std::endl;
type = l1t::EtSum::EtSumType::kZDCP;
break;
}

// Definition in CondFormats/L1TObjects/interface/L1GtCondition.h:
// condGEqVal indicates the operator used for the condition (>=, =): true for >=
Expand All @@ -136,24 +152,24 @@ const bool l1t::EnergySumZdcCondition::evaluateCondition(const int bxEval) const
for (int iEtSum = 0; iEtSum < numberObjectsZdc; ++iEtSum) {
l1t::EtSum candZdc = *(candVecZdc->at(useBx, iEtSum));

if (l1t::EtSum::EtSumType::kZDCP == candZdc.getType())
candZdcPlus = *(candVecZdc->at(useBx, iEtSum));
else if (l1t::EtSum::EtSumType::kZDCM == candZdc.getType())
candZdcMinus = *(candVecZdc->at(useBx, iEtSum));

LogDebug("L1TGlobal") << "CANDZdc: " << candZdc.hwPt() << ", " << useBx << ", " << candZdc.getType();
if (candZdc.getType() != type)
continue;

if (candZdc.getType() == l1t::EtSum::EtSumType::kZDCP) {
candZdcPlus = *(candVecZdc->at(useBx, iEtSum));
candZDCPEsum = candZdcPlus.hwPt();
myres = checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, candZDCPEsum, condGEqVal);
} else if (candZdc.getType() == l1t::EtSum::EtSumType::kZDCM) {
candZdcMinus = *(candVecZdc->at(useBx, iEtSum));
candZDCMEsum = candZdcMinus.hwPt();
myres = checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, candZDCMEsum, condGEqVal);
} else {
LogDebug("L1TGlobal") << "\t\t l1t::EtSum failed ZDC checkThreshold" << std::endl;
return false;
}

LogDebug("L1TGlobal") << "CANDZdc: " << candZdc.hwPt() << ", " << useBx << ", " << candZdc.getType();

LogDebug("L1TGlobal")
<< "----------------------------------------------> ZDC EtSumType object from EnergySumZdcTemplate"
<< "\n objPar.etLowThreshold = " << objPar.etLowThreshold
Expand Down