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

Revert the requirement of having an associated L1T muon in L1TPhase2MuonOffline::matchMuonsToGen #39297

Merged
merged 1 commit into from
Sep 5, 2022
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
22 changes: 6 additions & 16 deletions DQMOffline/L1Trigger/src/L1TPhase2MuonOffline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,15 @@ void L1TPhase2MuonOffline::fillEfficiencyHistos() {
for (const auto var : effTypes_) {
auto varToFill = muIt.getVar(var);
for (const auto& cut : cuts_) {
const auto gmtPtCut = cut.first;
const auto q = cut.second;

efficiencyDen_[kSAMuon][eta][q][var]->Fill(varToFill);
if (muIt.gmtPt() < 0)
continue; // gmt muon does not exits
continue; // there is not an assciated gmt muon
if (muIt.gmtQual() < q * 4)
continue; //quality requirements
const auto gmtPtCut = cut.first;
if (var != kEffPt && muIt.gmtPt() < gmtPtCut)
continue; // pt requirement

efficiencyNum_[kSAMuon][eta][q][var]->Fill(varToFill);
}
}
Expand All @@ -311,17 +309,15 @@ void L1TPhase2MuonOffline::fillEfficiencyHistos() {
for (const auto var : effTypes_) {
auto varToFill = muIt.getVar(var);
for (const auto& cut : cuts_) {
const auto gmtPtCut = cut.first;
const auto q = cut.second;

efficiencyDen_[kTkMuon][eta][q][var]->Fill(varToFill);
if (muIt.gmtPt() < 0)
continue; // gmt muon does not exits
continue; // there is not an assciated gmt muon
if (muIt.gmtQual() < q * 4)
continue; //quality requirements
const auto gmtPtCut = cut.first;
if (var != kEffPt && muIt.gmtPt() < gmtPtCut)
continue; // pt requirement

efficiencyNum_[kTkMuon][eta][q][var]->Fill(varToFill);
}
}
Expand Down Expand Up @@ -373,33 +369,27 @@ void L1TPhase2MuonOffline::matchMuonsToGen(std::vector<const reco::GenParticle*>
edm::LogInfo("L1TPhase2MuonOffline") << "Looping on genmus: " << gen << endl;
GenMuonGMTPair pairBestCand(&(*gen), nullptr);
float dr2Best = maxGmtMuonDR_ * maxGmtMuonDR_;
bool matchFound = false;
for (auto& muIt : *gmtSAMuon_) {
GenMuonGMTPair pairTmpCand(&(*gen), &(muIt));
float dr2Tmp = pairTmpCand.dR2();
if (dr2Tmp < dr2Best) {
dr2Best = dr2Tmp;
pairBestCand = pairTmpCand;
matchFound = true;
}
}
if (matchFound)
gmtSAMuonPairs_.emplace_back(pairBestCand);
gmtSAMuonPairs_.emplace_back(pairBestCand);

GenMuonGMTPair pairBestCand2(&(*gen), nullptr);
dr2Best = maxGmtMuonDR_ * maxGmtMuonDR_;
matchFound = false;
for (auto& tkmuIt : *gmtTkMuon_) {
GenMuonGMTPair pairTmpCand(&(*gen), &(tkmuIt));
float dr2Tmp = pairTmpCand.dR2();
if (dr2Tmp < dr2Best) {
dr2Best = dr2Tmp;
pairBestCand2 = pairTmpCand;
matchFound = true;
}
}
if (matchFound)
gmtTkMuonPairs_.emplace_back(pairBestCand2);
gmtTkMuonPairs_.emplace_back(pairBestCand2);
}
edm::LogInfo("L1TPhase2MuonOffline") << "L1TPhase2MuonOffline::matchMuonsToGen() gmtSAMuons: "
<< gmtSAMuonPairs_.size() << endl;
Expand Down