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");
17 geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
18 geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
33 me_bx_ = booker.
book1D(
"strip_bx",
"Strip Digi Bunch Crossing", 5, -2.5, 2.5);
35 for (
const auto&
region :
gem->regions()) {
40 Int_t region_id =
region->region();
46 Int_t station_id =
station->station();
48 const auto& superChamberVec =
station->superChambers();
49 if (superChamberVec.empty()) {
51 <<
" and station = " << station_id;
55 if (super_chamber ==
nullptr) {
57 <<
" and station = " << station_id;
61 Int_t layer_id =
chamber->id().layer();
62 ME3IdsKey key3(region_id, station_id, layer_id);
65 bookHist1D(booker, key3,
"strip_bx",
"Strip Digi Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
73 me_total_strip_ = booker.
book1D(
"total_strips_per_event",
"Number of strip digi per event", 50, -0.5, 395.5);
75 for (
const auto&
region :
gem->regions()) {
76 Int_t region_id =
region->region();
82 Int_t station_id =
station->station();
87 bookHist1D(booker, key2,
"total_strips_per_event",
"Number of strip digs per event", 50, -0.5, 99.5);
95 const auto& superChamberVec =
station->superChambers();
96 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
98 <<
" and station = " << station_id;
103 << station_id <<
", " << superChamberVec[0]->id() <<
")";
106 Int_t layer_id =
chamber->id().layer();
107 ME3IdsKey key3{region_id, station_id, layer_id};
109 const auto& etaPartitionsVec =
chamber->etaPartitions();
110 if (etaPartitionsVec.empty() || etaPartitionsVec.front() ==
nullptr) {
112 <<
"Eta partition missing or null for region, station, super chamber, chamber = (" << region_id <<
", "
113 << station_id <<
", " << superChamberVec[0]->id() <<
", " <<
chamber->id() <<
")";
120 Int_t num_strips = etaPartitionsVec.front()->nstrips();
124 "matched_strip_occ_eta",
125 "Matched Strip Eta Occupancy",
132 booker, key3,
"matched_strip_occ_phi",
"Matched Strip Phi Occupancy", 36, -5, 355,
"#phi [degrees]");
139 "Strip Digi Occupancy per strip number",
155 if (
gem ==
nullptr) {
162 if (not digiSimLink.
isValid()) {
169 if (not simhit_container.
isValid()) {
176 if (not digi_collection.
isValid()) {
182 Int_t total_strip = 0;
183 std::map<ME2IdsKey, Int_t> total_strip_2IdsMap;
184 for (
const auto digi_pair : *digi_collection) {
186 if (
gem->idToDet(
id) ==
nullptr) {
188 <<
"from unmatched geometry." << std::endl;
192 Int_t region_id =
id.region();
193 Int_t layer_id =
id.layer();
194 Int_t station_id =
id.station();
195 Int_t chamber_id =
id.chamber();
196 Int_t
ieta =
id.ieta();
197 Int_t num_layers =
id.nlayers();
200 ME3IdsKey key3{region_id, station_id, layer_id};
201 Int_t bin_x =
getDetOccBinX(num_layers, chamber_id, layer_id);
207 auto links = digiSimLink->find(
id);
208 if (
links == digiSimLink->end())
211 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
213 total_strip_2IdsMap[key2]++;
214 Int_t
strip = digi->strip();
215 Int_t
bx = digi->bx();
221 Float_t digi_g_x = strip_global_pos.
x();
222 Float_t digi_g_y = strip_global_pos.
y();
223 Float_t digi_g_r = strip_global_pos.
perp();
224 Float_t digi_g_abs_z =
std::abs(strip_global_pos.
z());
239 for (
const auto&
region :
gem->regions()) {
240 Int_t region_id =
region->region();
242 Int_t station_id =
station->station();
250 for (
const auto& simhit : *simhit_container.
product()) {
251 if (
gem->idToDet(simhit.detUnitId()) ==
nullptr) {
256 GEMDetId simhit_gemid(simhit.detUnitId());
258 Int_t region_id = simhit_gemid.
region();
259 Int_t station_id = simhit_gemid.station();
260 Int_t layer_id = simhit_gemid.layer();
261 Int_t chamber_id = simhit_gemid.chamber();
262 Int_t
ieta = simhit_gemid.ieta();
263 Int_t num_layers = simhit_gemid.nlayers();
266 ME3IdsKey key3{region_id, station_id, layer_id};
270 const auto& simhit_local_pos = simhit.localPosition();
271 const auto& simhit_global_pos = roll->
surface().
toGlobal(simhit_local_pos);
273 Float_t simhit_g_eta =
std::abs(simhit_global_pos.eta());
274 Float_t simhit_g_phi =
toDegree(simhit_global_pos.phi());
276 auto simhit_trackId = simhit.trackId();
278 Int_t bin_x =
getDetOccBinX(num_layers, chamber_id, layer_id);
280 auto links = digiSimLink->find(simhit_gemid);
281 if (
links == digiSimLink->end())
285 if (simhit_trackId ==
link.getTrackId()) {
286 Int_t pid = simhit.particleType();