6 const auto& strip_pset =
pset.getParameterSet(
"gemStripDigi");
7 const auto& strip_tag = strip_pset.getParameter<
edm::InputTag>(
"inputTag");
10 const auto& simhit_pset =
pset.getParameterSet(
"gemSimHit");
11 const auto& simhit_tag = simhit_pset.getParameter<
edm::InputTag>(
"inputTag");
13 geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
14 geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
29 me_bx_ = booker.
book1D(
"strip_bx",
"Strip Digi Bunch Crossing", 5, -2.5, 2.5);
32 for (
const auto&
region :
gem->regions()) {
37 Int_t region_id =
region->region();
43 Int_t station_id =
station->station();
45 const auto& superChamberVec =
station->superChambers();
46 if (superChamberVec.empty()) {
48 <<
" and station = " << station_id;
52 if (super_chamber ==
nullptr) {
54 <<
" and station = " << station_id;
58 Int_t layer_id =
chamber->id().layer();
59 ME3IdsKey key3(region_id, station_id, layer_id);
62 bookHist1D(booker, key3,
"strip_bx",
"Strip Digi Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
71 for (
const auto&
region :
gem->regions()) {
72 Int_t region_id =
region->region();
79 "muon_simhit_occ_eta",
80 "Muon SimHit Eta Occupancy",
88 "matched_strip_occ_eta",
89 "Matched Strip Digi Eta Occupancy",
95 Int_t station_id =
station->station();
101 bookHist1D(booker, key2,
"muon_simhit_occ_phi",
"Muon SimHit Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
104 booker, key2,
"matched_strip_occ_phi",
"Matched Strip Digi Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
110 const auto& superChamberVec =
station->superChambers();
111 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
113 <<
" and station = " << station_id;
118 << station_id <<
", " << superChamberVec[0]->id() <<
")";
121 Int_t layer_id =
chamber->id().layer();
122 ME3IdsKey key3{region_id, station_id, layer_id};
125 const auto& etaPartitionsVec =
chamber->etaPartitions();
126 if (etaPartitionsVec.empty() || etaPartitionsVec.front() ==
nullptr) {
128 <<
"Eta partition missing or null for region, station, super chamber, chamber = (" << region_id
129 <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
", " <<
chamber->id() <<
")";
132 Int_t num_strips = etaPartitionsVec.front()->nstrips();
139 "Strip Digi Occupancy per strip number",
147 "strip_occ_phi_strip",
148 "Strip Digi Occupancy",
168 if (
gem ==
nullptr) {
174 if (not simhit_container.
isValid()) {
181 if (not digi_collection.
isValid()) {
187 for (
auto range_iter = digi_collection->begin(); range_iter != digi_collection->end(); range_iter++) {
189 if (
gem->idToDet(
id) ==
nullptr) {
191 <<
"from unmatched geometry." << std::endl;
195 Int_t region_id =
id.region();
196 Int_t layer_id =
id.layer();
197 Int_t station_id =
id.station();
198 Int_t chamber_id =
id.chamber();
199 Int_t roll_id =
id.roll();
202 ME3IdsKey key3{region_id, station_id, layer_id};
209 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
210 Int_t
strip = digi->strip();
211 Int_t
bx = digi->bx();
215 Float_t digi_g_r = strip_global_pos.
perp();
216 Float_t digi_g_abs_z =
std::abs(strip_global_pos.
z());
222 Float_t digi_g_x = strip_global_pos.
x();
223 Float_t digi_g_y = strip_global_pos.
y();
224 Float_t digi_g_phi = strip_global_pos.
phi();
235 for (
const auto& simhit : *simhit_container.
product()) {
239 if (
gem->idToDet(simhit.detUnitId()) ==
nullptr) {
244 GEMDetId simhit_gemid(simhit.detUnitId());
246 Int_t region_id = simhit_gemid.
region();
247 Int_t station_id = simhit_gemid.station();
248 Int_t layer_id = simhit_gemid.layer();
249 Int_t chamber_id = simhit_gemid.chamber();
250 Int_t roll_id = simhit_gemid.roll();
253 ME3IdsKey key3{region_id, station_id, layer_id};
257 const auto& simhit_local_pos = simhit.localPosition();
258 const auto& simhit_global_pos = roll->
surface().
toGlobal(simhit_local_pos);
260 Float_t simhit_g_eta =
std::abs(simhit_global_pos.eta());
261 Float_t simhit_g_phi = simhit_global_pos.phi();
263 Int_t simhit_strip = roll->
strip(simhit_local_pos);
270 auto range = digi_collection->get(simhit_gemid);
271 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
272 if (simhit_strip == digi->strip()) {