Skip to content

Commit

Permalink
Data vs emulation for GEM TPs in DQM
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Dildick committed Oct 14, 2021
1 parent df9a144 commit c4f94ae
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/python/L1TdeGEMTPG_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
l1tdeGEMTPG = DQMEDAnalyzer(
"L1TdeGEMTPG",
l1tdeGEMTPGCommon,
data = cms.InputTag("valMuonGEMPadDigiClusters"),
data = cms.InputTag("emtfStage2Digis"),
emul = cms.InputTag("valMuonGEMPadDigiClusters"),
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"Set to True when you want to run the CSC DQM")
options.register("dqmGEM", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool,
"Set to True when you want to run the GEM DQM")
options.register("useEmtfGEM", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool,
"Set to True when you want to use GEM clusters from the EMTF in the DQM")
options.register("useB904ME11", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool,
"Set to True when using B904 ME1/1 data.")
options.register("useB904ME21", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool,
Expand Down Expand Up @@ -59,6 +61,7 @@
process.load('Configuration.EventContent.EventContent_cff')
process.load("EventFilter.CSCRawToDigi.cscUnpacker_cfi")
process.load('EventFilter.GEMRawToDigi.muonGEMDigis_cfi')
process.load('EventFilter.L1TRawToDigi.emtfStage2Digis_cfi')
process.load("L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi")
process.load("CalibMuon.CSCCalibration.CSCL1TPLookupTableEP_cff")
process.load('L1Trigger.L1TGEM.simGEMDigis_cff')
Expand Down Expand Up @@ -144,7 +147,13 @@
process.l1tdeCSCTPG.preTriggerAnalysis = options.preTriggerAnalysis

if options.dqmGEM:
process.l1tdeGEMTPG.data = "muonCSCDigis"
## GEM pad clusters from the EMTF
if options.useEmtfGEM:
process.l1tdeGEMTPG.data = "emtfStage2Digis"
## GEM pad clusters from the CSC TPG
else:
process.l1tdeGEMTPG.data = "muonCSCDigis"
## GEM pad clusters from the GEM TPG
process.l1tdeGEMTPG.emul = "simMuonGEMPadDigiClusters"

# Output
Expand Down Expand Up @@ -187,7 +196,11 @@
## schedule and path definition
process.unpacksequence = cms.Sequence(process.muonCSCDigis)
if options.unpackGEM:
## unpack GEM strip digis
process.unpacksequence += process.muonGEMDigis
## unpack GEM pad clusters from the EMTF
if options.useEmtfGEM:
process.unpacksequence += process.emtfStage2Digis
process.p1 = cms.Path(process.unpacksequence)

process.l1sequence = cms.Sequence(l1csc)
Expand Down
20 changes: 5 additions & 15 deletions L1Trigger/L1TGEM/test/GEMTriggerPrimitivesAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ class GEMTriggerPrimitivesAnalyzer : public edm::one::EDAnalyzer<edm::one::Share
bool dataVsEmulatorPlots_;
void makeDataVsEmulatorPlots();

// plots of efficiencies in MC
bool mcEfficiencyPlots_;

// plots of resolution in MC
bool mcResolutionPlots_;

/*
When set to True, we assume that the data comes from
the Building 904 GEM test-stand. This test-stand is a single
Expand All @@ -88,16 +82,12 @@ GEMTriggerPrimitivesAnalyzer::GEMTriggerPrimitivesAnalyzer(const edm::ParameterS
chambers_(conf.getParameter<std::vector<std::string>>("chambers")),
clusterVars_(conf.getParameter<std::vector<std::string>>("clusterVars")),
dataVsEmulatorPlots_(conf.getParameter<bool>("dataVsEmulatorPlots")),
mcEfficiencyPlots_(conf.getParameter<bool>("mcEfficiencyPlots")),
mcResolutionPlots_(conf.getParameter<bool>("mcResolutionPlots")),
B904Setup_(conf.getParameter<bool>("B904Setup")),
B904RunNumber_(conf.getParameter<std::string>("B904RunNumber")) {
usesResource("TFileService");
}

void GEMTriggerPrimitivesAnalyzer::analyze(const edm::Event &ev, const edm::EventSetup &setup) {
// efficiency and resolution analysis is done here
}
void GEMTriggerPrimitivesAnalyzer::analyze(const edm::Event &ev, const edm::EventSetup &setup) {}

void GEMTriggerPrimitivesAnalyzer::endJob() {
if (dataVsEmulatorPlots_)
Expand Down Expand Up @@ -199,17 +189,17 @@ void GEMTriggerPrimitivesAnalyzer::makePlot(TH1F *dataMon,
dataMon->SetMarkerStyle(kPlus);
dataMon->SetMarkerSize(3);
// add 50% to make sure the legend does not overlap with the histograms
dataMon->SetMaximum(dataMon->GetBinContent(dataMon->GetMaximumBin()) * 1.5);
dataMon->SetMaximum(dataMon->GetBinContent(dataMon->GetMaximumBin()) * 1.6);
dataMon->Draw("histp");
dataMon->GetXaxis()->SetLabelSize(0.05);
dataMon->GetYaxis()->SetLabelSize(0.05);
dataMon->GetXaxis()->SetTitleSize(0.05);
dataMon->GetYaxis()->SetTitleSize(0.05);
emulMon->SetLineColor(kRed);
emulMon->Draw("histsame");
auto legend = new TLegend(0.7, 0.7, 0.9, 0.9);
legend->AddEntry(dataMon, "Data", "p");
legend->AddEntry(emulMon, "Emulator", "l");
auto legend = new TLegend(0.6, 0.7, 0.9, 0.9);
legend->AddEntry(dataMon, TString("Data (" + std::to_string((int)dataMon->GetEntries()) + ")"), "p");
legend->AddEntry(emulMon, TString("Emulator (" + std::to_string((int)emulMon->GetEntries()) + ")"), "l");
legend->Draw();

c1->cd(2);
Expand Down
10 changes: 0 additions & 10 deletions L1Trigger/L1TGEM/test/runGEMTriggerPrimitiveAnalyzer_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

options = VarParsing('analysis')
options.register ("dataVsEmulation", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("analyzeEffiency", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("analyzeResolution", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
options.register ("dataVsEmulationFile", "empty", VarParsing.multiplicity.singleton, VarParsing.varType.string)
"""
- For CMS runs, use the actual run number. Set B904Setup to False
Expand All @@ -29,12 +27,6 @@
fileNames = cms.untracked.vstring(options.inputFiles)
)

## if dataVsEmulation and analyzeEffiency or analyzeResolution are true,
## pick dataVsEmulation
if options.dataVsEmulation and (options.analyzeEffiency or options.analyzeResolution):
options.analyzeEffiency = False
options.analyzeResolution = False

if options.dataVsEmulation:
options.maxEvents = 1
process.source = cms.Source("EmptySource")
Expand All @@ -54,8 +46,6 @@
## e.g. 334393
runNumber = cms.uint32(options.runNumber),
dataVsEmulatorPlots = cms.bool(options.dataVsEmulation),
mcEfficiencyPlots = cms.bool(options.analyzeEffiency),
mcResolutionPlots = cms.bool(options.analyzeResolution),
B904RunNumber = cms.string(options.B904RunNumber)
)

Expand Down

0 comments on commit c4f94ae

Please sign in to comment.