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

[Backport] Adding 2Loose HMT showers in the GT emulator #41249

Merged
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions L1Trigger/L1TGlobal/interface/MuonShowerTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class MuonShowerTemplate : public GlobalCondition {
struct ObjectParameter {
bool MuonShower0;
bool MuonShower1;
bool MuonShower2;
bool MuonShowerOutOfTime0;
bool MuonShowerOutOfTime1;
};
Expand Down
3 changes: 3 additions & 0 deletions L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ void l1t::TriggerMenuParser::parseCondFormats(const L1TUtmTriggerMenu* utmMenu)

} else if (condition.getType() == esConditionType::MuonShower0 ||
condition.getType() == esConditionType::MuonShower1 ||
condition.getType() == esConditionType::MuonShower2 ||
condition.getType() == esConditionType::MuonShowerOutOfTime0 ||
condition.getType() == esConditionType::MuonShowerOutOfTime1) {
parseMuonShower(condition, chipNr, false);
Expand Down Expand Up @@ -1577,6 +1578,8 @@ bool l1t::TriggerMenuParser::parseMuonShower(tmeventsetup::esCondition condMu,
objParameter[0].MuonShower0 = true;
} else if (condMu.getType() == esConditionType::MuonShower1) {
objParameter[0].MuonShower1 = true;
} else if (condMu.getType() == esConditionType::MuonShower2) {
objParameter[0].MuonShower2 = true;
} else if (condMu.getType() == esConditionType::MuonShowerOutOfTime0) {
objParameter[0].MuonShowerOutOfTime0 = true;
} else if (condMu.getType() == esConditionType::MuonShowerOutOfTime1) {
Expand Down
82 changes: 47 additions & 35 deletions L1Trigger/L1TGlobal/src/GlobalBoard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* \author: E. Fontanesi - extended for three-body correlation conditions
*
* \author: E. Fontanesi, E. Yigitbasi, A. Loeliger (original implementation by S. Dildick, 2021)
* - fix for the muon shower triggers
* - fix for the muon shower triggers and check on all BXs
* \author: E. Fontanesi - added 2Loose HMT for 2023 Run 3
*
* $Date$
* $Revision$
Expand Down Expand Up @@ -379,41 +380,52 @@ void l1t::GlobalBoard::receiveMuonShowerObjectData(const edm::Event& iEvent,
<< "\nrequested in configuration, but not found in the event.\n";
}
} else {
// Loop over Muon Showers in this bx
int nObj = 0;
for (auto mu = muonData->begin(0); mu != muonData->end(0); ++mu) {
if (nObj < nrL1MuShower) {
/* NOTE: here the single object is split up into 4 separate MuonShower objects
similarly to the description in the UTM library, where the conditions are four different objects.
*/

std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOneTightInTime =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);

musOneNominalInTime->setOneNominalInTime(mu->isOneNominalInTime());
musOneTightInTime->setOneTightInTime(mu->isOneTightInTime());
musOutOfTime0->setMusOutOfTime0(mu->musOutOfTime0());
musOutOfTime1->setMusOutOfTime1(mu->musOutOfTime1());

(*m_candL1MuShower).push_back(0, musOneNominalInTime);
(*m_candL1MuShower).push_back(0, musOneTightInTime);
(*m_candL1MuShower).push_back(0, musOutOfTime0);
(*m_candL1MuShower).push_back(0, musOutOfTime1);
// Loop over bx in muon data
for (int i = muonData->getFirstBX(); i <= muonData->getLastBX(); ++i) {
// Prevent from pushing back bx that is outside of allowed range
if (i < m_bxFirst_ || i > m_bxLast_)
continue;

} else {
edm::LogWarning("L1TGlobal") << " Too many Muon Showers (" << nObj
<< ") for uGT Configuration maxMuShower =" << nrL1MuShower;
}
nObj++;
} //end loop over muon showers in bx
} //end if over valid muon shower data
} //end if ReceiveMuonShower data
// Loop over Muon Showers in this bx
int nObj = 0;
for (std::vector<l1t::MuonShower>::const_iterator mu = muonData->begin(i); mu != muonData->end(i); ++mu) {
if (nObj < nrL1MuShower) {
/* NOTE: here the single object is split up into 5 separate MuonShower objects
similarly to the description in the UTM library, where the conditions are four different objects.
*/

std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOneTightInTime =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musTwoLooseDiffSectorsInTime =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);
std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
std::make_shared<l1t::MuonShower>(false, false, false, false, false, false);

musOneNominalInTime->setOneNominalInTime(mu->isOneNominalInTime());
musOneTightInTime->setOneTightInTime(mu->isOneTightInTime());
musTwoLooseDiffSectorsInTime->setTwoLooseDiffSectorsInTime(mu->isTwoLooseDiffSectorsInTime());
musOutOfTime0->setMusOutOfTime0(mu->musOutOfTime0());
musOutOfTime1->setMusOutOfTime1(mu->musOutOfTime1());

(*m_candL1MuShower).push_back(i, musOneNominalInTime);
(*m_candL1MuShower).push_back(i, musOneTightInTime);
(*m_candL1MuShower).push_back(i, musTwoLooseDiffSectorsInTime);
(*m_candL1MuShower).push_back(i, musOutOfTime0);
(*m_candL1MuShower).push_back(i, musOutOfTime1);

} else {
edm::LogWarning("L1TGlobal") << " Too many Muon Showers (" << nObj
<< ") for uGT Configuration maxMuShower =" << nrL1MuShower;
}
nObj++;
} //end loop over muon showers in bx
} //end loop over bx
} //end if over valid muon shower data
} //end if ReceiveMuonShower data
}

// receive data from Global External Conditions
Expand Down
17 changes: 13 additions & 4 deletions L1Trigger/L1TGlobal/src/MuonShowerCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
* Implementation:
* This condition class checks for the presente of a valid muon shower in the event.
* If present, according to the condition parsed by the xml menu
* (four possibilities for the first Run 3 implementation: MuonShower0, MuonShower1, MuonShowerOutOfTime0, MuonShowerOutOfTime1)
* the corresponding boolean flag is checked (isOneNominalInTime, isOneTightInTime, musOutOfTime0, musOutOfTime1).
* (five possibilities for the 2023 Run 3 implementation: MuonShower0, MuonShower1, MuonShower2, MuonShowerOutOfTime0, MuonShowerOutOfTime1)
* the corresponding boolean flag is checked (isOneNominalInTime, isOneTightInTime, isTwoLooseDiffSectorsInTime, musOutOfTime0, musOutOfTime1).
* If it is set to 1, the condition is satisfied and the object is saved.
* Note that for the start of Run 3 only two cases are considered in the menu: Nominal and Tight muon showers.
* Note that for the start of Run 3 only two cases were considered in the menu: Nominal and Tight muon showers,
* an additional case is added for the 2023 data-taking: TwoLooseDiffSectors muon showers.
*
* \author: S. Dildick (2021) - Rice University
*
* \fixes by: E. Fontanesi, E. Yigitbasi, A. Loeliger (2023)
* \adding TwoLooseDiffSectors HMT: E. Fontanesi
*
*/

Expand Down Expand Up @@ -177,12 +179,14 @@ const bool l1t::MuonShowerCondition::checkObjectParameter(const int iCondition,

LogDebug("L1TGlobal") << "\n MuonShowerTemplate::ObjectParameter (utm objects, checking which condition is parsed): "
<< std::hex << "\n\t MuonShower0 = 0x " << objPar.MuonShower0 << "\n\t MuonShower1 = 0x "
<< objPar.MuonShower1 << "\n\t MuonShowerOutOfTime0 = 0x " << objPar.MuonShowerOutOfTime0
<< objPar.MuonShower1 << "\n\t MuonShower2 = 0x " << objPar.MuonShower2
<< "\n\t MuonShowerOutOfTime0 = 0x " << objPar.MuonShowerOutOfTime0
<< "\n\t MuonShowerOutOfTime1 = 0x " << objPar.MuonShowerOutOfTime1 << std::endl;

LogDebug("L1TGlobal") << "\n l1t::MuonShower (uGT emulator bits): "
<< "\n\t MuonShower0: isOneNominalInTime() = " << cand.isOneNominalInTime()
<< "\n\t MuonShower1: isOneTightInTime() = " << cand.isOneTightInTime()
<< "\n\t MuonShower2: isTwoLooseDiffSectorsInTime() = " << cand.isTwoLooseDiffSectorsInTime()
<< "\n\t MuonShowerOutOfTime0: musOutOfTime0() = " << cand.musOutOfTime0()
<< "\n\t MuonShowerOutOfTime1: musOutOfTime1() = " << cand.musOutOfTime1() << std::endl;

Expand All @@ -196,6 +200,11 @@ const bool l1t::MuonShowerCondition::checkObjectParameter(const int iCondition,
LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower1 requirement" << std::endl;
return false;
}
// Check twoLooseInTime
if (cand.isTwoLooseDiffSectorsInTime() != objPar.MuonShower2) {
LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShower2 requirement" << std::endl;
return false;
}
if (cand.musOutOfTime0() != objPar.MuonShowerOutOfTime0) {
LogDebug("L1TGlobal") << "\t\t MuonShower failed MuonShowerOutOfTime0 requirement" << std::endl;
return false;
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/L1TGlobal/src/MuonShowerTemplate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void MuonShowerTemplate::print(std::ostream& myCout) const {
myCout << " Template for object " << i << " [ hex ]" << std::endl;
myCout << " MuonShower0 = " << std::hex << m_objectParameter[i].MuonShower0 << std::endl;
myCout << " MuonShower1 = " << std::hex << m_objectParameter[i].MuonShower1 << std::endl;
myCout << " MuonShower2 = " << std::hex << m_objectParameter[i].MuonShower2 << std::endl;
myCout << " MuonShowerOutOfTime0 = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime0 << std::endl;
myCout << " MuonShowerOutOfTime1 = " << std::hex << m_objectParameter[i].MuonShowerOutOfTime1 << std::endl;
}
Expand Down