Skip to content

Commit

Permalink
Add flags to enable/disable monitoring for GEM stations. This fix is …
Browse files Browse the repository at this point in the history
…related to cms-sw#36860
  • Loading branch information
seungjin-yang committed Feb 3, 2022
1 parent 9c3a5ca commit ff05356
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 144 deletions.
52 changes: 24 additions & 28 deletions DQM/GEM/plugins/GEMEfficiencyAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ GEMEfficiencyAnalyzer::GEMEfficiencyAnalyzer(const edm::ParameterSet& pset)
eta_nbins_ = pset.getUntrackedParameter<int>("etaNbins");
eta_low_ = pset.getUntrackedParameter<double>("etaLow");
eta_up_ = pset.getUntrackedParameter<double>("etaUp");
monitor_ge11_ = pset.getUntrackedParameter<bool>("monitorGE11");
monitor_ge21_ = pset.getUntrackedParameter<bool>("monitorGE21");
monitor_ge0_ = pset.getUntrackedParameter<bool>("monitorGE0");

const edm::ParameterSet&& muon_service_parameter = pset.getParameter<edm::ParameterSet>("ServiceParameters");
muon_service_ = new MuonServiceProxy(muon_service_parameter, consumesCollector());
Expand Down Expand Up @@ -70,41 +73,16 @@ void GEMEfficiencyAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& des
desc.addUntracked<int>("etaNbins", 9);
desc.addUntracked<double>("etaLow", 1.4);
desc.addUntracked<double>("etaUp", 2.3);
desc.addUntracked<bool>("monitorGE11", true);
desc.addUntracked<bool>("monitorGE21", false);
desc.addUntracked<bool>("monitorGE0", false);
{
edm::ParameterSetDescription psd0;
psd0.setAllowAnything();
desc.add<edm::ParameterSetDescription>("ServiceParameters", psd0);
}
descriptions.add("gemEfficiencyAnalyzerDefault", desc);
} // beam scenario

// cosmic scenario
{
edm::ParameterSetDescription desc;
desc.addUntracked<std::string>("name", "GlobalMuon"); // FIXME
desc.addUntracked<std::string>("folder", "GEM/Efficiency/type0");
desc.add<edm::InputTag>("recHitTag", edm::InputTag("gemRecHits"));
desc.add<edm::InputTag>("muonTag", edm::InputTag("muons"));
desc.addUntracked<bool>("isCosmics", true);
desc.addUntracked<bool>("useGlobalMuon", false);
desc.add<bool>("useSkipLayer", true);
desc.add<bool>("useOnlyME11", true);
desc.add<double>("residualRPhiCut", 5.0); // TODO need to be tuned
desc.add<bool>("usePropRErrorCut", true);
desc.add<double>("propRErrorCut", 1.0);
desc.add<bool>("usePropPhiErrorCut", true);
desc.add<double>("propPhiErrorCut", 0.001);
desc.addUntracked<std::vector<double> >("ptBins", {0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 120.});
desc.addUntracked<int>("etaNbins", 9);
desc.addUntracked<double>("etaLow", 1.4);
desc.addUntracked<double>("etaUp", 2.3);
{
edm::ParameterSetDescription psd0;
psd0.setAllowAnything();
desc.add<edm::ParameterSetDescription>("ServiceParameters", psd0);
}
descriptions.add("gemEfficiencyAnalyzerCosmicsDefault", desc);
} // cosmics
}

void GEMEfficiencyAnalyzer::bookHistograms(DQMStore::IBooker& ibooker,
Expand Down Expand Up @@ -546,6 +524,24 @@ std::vector<GEMEfficiencyAnalyzer::GEMLayerData> GEMEfficiencyAnalyzer::buildGEM
const int station_id = station->station();
const bool is_ge11 = station_id == 1;

if ((station_id == 1) and (not monitor_ge11_)) {
LogDebug(kLogCategory_) << "skip GE11 because monitorGE11 is " << std::boolalpha << monitor_ge11_;
continue;

} else if ((station_id == 2) and (not monitor_ge21_)) {
LogDebug(kLogCategory_) << "skip GE21 because monitorGE21 is " << std::boolalpha << monitor_ge21_;
continue;

} else if ((station_id == 0) and (not monitor_ge0_)) {
LogDebug(kLogCategory_) << "skip GE0 because monitorGE0 is " << std::boolalpha << monitor_ge0_;
continue;

} else {
edm::LogError(kLogCategory_) << "got an unexpected GEM station: region=" << region_id << ", station=" << station_id << ". skip this station.";
continue;

}

// (layer_id, is_odd) - chambers
std::map<std::pair<int, bool>, std::vector<const GEMChamber*> > chambers_per_layer;

Expand Down
3 changes: 3 additions & 0 deletions DQM/GEM/plugins/GEMEfficiencyAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class GEMEfficiencyAnalyzer : public GEMOfflineDQMBase {
int eta_nbins_;
double eta_low_;
double eta_up_;
bool monitor_ge11_;
bool monitor_ge21_;
bool monitor_ge0_;

// data mebers derived from parameters
MuonServiceProxy *muon_service_;
Expand Down
2 changes: 1 addition & 1 deletion DQM/GEM/plugins/GEMEfficiencyHarvester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GEMEfficiencyHarvester::~GEMEfficiencyHarvester() {}
void GEMEfficiencyHarvester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<std::string>("folder", "GEM/Efficiency/type0");
descriptions.add("gemEfficiencyHarvesterDefault", desc);
descriptions.add("gemEfficiencyHarvester", desc);
}

TProfile* GEMEfficiencyHarvester::computeEfficiency(
Expand Down
18 changes: 18 additions & 0 deletions DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import FWCore.ParameterSet.Config as cms
from DQM.GEM.gemEfficiencyAnalyzer_cfi import *

gemEfficiencyAnalyzerCosmics = gemEfficiencyAnalyzer.clone(
isCosmics = True,
)

gemEfficiencyAnalyzerCosmicsTwoLeg = gemEfficiencyAnalyzerCosmics.clone(
muonTag = 'muons',
name = 'Cosmic 2-Leg STA Muon',
folder = 'GEM/Efficiency/type1'
)

gemEfficiencyAnalyzerCosmicsOneLeg = gemEfficiencyAnalyzerCosmics.clone(
muonTag = 'muons1Leg',
name = 'Cosmic 1-Leg STA Muon',
folder = 'GEM/Efficiency/type2'
)
28 changes: 0 additions & 28 deletions DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cfi.py

This file was deleted.

45 changes: 45 additions & 0 deletions DQM/GEM/python/gemEfficiencyAnalyzer_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import FWCore.ParameterSet.Config as cms
from DQM.GEM.gemEfficiencyAnalyzer_cfi import *

gemOfflineDQMTightGlbMuons = cms.EDFilter("MuonSelector",
src = cms.InputTag('muons'),
cut = cms.string(
'(pt > 20)'
'&& isGlobalMuon'
'&& globalTrack.isNonnull'
'&& passed(\'CutBasedIdTight\')'
),
filter = cms.bool(False)
)

gemOfflineDQMStaMuons = cms.EDFilter("MuonSelector",
src = cms.InputTag('muons'),
cut = cms.string(
'(pt > 20)'
'&& isStandAloneMuon'
'&& outerTrack.isNonnull'
),
filter = cms.bool(False)
)

gemEfficiencyAnalyzerTightGlb = gemEfficiencyAnalyzer.clone(
folder = 'GEM/Efficiency/type1',
muonTag = 'gemOfflineDQMTightGlbMuons',
name = 'Tight GLB Muon',
useGlobalMuon = True
)

gemEfficiencyAnalyzerSta = gemEfficiencyAnalyzer.clone(
muonTag = "gemOfflineDQMStaMuons",
folder = 'GEM/Efficiency/type2',
name = 'STA Muon',
useGlobalMuon = False
)

gemEfficiencyAnalyzerTightGlbSeq = cms.Sequence(
cms.ignore(gemOfflineDQMTightGlbMuons) *
gemEfficiencyAnalyzerTightGlb)

gemEfficiencyAnalyzerStaSeq = cms.Sequence(
cms.ignore(gemOfflineDQMStaMuons) *
gemEfficiencyAnalyzerSta)
61 changes: 8 additions & 53 deletions DQM/GEM/python/gemEfficiencyAnalyzer_cfi.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,16 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
from DQM.GEM.gemEfficiencyAnalyzerDefault_cfi import gemEfficiencyAnalyzerDefault as _gemEfficiencyAnalyzerDefault
from RecoMuon.TrackingTools.MuonServiceProxy_cff import *
from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import *

gemOfflineDQMTightGlbMuons = cms.EDFilter("MuonSelector",
src = cms.InputTag('muons'),
cut = cms.string(
'(pt > 20)'
'&& isGlobalMuon'
'&& globalTrack.isNonnull'
'&& passed(\'CutBasedIdTight\')'
),
filter = cms.bool(False)
)

gemOfflineDQMStaMuons = cms.EDFilter("MuonSelector",
src = cms.InputTag('muons'),
cut = cms.string(
'(pt > 20)'
'&& isStandAloneMuon'
'&& outerTrack.isNonnull'
),
filter = cms.bool(False)
)

gemEfficiencyAnalyzerTightGlb = _gemEfficiencyAnalyzerDefault.clone(
gemEfficiencyAnalyzer = _gemEfficiencyAnalyzerDefault.clone(
ServiceParameters = MuonServiceProxy.ServiceParameters.clone(),
folder = 'GEM/Efficiency/type1',
muonTag = 'gemOfflineDQMTightGlbMuons',
name = 'Tight GLB Muon',
useGlobalMuon = True
)

gemEfficiencyAnalyzerSta = _gemEfficiencyAnalyzerDefault.clone(
ServiceParameters = MuonServiceProxy.ServiceParameters.clone(),
muonTag = "gemOfflineDQMStaMuons",
folder = 'GEM/Efficiency/type2',
name = 'STA Muon',
useGlobalMuon = False
)

from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM
phase2_GEM.toModify(
gemEfficiencyAnalyzerTightGlb,
etaNbins=cms.untracked.int32(15),
etaUp=cms.untracked.double(3.0))

phase2_GEM.toModify(
gemEfficiencyAnalyzerSta,
etaNbins=cms.untracked.int32(15),
etaUp=cms.untracked.double(3.0))

gemEfficiencyAnalyzerTightGlbSeq = cms.Sequence(
cms.ignore(gemOfflineDQMTightGlbMuons) *
gemEfficiencyAnalyzerTightGlb)

gemEfficiencyAnalyzerStaSeq = cms.Sequence(
cms.ignore(gemOfflineDQMStaMuons) *
gemEfficiencyAnalyzerSta)
phase2_GEM.toModify(gemEfficiencyAnalyzer,
monitorGE21 = True,
monitorGE0 = True,
etaNbins = 15,
etaUp = 3.0,
)
13 changes: 13 additions & 0 deletions DQM/GEM/python/gemEfficiencyHarvesterCosmics_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import FWCore.ParameterSet.Config as cms

from DQM.GEM.gemEfficiencyHarvester_cfi import gemEfficiencyHarvester
from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import gemEfficiencyAnalyzerCosmicsTwoLeg as _gemEfficiencyAnalyzerCosmicsTwoLeg
from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import gemEfficiencyAnalyzerCosmicsOneLeg as _gemEfficiencyAnalyzerCosmicsOneLeg

gemEfficiencyHarvesterCosmicsTwoLeg = gemEfficiencyHarvester.clone(
folder = _gemEfficiencyAnalyzerCosmicsTwoLeg.folder.value()
)

gemEfficiencyHarvesterCosmicsOneLeg = gemEfficiencyHarvester.clone(
folder = _gemEfficiencyAnalyzerCosmicsOneLeg.folder.value()
)
14 changes: 0 additions & 14 deletions DQM/GEM/python/gemEfficiencyHarvesterCosmics_cfi.py

This file was deleted.

13 changes: 13 additions & 0 deletions DQM/GEM/python/gemEfficiencyHarvester_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import FWCore.ParameterSet.Config as cms

from DQM.GEM.gemEfficiencyHarvester_cfi import gemEfficiencyHarvester
from DQM.GEM.gemEfficiencyAnalyzer_cff import gemEfficiencyAnalyzerTightGlb as _gemEfficiencyAnalyzerTightGlb
from DQM.GEM.gemEfficiencyAnalyzer_cff import gemEfficiencyAnalyzerSta as _gemEfficiencyAnalyzerSta

gemEfficiencyHarvesterTightGlb = gemEfficiencyHarvester.clone(
folder = _gemEfficiencyAnalyzerTightGlb.folder.value()
)

gemEfficiencyHarvesterSta = gemEfficiencyHarvester.clone(
folder = _gemEfficiencyAnalyzerSta.folder.value()
)
14 changes: 0 additions & 14 deletions DQM/GEM/python/gemEfficiencyHarvester_cfi.py

This file was deleted.

2 changes: 1 addition & 1 deletion DQM/GEM/python/gem_dqm_offline_client_cff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from DQM.GEM.GEMDQMHarvester_cfi import *
from DQM.GEM.gemEfficiencyHarvester_cfi import *
from DQM.GEM.gemEfficiencyHarvester_cff import *

gemClients = cms.Sequence(
GEMDQMHarvester *
Expand Down
4 changes: 2 additions & 2 deletions DQM/GEM/python/gem_dqm_offline_client_cosmics_cff.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import FWCore.ParameterSet.Config as cms

from DQM.GEM.GEMDQMHarvester_cfi import *
from DQM.GEM.gemEfficiencyHarvesterCosmics_cfi import *
from DQM.GEM.gemEfficiencyHarvesterCosmics_cff import *

gemClientsCosmics = cms.Sequence(
GEMDQMHarvester *
gemEfficiencyHarvesterCosmics *
gemEfficiencyHarvesterCosmicsTwoLeg *
gemEfficiencyHarvesterCosmicsOneLeg
)
2 changes: 1 addition & 1 deletion DQM/GEM/python/gem_dqm_offline_source_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from DQM.GEM.GEMDigiSource_cfi import *
from DQM.GEM.GEMRecHitSource_cfi import *
from DQM.GEM.gemEfficiencyAnalyzer_cfi import *
from DQM.GEM.gemEfficiencyAnalyzer_cff import *

GEMDigiSource.modeRelVal = True
GEMRecHitSource.modeRelVal = True
Expand Down
4 changes: 2 additions & 2 deletions DQM/GEM/python/gem_dqm_offline_source_cosmics_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from DQM.GEM.GEMDigiSource_cfi import *
from DQM.GEM.GEMRecHitSource_cfi import *
from DQM.GEM.gemEfficiencyAnalyzerCosmics_cfi import *
from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import *

GEMDigiSource.modeRelVal = True
GEMRecHitSource.modeRelVal = True

gemSourcesCosmics = cms.Sequence(
GEMDigiSource *
GEMRecHitSource *
gemEfficiencyAnalyzerCosmics *
gemEfficiencyAnalyzerCosmicsTwoLeg *
gemEfficiencyAnalyzerCosmicsOneLeg
)

0 comments on commit ff05356

Please sign in to comment.