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

Add logic to produce "two loose showers in different sectors" in the MuonShowerProducer #41042

Merged
merged 1 commit into from Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 23 additions & 8 deletions L1Trigger/L1TMuon/plugins/L1TMuonShowerProducer.cc
Expand Up @@ -61,30 +61,45 @@ void L1TMuonShowerProducer::produce(edm::Event& iEvent, const edm::EventSetup& i
Showers that arrive out-of-time are also under consideration, but are not
going be to enabled at startup Run-3. So all showers should be in-time.
*/
bool isOneNominalInTime = false;
bool isTwoLooseInTime = false;
bool isOneTightInTime = false;
bool isOneNominalInTime{false};
bool isTwoLooseInTime{false};
bool isOneTightInTime{false};
bool isTwoLooseDifferentSectorsInTime{false};

bool foundOneLoose{false};
for (size_t i = 0; i < emtfShowers->size(0); ++i) {
auto shower = emtfShowers->at(0, i);
if (shower.isValid()) {
// nominal
if (shower.isOneNominalInTime())
if (shower.isOneNominalInTime()) {
isOneNominalInTime = true;
}
// two loose
if (shower.isTwoLooseInTime())
if (shower.isTwoLooseInTime()) {
isTwoLooseInTime = true;
}
// tight
if (shower.isOneTightInTime())
if (shower.isOneTightInTime()) {
isOneTightInTime = true;
}
// two loos in different sectors
if (shower.isOneLooseInTime()) {
if (foundOneLoose) {
isTwoLooseDifferentSectorsInTime = true;
} else {
foundOneLoose = true;
}
rappoccio marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

// Check for at least one nominal shower
const bool acceptCondition(isOneNominalInTime or isTwoLooseInTime or isOneTightInTime);
const bool acceptCondition{isOneNominalInTime or isTwoLooseInTime or isOneTightInTime or
isTwoLooseDifferentSectorsInTime};

if (acceptCondition) {
MuonShower outShower(isOneNominalInTime, false, isTwoLooseInTime, false, isOneTightInTime, false);
MuonShower outShower(
isOneNominalInTime, false, isTwoLooseInTime, false, isOneTightInTime, false, isTwoLooseDifferentSectorsInTime);
outShowers->push_back(0, outShower);
}
iEvent.put(std::move(outShowers));
Expand Down