14 #include "SimMuon/DTDigitizer/test/Histograms.h"
22 verbose_ =
pset.getUntrackedParameter<
bool>(
"verbose",
false);
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;
77 sprintf(histo_n,
"DigiTimeBox");
78 sprintf(histo_t,
"Digi Time Box");
81 sprintf(histo_n,
"DigiTimeBox_wheel2m");
82 sprintf(histo_t,
"Digi Time Box wheel -2");
85 sprintf(histo_n,
"DigiTimeBox_wheel1m");
86 sprintf(histo_t,
"Digi Time Box wheel -1");
89 sprintf(histo_n,
"DigiTimeBox_wheel0");
90 sprintf(histo_t,
"Digi Time Box wheel 0");
93 sprintf(histo_n,
"DigiTimeBox_wheel1p");
94 sprintf(histo_t,
"Digi Time Box wheel 1");
97 sprintf(histo_n,
"DigiTimeBox_wheel2p");
98 sprintf(histo_t,
"Digi Time Box wheel 2");
101 sprintf(histo_n,
"DigiEfficiencyMu");
102 sprintf(histo_t,
"Ratio (#Digis Mu)/(#SimHits Mu)");
105 sprintf(histo_n,
"DigiEfficiency");
106 sprintf(histo_t,
"Ratio (#Digis)/(#SimHits)");
109 sprintf(histo_n,
"Number_Digi_per_layer");
110 sprintf(histo_t,
"Number_Digi_per_layer");
113 sprintf(histo_n,
"Number_simhit_vs_digi");
114 sprintf(histo_t,
"Number_simhit_vs_digi");
117 sprintf(histo_n,
"Wire_Number_with_double_Digi");
118 sprintf(histo_t,
"Wire_Number_with_double_Digi");
121 sprintf(histo_n,
"Simhit_occupancy_MB1");
122 sprintf(histo_t,
"Simhit_occupancy_MB1");
125 sprintf(histo_n,
"Digi_occupancy_MB1");
126 sprintf(histo_t,
"Digi_occupancy_MB1");
129 sprintf(histo_n,
"Simhit_occupancy_MB2");
130 sprintf(histo_t,
"Simhit_occupancy_MB2");
133 sprintf(histo_n,
"Digi_occupancy_MB2");
134 sprintf(histo_t,
"Digi_occupancy_MB2");
137 sprintf(histo_n,
"Simhit_occupancy_MB3");
138 sprintf(histo_t,
"Simhit_occupancy_MB3");
141 sprintf(histo_n,
"Digi_occupancy_MB3");
142 sprintf(histo_t,
"Digi_occupancy_MB3");
145 sprintf(histo_n,
"Simhit_occupancy_MB4");
146 sprintf(histo_t,
"Simhit_occupancy_MB4");
149 sprintf(histo_n,
"Digi_occupancy_MB4");
150 sprintf(histo_t,
"Digi_occupancy_MB4");
155 for (
int slnum = 1; slnum < 62; ++slnum) {
156 sprintf(stringcham,
"DigiTimeBox_slid_%d", slnum);
164 cout <<
"--- [MuonDTDigis] Analysing Event: #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event()
196 wireMap[wireId].push_back(&(*
hit));
200 int partType =
hit->particleType();
201 if (
abs(partType) == 13)
204 if (wireId.station() == 1 &&
abs(partType) == 13)
206 if (wireId.station() == 2 &&
abs(partType) == 13)
208 if (wireId.station() == 3 &&
abs(partType) == 13)
210 if (wireId.station() == 4 &&
abs(partType) == 13)
213 float path = (exitP - entryP).
mag();
214 float path_x = fabs((exitP - entryP).
x());
232 for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
233 const DTLayerId &
id = (*detUnitIt).first;
247 if (num_digis_layer > 1) {
248 if ((*digiIt).wire() == wire_touched) {
254 wire_touched = (*digiIt).wire();
257 if (
id.
wheel() == -2)
259 if (
id.
wheel() == -1)
270 cham_num = (
id.wheel() + 2) * 12 + (
id.
station() - 1) * 3 +
id.superlayer();
277 DTWireId wireId(
id, (*digiIt).wire());
278 if (wireId.station() == 1)
280 if (wireId.station() == 2)
282 if (wireId.station() == 3)
284 if (wireId.station() == 4)
290 for (vector<const PSimHit *>::iterator
hit = wireMap[wireId].begin();
hit != wireMap[wireId].end();
hit++)
291 if (
abs((*hit)->particleType()) == 13) {
292 theta = atan((*hit)->momentumAtEntry().x() / (-(*hit)->momentumAtEntry().z())) * 180 /
M_PI;
316 if (num_musimhits != 0) {