Skip to content

Commit 50f39de

Browse files
authored
Merge pull request #45702 from jhgoh/UpdateRPCDigisV
Refine RPCDigis Validation histograms
2 parents 0710a81 + 192acaa commit 50f39de

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

Validation/MuonRPCDigis/interface/RPCDigiValid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class RPCDigiValid : public DQMEDAnalyzer {
4545
MonitorElement *hBxDisc_4Min_;
4646

4747
// Timing information
48+
bool isDigiTimeAvailable_;
4849
MonitorElement *hDigiTimeAll_, *hDigiTime_, *hDigiTimeIRPC_, *hDigiTimeNoIRPC_;
4950

5051
// Multiplicity plots

Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
# Tag for simulated hits event data retrieval
99
simHitTag = cms.untracked.InputTag("g4SimHits", "MuonRPCHits"),
1010

11-
# Name of the root file which will contain the histos
12-
outputFile = cms.untracked.string('')
11+
# Flag to turn on/off timing plots
12+
digiTime = cms.untracked.bool(False)
1313
)
1414

1515
from Configuration.Eras.Modifier_fastSim_cff import fastSim
1616
fastSim.toModify(validationMuonRPCDigis, simHitTag = "MuonSimHits:MuonRPCHits")
17+
18+
from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
19+
phase2_common.toModify(validationMuonRPCDigis, digiTime = True)

Validation/MuonRPCDigis/src/RPCDigiValid.cc

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RPCDigiValid::RPCDigiValid(const ParameterSet &ps) {
2626
rpcDigiToken_ = consumes<RPCDigiCollection>(
2727
ps.getUntrackedParameter<edm::InputTag>("rpcDigiTag", edm::InputTag("simMuonRPCDigis")));
2828

29+
isDigiTimeAvailable_ = ps.getUntrackedParameter<bool>("digiTime", false);
30+
2931
rpcGeomToken_ = esConsumes();
3032
}
3133

@@ -122,14 +124,16 @@ void RPCDigiValid::analyze(const Event &event, const EventSetup &eventSetup) {
122124
}
123125

124126
// Fill timing information
125-
const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx() * 25;
126-
hDigiTimeAll_->Fill(digiTime);
127-
if (digiIt->hasTime()) {
128-
hDigiTime_->Fill(digiTime);
129-
if (roll->isIRPC())
130-
hDigiTimeIRPC_->Fill(digiTime);
131-
else
132-
hDigiTimeNoIRPC_->Fill(digiTime);
127+
if (isDigiTimeAvailable_) {
128+
const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx() * 25;
129+
hDigiTimeAll_->Fill(digiTime);
130+
if (digiIt->hasTime()) {
131+
hDigiTime_->Fill(digiTime);
132+
if (roll->isIRPC())
133+
hDigiTimeIRPC_->Fill(digiTime);
134+
else
135+
hDigiTimeNoIRPC_->Fill(digiTime);
136+
}
133137
}
134138

135139
// Keep digi position
@@ -201,23 +205,28 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run
201205

202206
// RZ plot
203207
hRZ_ = booker.book2D("RZ", "R-Z view;Z (cm);R (cm)", nbinsZ, -maxZ, maxZ, nbinsR, minR, maxR);
208+
hRZ_->setOption("colz");
204209

205210
// XY plots
206211
hXY_Barrel_ = booker.book2D("XY_Barrel", "X-Y view of Barrel", nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY);
212+
hXY_Barrel_->setOption("colz");
207213
for (int disk = 1; disk <= 4; ++disk) {
208214
const std::string meNameP = fmt::format("XY_Endcap_p{:1d}", disk);
209215
const std::string meNameN = fmt::format("XY_Endcap_m{:1d}", disk);
210216
const std::string meTitleP = fmt::format("X-Y view of Endcap{:+1d};X (cm);Y (cm)", disk);
211217
const std::string meTitleN = fmt::format("X-Y view of Endcap{:+1d};X (cm);Y (cm)", -disk);
212218
hXY_Endcap_[disk] = booker.book2D(meNameP, meTitleP, nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY);
213219
hXY_Endcap_[-disk] = booker.book2D(meNameN, meTitleN, nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY);
220+
hXY_Endcap_[disk]->setOption("colz");
221+
hXY_Endcap_[-disk]->setOption("colz");
214222
}
215223

216224
// Z-phi plots
217225
for (int layer = 1; layer <= 6; ++layer) {
218226
const std::string meName = fmt::format("ZPhi_Layer{:1d}", layer);
219227
const std::string meTitle = fmt::format("Z-#phi view of Layer{:1d};Z (cm);#phi (degree)", layer);
220228
hZPhi_[layer] = booker.book2D(meName, meTitle, nbinsBarrelZ, -maxBarrelZ, maxBarrelZ, nbinsPhi, -180, 180);
229+
hZPhi_[layer]->setOption("colz");
221230
}
222231

223232
// Strip profile
@@ -233,11 +242,13 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run
233242
hBxDisc_4Min_ = booker.book1D("BxDisc_4Min", "BxDisc_4Min", 20, -10., 10.);
234243

235244
// Timing informations
236-
hDigiTimeAll_ =
237-
booker.book1D("DigiTimeAll", "Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5);
238-
hDigiTime_ = booker.book1D("DigiTime", "Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5);
239-
hDigiTimeIRPC_ = booker.book1D("DigiTimeIRPC", "IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
240-
hDigiTimeNoIRPC_ = booker.book1D("DigiTimeNoIRPC", "non-IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
245+
if (isDigiTimeAvailable_) {
246+
hDigiTimeAll_ =
247+
booker.book1D("DigiTimeAll", "Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5);
248+
hDigiTime_ = booker.book1D("DigiTime", "Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5);
249+
hDigiTimeIRPC_ = booker.book1D("DigiTimeIRPC", "IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
250+
hDigiTimeNoIRPC_ = booker.book1D("DigiTimeNoIRPC", "non-IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
251+
}
241252

242253
// SimHit and Digi multiplicity per roll
243254
hNSimHitPerRoll_ = booker.book1D("NSimHitPerRoll", "SimHit multiplicity per Roll;Multiplicity", 10, 0, 10);
@@ -267,9 +278,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run
267278
hResEndcapDisks_[-disk] = booker.book1D(meNameN, meTitleN, 100, -8, 8);
268279
}
269280

270-
for (int ring = 1; ring <= 3; ++ring) {
271-
const std::string meName = fmt::format("Residual_Endcap_Ring{:1d}", ring);
272-
const std::string meTitle = fmt::format("Residual of Endcap Ring{:1d};dx (cm)", ring);
273-
hResEndcapRings_[ring] = booker.book1D(meName, meTitle, 100, -8, 8);
274-
}
281+
hResEndcapRings_[1] = booker.book1D("Residual_Endcap_Ring1", "Residual of Endcap Ring1;dx (cm)", 100, -12, 12);
282+
hResEndcapRings_[2] = booker.book1D("Residual_Endcap_Ring2", "Residual of Endcap Ring2;dx (cm)", 100, -8, 8);
283+
hResEndcapRings_[3] = booker.book1D("Residual_Endcap_Ring3", "Residual of Endcap Ring3;dx (cm)", 100, -8, 8);
275284
}

0 commit comments

Comments
 (0)