Skip to content

Commit 4431a7c

Browse files
author
Sven Dildick
committed
Minor updates
1 parent 1c3fca4 commit 4431a7c

File tree

7 files changed

+58
-25
lines changed

7 files changed

+58
-25
lines changed

DQM/L1TMonitor/interface/L1TdeCSCTPG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class L1TdeCSCTPG : public DQMEDAnalyzer {
5353
the Building 904 CSC test-stand. This test-stand is a single
5454
ME1/1 chamber.
5555
*/
56-
bool b904Setup_;
56+
bool B904Setup_;
5757

5858
bool isRun3_;
5959

DQM/L1TMonitor/src/L1TdeCSCTPG.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ L1TdeCSCTPG::L1TdeCSCTPG(const edm::ParameterSet& ps)
2929
alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
3030
clctMaxBin_(ps.getParameter<std::vector<double>>("clctMaxBin")),
3131
lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
32-
b904Setup_(ps.getParameter<bool>("B904Setup")),
32+
B904Setup_(ps.getParameter<bool>("B904Setup")),
3333
isRun3_(ps.getParameter<bool>("isRun3")) {}
3434

3535
L1TdeCSCTPG::~L1TdeCSCTPG() {}
@@ -43,8 +43,8 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co
4343
lctVars_.resize(5);
4444
}
4545

46-
// remove the non-ME1/1 chambers from the list when b904Setup is set to true
47-
if (b904Setup_) {
46+
// remove the non-ME1/1 chambers from the list when B904Setup is set to true
47+
if (B904Setup_) {
4848
chambers_.resize(1);
4949
}
5050
// do not analyze the 1/4-strip bit, 1/8-strip bit
@@ -110,7 +110,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
110110
auto range = dataALCTs->get((*it).first);
111111
const int type = ((*it).first).iChamberType() - 2;
112112
// ignore non-ME1/1 chambers when using B904 test-stand data
113-
if (b904Setup_ and !((*it).first).isME11())
113+
if (B904Setup_ and !((*it).first).isME11())
114114
continue;
115115
for (auto alct = range.first; alct != range.second; alct++) {
116116
if (alct->isValid()) {
@@ -125,7 +125,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
125125
auto range = emulALCTs->get((*it).first);
126126
const int type = ((*it).first).iChamberType() - 2;
127127
// ignore non-ME1/1 chambers when using B904 test-stand data
128-
if (b904Setup_ and !((*it).first).isME11())
128+
if (B904Setup_ and !((*it).first).isME11())
129129
continue;
130130
for (auto alct = range.first; alct != range.second; alct++) {
131131
if (alct->isValid()) {
@@ -140,7 +140,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
140140
auto range = dataCLCTs->get((*it).first);
141141
const int type = ((*it).first).iChamberType() - 2;
142142
// ignore non-ME1/1 chambers when using B904 test-stand data
143-
if (b904Setup_ and !((*it).first).isME11())
143+
if (B904Setup_ and !((*it).first).isME11())
144144
continue;
145145
for (auto clct = range.first; clct != range.second; clct++) {
146146
if (clct->isValid()) {
@@ -154,7 +154,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
154154
chamberHistos[type]["clct_eighthstrip_data"]->Fill(clct->getKeyStrip(8));
155155
chamberHistos[type]["clct_slope_data"]->Fill(clct->getSlope());
156156
chamberHistos[type]["clct_compcode_data"]->Fill(clct->getCompCode());
157-
if (b904Setup_) {
157+
if (B904Setup_) {
158158
chamberHistos[type]["clct_quartstripbit_data"]->Fill(clct->getQuartStripBit());
159159
chamberHistos[type]["clct_eighthstripbit_data"]->Fill(clct->getEighthStripBit());
160160
}
@@ -167,7 +167,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
167167
auto range = emulCLCTs->get((*it).first);
168168
const int type = ((*it).first).iChamberType() - 2;
169169
// ignore non-ME1/1 chambers when using B904 test-stand data
170-
if (b904Setup_ and !((*it).first).isME11())
170+
if (B904Setup_ and !((*it).first).isME11())
171171
continue;
172172
for (auto clct = range.first; clct != range.second; clct++) {
173173
if (clct->isValid()) {
@@ -181,7 +181,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
181181
chamberHistos[type]["clct_eighthstrip_emul"]->Fill(clct->getKeyStrip(8));
182182
chamberHistos[type]["clct_slope_emul"]->Fill(clct->getSlope());
183183
chamberHistos[type]["clct_compcode_emul"]->Fill(clct->getCompCode());
184-
if (b904Setup_) {
184+
if (B904Setup_) {
185185
chamberHistos[type]["clct_quartstripbit_emul"]->Fill(clct->getQuartStripBit());
186186
chamberHistos[type]["clct_eighthstripbit_emul"]->Fill(clct->getEighthStripBit());
187187
}
@@ -194,11 +194,11 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
194194
auto range = dataLCTs->get((*it).first);
195195
const int type = ((*it).first).iChamberType() - 2;
196196
// ignore non-ME1/1 chambers when using B904 test-stand data
197-
if (b904Setup_ and !((*it).first).isME11())
197+
if (B904Setup_ and !((*it).first).isME11())
198198
continue;
199199
for (auto lct = range.first; lct != range.second; lct++) {
200200
if (lct->isValid()) {
201-
chamberHistos[type]["lct_pattern_data"]->Fill(lct->getCLCTPattern());
201+
chamberHistos[type]["lct_pattern_data"]->Fill(lct->getPattern());
202202
chamberHistos[type]["lct_quality_data"]->Fill(lct->getQuality());
203203
chamberHistos[type]["lct_wiregroup_data"]->Fill(lct->getKeyWG());
204204
chamberHistos[type]["lct_halfstrip_data"]->Fill(lct->getStrip());
@@ -208,7 +208,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
208208
chamberHistos[type]["lct_slope_data"]->Fill(lct->getSlope());
209209
chamberHistos[type]["lct_quartstrip_data"]->Fill(lct->getStrip(4));
210210
chamberHistos[type]["lct_eighthstrip_data"]->Fill(lct->getStrip(8));
211-
if (b904Setup_) {
211+
if (B904Setup_) {
212212
chamberHistos[type]["lct_quartstripbit_data"]->Fill(lct->getQuartStripBit());
213213
chamberHistos[type]["lct_eighthstripbit_data"]->Fill(lct->getEighthStripBit());
214214
}
@@ -221,11 +221,11 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
221221
auto range = emulLCTs->get((*it).first);
222222
const int type = ((*it).first).iChamberType() - 2;
223223
// ignore non-ME1/1 chambers when using B904 test-stand data
224-
if (b904Setup_ and !((*it).first).isME11())
224+
if (B904Setup_ and !((*it).first).isME11())
225225
continue;
226226
for (auto lct = range.first; lct != range.second; lct++) {
227227
if (lct->isValid()) {
228-
chamberHistos[type]["lct_pattern_emul"]->Fill(lct->getCLCTPattern());
228+
chamberHistos[type]["lct_pattern_emul"]->Fill(lct->getPattern());
229229
chamberHistos[type]["lct_quality_emul"]->Fill(lct->getQuality());
230230
chamberHistos[type]["lct_wiregroup_emul"]->Fill(lct->getKeyWG());
231231
chamberHistos[type]["lct_halfstrip_emul"]->Fill(lct->getStrip());
@@ -235,7 +235,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
235235
chamberHistos[type]["lct_slope_emul"]->Fill(lct->getSlope());
236236
chamberHistos[type]["lct_quartstrip_emul"]->Fill(lct->getStrip(4));
237237
chamberHistos[type]["lct_eighthstrip_emul"]->Fill(lct->getStrip(8));
238-
if (b904Setup_) {
238+
if (B904Setup_) {
239239
chamberHistos[type]["lct_quartstripbit_emul"]->Fill(lct->getQuartStripBit());
240240
chamberHistos[type]["lct_eighthstripbit_emul"]->Fill(lct->getEighthStripBit());
241241
}

DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class L1TdeCSCTPGClient : public DQMEDHarvester {
5353
the Building 904 CSC test-stand. This test-stand is a single
5454
ME1/1 chamber.
5555
*/
56-
bool b904Setup_;
56+
bool B904Setup_;
5757

5858
bool isRun3_;
5959

DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ L1TdeCSCTPGClient::L1TdeCSCTPGClient(const edm::ParameterSet &ps)
2727
alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
2828
clctMaxBin_(ps.getParameter<std::vector<double>>("clctMaxBin")),
2929
lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
30-
b904Setup_(ps.getParameter<bool>("B904Setup")),
30+
B904Setup_(ps.getParameter<bool>("B904Setup")),
3131
isRun3_(ps.getParameter<bool>("isRun3")) {}
3232

3333
L1TdeCSCTPGClient::~L1TdeCSCTPGClient() {}
@@ -55,8 +55,8 @@ void L1TdeCSCTPGClient::book(DQMStore::IBooker &iBooker) {
5555
lctVars_.resize(5);
5656
}
5757

58-
// remove the non-ME1/1 chambers from the list when b904Setup is set to true
59-
if (b904Setup_) {
58+
// remove the non-ME1/1 chambers from the list when B904Setup is set to true
59+
if (B904Setup_) {
6060
chambers_.resize(1);
6161
}
6262
// do not analyze the 1/4-strip bit, 1/8-strip bit

L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,8 @@ void CSCCathodeLCTProcessor::runCCLUT(CSCCLCTDigi& digi) const {
14361436
}
14371437

14381438
unsigned CSCCathodeLCTProcessor::convertSlopeToRun2Pattern(const unsigned slope) const {
1439-
const unsigned slopeList[32] = {10, 10, 10, 8, 8, 8, 6, 6, 6, 6, 4, 4, 2, 2, 2, 2,
1440-
10, 10, 10, 9, 9, 9, 7, 7, 7, 7, 5, 5, 3, 3, 3, 3};
1439+
const unsigned slopeList[32] = {10, 10, 10, 8, 8, 8, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2,
1440+
10, 10, 10, 9, 9, 9, 7, 7, 7, 5, 5, 5, 3, 3, 3, 3};
14411441
return slopeList[slope];
14421442
}
14431443

L1Trigger/CSCTriggerPrimitives/test/CSCTriggerPrimitivesAnalyzer.cc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ class CSCTriggerPrimitivesAnalyzer : public edm::one::EDAnalyzer<> {
7373

7474
// plots of resolution in MC
7575
bool mcResolutionPlots_;
76+
77+
/*
78+
When set to True, we assume that the data comes from
79+
the Building 904 CSC test-stand. This test-stand is a single
80+
ME1/1 chamber.
81+
*/
82+
bool B904Setup_;
83+
// label only relevant for B904 local runs
84+
std::string B904RunNumber_;
7685
};
7786

7887
CSCTriggerPrimitivesAnalyzer::CSCTriggerPrimitivesAnalyzer(const edm::ParameterSet &conf)
@@ -85,7 +94,9 @@ CSCTriggerPrimitivesAnalyzer::CSCTriggerPrimitivesAnalyzer(const edm::ParameterS
8594
lctVars_(conf.getParameter<std::vector<std::string>>("lctVars")),
8695
dataVsEmulatorPlots_(conf.getParameter<bool>("dataVsEmulatorPlots")),
8796
mcEfficiencyPlots_(conf.getParameter<bool>("mcEfficiencyPlots")),
88-
mcResolutionPlots_(conf.getParameter<bool>("mcResolutionPlots")) {}
97+
mcResolutionPlots_(conf.getParameter<bool>("mcResolutionPlots")),
98+
B904Setup_(conf.getParameter<bool>("B904Setup")),
99+
B904RunNumber_(conf.getParameter<std::string>("B904RunNumber")) {}
89100

90101
void CSCTriggerPrimitivesAnalyzer::analyze(const edm::Event &ev, const edm::EventSetup &setup) {
91102
// efficiency and resolution analysis is done here
@@ -120,7 +131,11 @@ void CSCTriggerPrimitivesAnalyzer::makeDataVsEmulatorPlots() {
120131
return;
121132
}
122133

123-
TPostScript *ps = new TPostScript("CSC_data_vs_emulation.ps", 111);
134+
TString runTitle = "CMS_Run_" + std::to_string(runNumber_);
135+
if (B904Setup_)
136+
runTitle = "B904_Cosmic_Run_" + TString(B904RunNumber_);
137+
138+
TPostScript *ps = new TPostScript("CSC_dataVsEmul_" + runTitle + ".ps", 111);
124139
TCanvas *c1 = new TCanvas("c1", "", 800, 800);
125140
c1->Clear();
126141
c1->Divide(1, 2);
@@ -208,7 +223,10 @@ void CSCTriggerPrimitivesAnalyzer::makePlot(TH1F *dataMon,
208223
TCanvas *c1) const {
209224
ps->NewPage();
210225

211-
const TString title(chamber + " " + lcts + " " + var + " (Run " + runNumber_ + ")");
226+
TString runTitle = "(CMS Run " + std::to_string(runNumber_) + ")";
227+
if (B904Setup_)
228+
runTitle = "(B904 Cosmic Run " + TString(B904RunNumber_) + ")";
229+
const TString title(chamber + " " + lcts + " " + var + " " + runTitle);
212230
c1->cd(1);
213231
gPad->SetGridx();
214232
gPad->SetGridy();

L1Trigger/CSCTriggerPrimitives/test/runCSCTriggerPrimitiveAnalyzer_cfg.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import FWCore.ParameterSet.Config as cms
23
from FWCore.ParameterSet.VarParsing import VarParsing
34
from Configuration.Eras.Era_Run3_cff import Run3
@@ -7,9 +8,19 @@
78
options.register ("analyzeEffiency", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
89
options.register ("analyzeResolution", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
910
options.register ("dataVsEmulationFile", "empty", VarParsing.multiplicity.singleton, VarParsing.varType.string)
11+
"""
12+
- For CMS runs, use the actual run number. Set B904Setup to False
13+
- For B904 runs, set B904Setup to True and set runNumber >= 341761.
14+
Set B904RunNumber to when the data was taken, e.g. 210519_162820.
15+
"""
1016
options.register ("runNumber", 0, VarParsing.multiplicity.singleton, VarParsing.varType.int)
17+
options.register ("B904Setup", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
18+
options.register ("B904RunNumber", "YYMMDD_HHMMSS", VarParsing.multiplicity.singleton, VarParsing.varType.string)
1119
options.parseArguments()
1220

21+
if options.B904Setup and options.B904RunNumber == "YYMMDD_HHMMSS":
22+
sys.exit("B904 setup was selected. Please provide a valid Run Number")
23+
1324
process = cms.Process("ANALYSIS", Run3)
1425
process.load("FWCore.MessageService.MessageLogger_cfi")
1526

@@ -45,6 +56,10 @@
4556
dataVsEmulatorPlots = cms.bool(options.dataVsEmulation),
4657
mcEfficiencyPlots = cms.bool(options.analyzeEffiency),
4758
mcResolutionPlots = cms.bool(options.analyzeResolution),
59+
B904RunNumber = cms.string(options.B904RunNumber)
4860
)
4961

62+
# this needs to be set here, otherwise we duplicate the B904Setup parameter
63+
process.cscTriggerPrimitivesAnalyzer.B904Setup = options.B904Setup
64+
5065
process.p = cms.Path(process.cscTriggerPrimitivesAnalyzer)

0 commit comments

Comments
 (0)