14 #include "SimMuon/DTDigitizer/test/Histograms.h"
22 verbose_ =
pset.getUntrackedParameter<
bool>(
"verbose",
false);
25 SimHitToken_ = consumes<edm::PSimHitContainer>(
pset.getParameter<
edm::InputTag>(
"SimHitLabel"));
28 DigiToken_ = consumes<DTDigiCollection>(
pset.getParameter<
edm::InputTag>((
"DigiLabel")));
30 hDigis_global = std::make_unique<hDigis>(
"Global");
31 hDigis_W0 = std::make_unique<hDigis>(
"Wheel0");
32 hDigis_W1 = std::make_unique<hDigis>(
"Wheel1");
33 hDigis_W2 = std::make_unique<hDigis>(
"Wheel2");
34 hAllHits = std::make_unique<hHits>(
"AllHits");
39 cout <<
"[MuonDTDigis] Destructor called" << endl;
45 meDigiTimeBox_ =
nullptr;
46 meDigiTimeBox_wheel2m_ =
nullptr;
47 meDigiTimeBox_wheel1m_ =
nullptr;
48 meDigiTimeBox_wheel0_ =
nullptr;
49 meDigiTimeBox_wheel1p_ =
nullptr;
50 meDigiTimeBox_wheel2p_ =
nullptr;
51 meDigiEfficiency_ =
nullptr;
52 meDigiEfficiencyMu_ =
nullptr;
53 meDoubleDigi_ =
nullptr;
54 meSimvsDigi_ =
nullptr;
55 meWire_DoubleDigi_ =
nullptr;
57 meMB1_sim_occup_ =
nullptr;
58 meMB1_digi_occup_ =
nullptr;
59 meMB2_sim_occup_ =
nullptr;
60 meMB2_digi_occup_ =
nullptr;
61 meMB3_sim_occup_ =
nullptr;
62 meMB3_digi_occup_ =
nullptr;
63 meMB4_sim_occup_ =
nullptr;
64 meMB4_digi_occup_ =
nullptr;
66 meDigiHisto_ =
nullptr;
77 sprintf(histo_n,
"DigiTimeBox");
78 sprintf(histo_t,
"Digi Time Box");
79 meDigiTimeBox_ = iBooker.
book1D(histo_n, histo_t, 1536, 0, 1200);
81 sprintf(histo_n,
"DigiTimeBox_wheel2m");
82 sprintf(histo_t,
"Digi Time Box wheel -2");
83 meDigiTimeBox_wheel2m_ = iBooker.
book1D(histo_n, histo_t, 384, 0, 1200);
85 sprintf(histo_n,
"DigiTimeBox_wheel1m");
86 sprintf(histo_t,
"Digi Time Box wheel -1");
87 meDigiTimeBox_wheel1m_ = iBooker.
book1D(histo_n, histo_t, 384, 0, 1200);
89 sprintf(histo_n,
"DigiTimeBox_wheel0");
90 sprintf(histo_t,
"Digi Time Box wheel 0");
91 meDigiTimeBox_wheel0_ = iBooker.
book1D(histo_n, histo_t, 384, 0, 1200);
93 sprintf(histo_n,
"DigiTimeBox_wheel1p");
94 sprintf(histo_t,
"Digi Time Box wheel 1");
95 meDigiTimeBox_wheel1p_ = iBooker.
book1D(histo_n, histo_t, 384, 0, 1200);
97 sprintf(histo_n,
"DigiTimeBox_wheel2p");
98 sprintf(histo_t,
"Digi Time Box wheel 2");
99 meDigiTimeBox_wheel2p_ = iBooker.
book1D(histo_n, histo_t, 384, 0, 1200);
101 sprintf(histo_n,
"DigiEfficiencyMu");
102 sprintf(histo_t,
"Ratio (#Digis Mu)/(#SimHits Mu)");
103 meDigiEfficiencyMu_ = iBooker.
book1D(histo_n, histo_t, 100, 0., 5.);
105 sprintf(histo_n,
"DigiEfficiency");
106 sprintf(histo_t,
"Ratio (#Digis)/(#SimHits)");
107 meDigiEfficiency_ = iBooker.
book1D(histo_n, histo_t, 100, 0., 5.);
109 sprintf(histo_n,
"Number_Digi_per_layer");
110 sprintf(histo_t,
"Number_Digi_per_layer");
111 meDoubleDigi_ = iBooker.
book1D(histo_n, histo_t, 10, 0., 10.);
113 sprintf(histo_n,
"Number_simhit_vs_digi");
114 sprintf(histo_t,
"Number_simhit_vs_digi");
115 meSimvsDigi_ = iBooker.
book2D(histo_n, histo_t, 100, 0., 140., 100, 0., 140.);
117 sprintf(histo_n,
"Wire_Number_with_double_Digi");
118 sprintf(histo_t,
"Wire_Number_with_double_Digi");
119 meWire_DoubleDigi_ = iBooker.
book1D(histo_n, histo_t, 100, 0., 100.);
121 sprintf(histo_n,
"Simhit_occupancy_MB1");
122 sprintf(histo_t,
"Simhit_occupancy_MB1");
123 meMB1_sim_occup_ = iBooker.
book1D(histo_n, histo_t, 55, 0., 55.);
125 sprintf(histo_n,
"Digi_occupancy_MB1");
126 sprintf(histo_t,
"Digi_occupancy_MB1");
127 meMB1_digi_occup_ = iBooker.
book1D(histo_n, histo_t, 55, 0., 55.);
129 sprintf(histo_n,
"Simhit_occupancy_MB2");
130 sprintf(histo_t,
"Simhit_occupancy_MB2");
131 meMB2_sim_occup_ = iBooker.
book1D(histo_n, histo_t, 63, 0., 63.);
133 sprintf(histo_n,
"Digi_occupancy_MB2");
134 sprintf(histo_t,
"Digi_occupancy_MB2");
135 meMB2_digi_occup_ = iBooker.
book1D(histo_n, histo_t, 63, 0., 63.);
137 sprintf(histo_n,
"Simhit_occupancy_MB3");
138 sprintf(histo_t,
"Simhit_occupancy_MB3");
139 meMB3_sim_occup_ = iBooker.
book1D(histo_n, histo_t, 75, 0., 75.);
141 sprintf(histo_n,
"Digi_occupancy_MB3");
142 sprintf(histo_t,
"Digi_occupancy_MB3");
143 meMB3_digi_occup_ = iBooker.
book1D(histo_n, histo_t, 75, 0., 75.);
145 sprintf(histo_n,
"Simhit_occupancy_MB4");
146 sprintf(histo_t,
"Simhit_occupancy_MB4");
147 meMB4_sim_occup_ = iBooker.
book1D(histo_n, histo_t, 99, 0., 99.);
149 sprintf(histo_n,
"Digi_occupancy_MB4");
150 sprintf(histo_t,
"Digi_occupancy_MB4");
151 meMB4_digi_occup_ = iBooker.
book1D(histo_n, histo_t, 99, 0., 99.);
155 for (
int slnum = 1; slnum < 62; ++slnum) {
156 sprintf(stringcham,
"DigiTimeBox_slid_%d", slnum);
157 meDigiHisto_ = iBooker.
book1D(stringcham, stringcham, 100, 0, 1200);
158 meDigiTimeBox_SL_.push_back(meDigiHisto_);
164 cout <<
"--- [MuonDTDigis] Analysing Event: #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event()
173 event.getByToken(DigiToken_, dtDigis);
177 event.getByToken(SimHitToken_,
simHits);
197 wireMap[wireId].push_back(&(*
hit));
201 int partType =
hit->particleType();
202 if (
abs(partType) == 13)
205 if (wireId.station() == 1 &&
abs(partType) == 13)
206 meMB1_sim_occup_->Fill(wireId.wire());
207 if (wireId.station() == 2 &&
abs(partType) == 13)
208 meMB2_sim_occup_->Fill(wireId.wire());
209 if (wireId.station() == 3 &&
abs(partType) == 13)
210 meMB3_sim_occup_->Fill(wireId.wire());
211 if (wireId.station() == 4 &&
abs(partType) == 13)
212 meMB4_sim_occup_->Fill(wireId.wire());
214 float path = (exitP - entryP).
mag();
215 float path_x = fabs((exitP - entryP).x());
217 hAllHits->Fill(entryP.
x(),
233 for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
234 const DTLayerId &
id = (*detUnitIt).first;
248 if (num_digis_layer > 1) {
249 if ((*digiIt).wire() == wire_touched) {
250 meWire_DoubleDigi_->Fill((*digiIt).wire());
255 wire_touched = (*digiIt).wire();
257 meDigiTimeBox_->Fill((*digiIt).time());
258 if (
id.
wheel() == -2)
259 meDigiTimeBox_wheel2m_->Fill((*digiIt).time());
260 if (
id.
wheel() == -1)
261 meDigiTimeBox_wheel1m_->Fill((*digiIt).time());
263 meDigiTimeBox_wheel0_->Fill((*digiIt).time());
265 meDigiTimeBox_wheel1p_->Fill((*digiIt).time());
267 meDigiTimeBox_wheel2p_->Fill((*digiIt).time());
271 cham_num = (
id.wheel() + 2) * 12 + (
id.
station() - 1) * 3 +
id.superlayer();
274 meDigiTimeBox_SL_[cham_num]->Fill((*digiIt).time());
278 DTWireId wireId(
id, (*digiIt).wire());
279 if (wireId.station() == 1)
280 meMB1_digi_occup_->Fill((*digiIt).wire());
281 if (wireId.station() == 2)
282 meMB2_digi_occup_->Fill((*digiIt).wire());
283 if (wireId.station() == 3)
284 meMB3_digi_occup_->Fill((*digiIt).wire());
285 if (wireId.station() == 4)
286 meMB4_digi_occup_->Fill((*digiIt).wire());
291 for (vector<const PSimHit *>::iterator
hit = wireMap[wireId].begin();
hit != wireMap[wireId].end();
hit++)
292 if (
abs((*hit)->particleType()) == 13) {
293 theta = atan((*hit)->momentumAtEntry().x() / (-(*hit)->momentumAtEntry().z())) * 180 /
M_PI;
304 hDigis_global->Fill((*digiIt).time(),
theta,
id.superlayer());
306 WheelHistos(
id.
wheel())->Fill((*digiIt).time(),
theta,
id.superlayer());
311 meDoubleDigi_->Fill((
float)num_digis_layer);
317 if (num_musimhits != 0) {
318 meDigiEfficiencyMu_->Fill((
float)num_mudigis / (
float)num_musimhits);
319 meDigiEfficiency_->Fill((
float)num_digis / (
float)num_musimhits);
322 meSimvsDigi_->Fill((
float)num_musimhits, (
float)num_digis);
329 return hDigis_W0.get();
332 return hDigis_W1.get();
335 return hDigis_W2.get();