diff --git a/DQMOffline/Trigger/src/HLTMuonMatchAndPlot.cc b/DQMOffline/Trigger/src/HLTMuonMatchAndPlot.cc index 68cd94612d19d..846487de6da37 100644 --- a/DQMOffline/Trigger/src/HLTMuonMatchAndPlot.cc +++ b/DQMOffline/Trigger/src/HLTMuonMatchAndPlot.cc @@ -43,18 +43,24 @@ HLTMuonMatchAndPlot::HLTMuonMatchAndPlot(const ParameterSet& pset, string hltPat hltPath_(std::move(hltPath)), moduleLabel_(std::move(moduleLabel)), isLastFilter_(islastfilter), - hasTargetRecoCuts(targetParams_.exists("recoCuts")), - hasProbeRecoCuts(probeParams_.exists("recoCuts")), - targetMuonSelector_(targetParams_.getUntrackedParameter("recoCuts", "")), + //hasTargetRecoCuts(targetParams_.exists("recoCuts")), + //hasProbeRecoCuts(probeParams_.exists("recoCuts")), + targetMuonEta_(targetParams_.getUntrackedParameter("recoEtaCut", 0.)), + targetIsMuonGlb_(targetParams_.getUntrackedParameter("recoGlbMuCut", false)), + //targetMuonSelector_(targetParams_.getUntrackedParameter("recoCuts", "")), targetZ0Cut_(targetParams_.getUntrackedParameter("z0Cut", 0.)), targetD0Cut_(targetParams_.getUntrackedParameter("d0Cut", 0.)), targetptCutZ_(targetParams_.getUntrackedParameter("ptCut_Z", 20.)), targetptCutJpsi_(targetParams_.getUntrackedParameter("ptCut_Jpsi", 20.)), - probeMuonSelector_(probeParams_.getUntrackedParameter("recoCuts", "")), + probeMuonEta_(probeParams_.getUntrackedParameter("recoEtaCut", 0.)), + probeIsMuonGlb_(probeParams_.getUntrackedParameter("recoGlbMuCut", false)), + //probeMuonSelector_(probeParams_.getUntrackedParameter("recoCuts", "")), probeZ0Cut_(probeParams_.getUntrackedParameter("z0Cut", 0.)), probeD0Cut_(probeParams_.getUntrackedParameter("d0Cut", 0.)), - triggerSelector_(targetParams_.getUntrackedParameter("hltCuts", "")), - hasTriggerCuts_(targetParams_.exists("hltCuts")) { + //triggerSelector_(targetParams_.getUntrackedParameter("hltCuts", "")), + triggerEtaCut_(targetParams_.getUntrackedParameter("hltEtaCut", 0.)) + //hasTriggerCuts_(targetParams_.exists("hltCuts")) + { // Create std::map from ParameterSets. fillMapFromPSet(binParams_, pset, "binParams"); fillMapFromPSet(plotCuts_, pset, "plotCuts"); @@ -174,12 +180,15 @@ void HLTMuonMatchAndPlot::analyze(Handle& allMuons, // Select objects based on the configuration. MuonCollection targetMuons = - selectedMuons(*allMuons, *beamSpot, hasTargetRecoCuts, targetMuonSelector_, targetD0Cut_, targetZ0Cut_); + //selectedMuons(*allMuons, *beamSpot, hasTargetRecoCuts, targetMuonSelector_, targetD0Cut_, targetZ0Cut_); + selectedMuons(*allMuons, *beamSpot, targetMuonEta_, targetIsMuonGlb_, targetD0Cut_, targetZ0Cut_); MuonCollection probeMuons = - selectedMuons(*allMuons, *beamSpot, hasProbeRecoCuts, probeMuonSelector_, probeD0Cut_, probeZ0Cut_); + //selectedMuons(*allMuons, *beamSpot, hasProbeRecoCuts, probeMuonSelector_, probeD0Cut_, probeZ0Cut_); + selectedMuons(*allMuons, *beamSpot, probeMuonEta_, probeIsMuonGlb_, probeD0Cut_, probeZ0Cut_); TriggerObjectCollection allTriggerObjects = triggerSummary->getObjects(); TriggerObjectCollection hltMuons = - selectedTriggerObjects(allTriggerObjects, *triggerSummary, hasTriggerCuts_, triggerSelector_); + //selectedTriggerObjects(allTriggerObjects, *triggerSummary, hasTriggerCuts_, triggerSelector_); + selectedTriggerObjects(allTriggerObjects, *triggerSummary, triggerEtaCut_); // Fill plots for HLT muons. // Find the best trigger object matches for the targetMuons. @@ -374,13 +383,15 @@ vector HLTMuonMatchAndPlot::matchByDeltaR(const vector& collection1, MuonCollection HLTMuonMatchAndPlot::selectedMuons(const MuonCollection& allMuons, const BeamSpot& beamSpot, - bool hasRecoCuts, - const StringCutObjectSelector& selector, + double RecoMuonEta, + bool IsMuonGlb, + //bool hasRecoCuts, + //const StringCutObjectSelector& selector, double d0Cut, double z0Cut) { // If there is no selector (recoCuts does not exists), return an empty collection. - if (!hasRecoCuts) - return MuonCollection(); + //if (!hasRecoCuts) + // return MuonCollection(); MuonCollection reducedMuons; for (auto const& mu : allMuons) { @@ -389,7 +400,9 @@ MuonCollection HLTMuonMatchAndPlot::selectedMuons(const MuonCollection& allMuons track = &*mu.innerTrack(); else if (mu.isStandAloneMuon()) track = &*mu.outerTrack(); - if (track && selector(mu) && fabs(track->dxy(beamSpot.position())) < d0Cut && + //if (track && selector(mu) && fabs(track->dxy(beamSpot.position())) < d0Cut && + IsMuonGlb = (&mu)->isGlobalMuon(); + if (track && IsMuonGlb && abs((&mu)->eta()) < RecoMuonEta && fabs(track->dxy(beamSpot.position())) < d0Cut && fabs(track->dz(beamSpot.position())) < z0Cut) reducedMuons.push_back(mu); } @@ -400,10 +413,11 @@ MuonCollection HLTMuonMatchAndPlot::selectedMuons(const MuonCollection& allMuons TriggerObjectCollection HLTMuonMatchAndPlot::selectedTriggerObjects( const TriggerObjectCollection& triggerObjects, const TriggerEvent& triggerSummary, - bool hasTriggerCuts, - const StringCutObjectSelector& triggerSelector) { - if (!hasTriggerCuts) - return TriggerObjectCollection(); + //bool hasTriggerCuts, + //const StringCutObjectSelector& triggerSelector) { + double triggerEtaCut_) { + //if (!hasTriggerCuts) + //return TriggerObjectCollection(); InputTag filterTag(moduleLabel_, "", hltProcessName_); size_t filterIndex = triggerSummary.filterIndex(filterTag); @@ -414,7 +428,8 @@ TriggerObjectCollection HLTMuonMatchAndPlot::selectedTriggerObjects( const Keys& keys = triggerSummary.filterKeys(filterIndex); for (unsigned short key : keys) { TriggerObject foundObject = triggerObjects[key]; - if (triggerSelector(foundObject)) + //if (triggerSelector(foundObject)) + if(abs((&foundObject)->eta()) < triggerEtaCut_) selectedObjects.push_back(foundObject); } }