From 6937f908e47b41b31ca3cf6b1a336fd669b11eb2 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 1 Mar 2024 14:53:08 +0100 Subject: [PATCH] make selection in SagittaBiasNtuplizer configurable --- .../plugins/SagittaBiasNtuplizer.cc | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/Alignment/OfflineValidation/plugins/SagittaBiasNtuplizer.cc b/Alignment/OfflineValidation/plugins/SagittaBiasNtuplizer.cc index 203d7a09b068b..0a5c313de907e 100644 --- a/Alignment/OfflineValidation/plugins/SagittaBiasNtuplizer.cc +++ b/Alignment/OfflineValidation/plugins/SagittaBiasNtuplizer.cc @@ -55,6 +55,15 @@ class SagittaBiasNtuplizer : public edm::one::EDAnalyzer pTthresholds_; // either on or the other! @@ -112,6 +121,13 @@ class SagittaBiasNtuplizer : public edm::one::EDAnalyzer("useReco")), doGen_(iConfig.getParameter("doGen")), + muonEtaCut_(iConfig.getParameter("muonEtaCut")), + muonPtCut_(iConfig.getParameter("muonPtCut")), + muondxySigCut_(iConfig.getParameter("muondxySigCut")), + minMassWindowCut_(iConfig.getParameter("minMassWindowCut")), + maxMassWindowCut_(iConfig.getParameter("maxMassWindowCut")), + d0CompatibilityCut_(iConfig.getParameter("d0CompatibilityCut")), + z0CompatibilityCut_(iConfig.getParameter("z0CompatibilityCut")), pTthresholds_(iConfig.getParameter>("pTThresholds")), vtxToken_(consumes(iConfig.getParameter("vertices"))), bsToken_(consumes(iConfig.getParameter("beamSpot"))), @@ -222,6 +238,13 @@ void SagittaBiasNtuplizer::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add("tracks", edm::InputTag("generalTracks")); desc.add("vertices", edm::InputTag("offlinePrimaryVertices")); desc.add("beamSpot", edm::InputTag("offlineBeamSpot")); + desc.add("muonEtaCut", 2.5)->setComment("muon system acceptance"); + desc.add("muonPtCut", 12.)->setComment("in GeV"); + desc.add("muondxySigCut", 4.)->setComment("significance of the d0 compatibility with closest vertex"); + desc.add("minMassWindowCut", 70.)->setComment("in GeV"); + desc.add("maxMassWindowCut", 110.)->setComment("in GeV"); + desc.add("d0CompatibilityCut", 0.01)->setComment("d0 compatibility between the two muons"); + desc.add("z0CompatibilityCut", 0.06)->setComment("z0 compatibility between the two muons"); desc.add>("pTThresholds", {30., 10.}); descriptions.addWithDefaultLabel(desc); } @@ -327,12 +350,12 @@ void SagittaBiasNtuplizer::analyze(const edm::Event& event, const edm::EventSetu unsigned int i = 0; for (const auto& track : myTracks) { - if (track->pt() < 12) { + if (track->pt() < muonPtCut_) { passPtCut = false; continue; } - if (std::abs(track->eta()) > 2.5) { + if (std::abs(track->eta()) > muonEtaCut_) { passEtaCut = false; continue; } @@ -342,7 +365,7 @@ void SagittaBiasNtuplizer::analyze(const edm::Event& event, const edm::EventSetu d0[i] = track->dxy(closestVertex.second.position()); dz[i] = track->dz(closestVertex.second.position()); - if (d0[i] / track->dxyError() > 4) { + if (d0[i] / track->dxyError() > muondxySigCut_) { passD0sigCut = false; continue; } @@ -393,13 +416,13 @@ void SagittaBiasNtuplizer::analyze(const edm::Event& event, const edm::EventSetu mass_ = mother.M(); // checks if invariant mass of the system lies in the fiducial window - passMassWindow = (mass_ > 70 && mass_ < 110); + passMassWindow = (mass_ > minMassWindowCut_ && mass_ < maxMassWindowCut_); if (!passMassWindow) return; h_cutFlow->Fill(5); // checks if the di-muon system passes the d0 compatibility cut - passDeltaD0 = (std::abs(d0[0] - d0[1]) < 0.01); + passDeltaD0 = (std::abs(d0[0] - d0[1]) < d0CompatibilityCut_); h_DeltaD0->Fill(d0[0] - d0[1]); h_DeltaDz->Fill(dz[0] - dz[1]); if (!passDeltaD0) @@ -407,7 +430,7 @@ void SagittaBiasNtuplizer::analyze(const edm::Event& event, const edm::EventSetu h_cutFlow->Fill(6); // checks if the di-muon system passes the z0 compatibility cut - passDeltaDz = (std::abs(dz[0] - dz[1]) < 0.06); + passDeltaDz = (std::abs(dz[0] - dz[1]) < z0CompatibilityCut_); if (!passDeltaDz) return; h_cutFlow->Fill(7);