8 const auto& rechit_pset =
pset.getParameterSet(
"gemRecHit");
9 const auto& rechit_tag = rechit_pset.getParameter<
edm::InputTag>(
"inputTag");
12 const auto& simhit_pset =
pset.getParameterSet(
"gemSimHit");
13 const auto& simhit_tag = simhit_pset.getParameter<
edm::InputTag>(
"inputTag");
25 TString cls_title =
"Cluster Size Distribution";
26 TString cls_x_title =
"Cluster size";
28 me_cls_ = booker.
book1D(
"cls", cls_title +
";" + cls_x_title +
";" +
"Entries", 11, -0.5, 10.5);
31 for (
const auto&
region :
gem->regions()) {
32 Int_t region_id =
region->region();
35 Int_t station_id =
station->station();
37 const auto& superChamberVec =
station->superChambers();
38 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
40 <<
" and station = " << station_id;
43 Int_t layer_id =
chamber->id().layer();
44 ME3IdsKey key3{region_id, station_id, layer_id};
56 for (
const auto&
region :
gem->regions()) {
57 Int_t region_id =
region->region();
60 bookHist1D(booker, region_id,
"residual_x",
"Residual in X", 120, -3, 3,
"Residual in X [cm]");
63 bookHist1D(booker, region_id,
"residual_y",
"Residual in Y", 600, -15, 15,
"Residual in Y [cm]");
67 Int_t station_id =
station->station();
69 const auto& superChamberVec =
station->superChambers();
70 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
72 Int_t layer_id =
chamber->id().layer();
73 ME3IdsKey key3{region_id, station_id, layer_id};
77 bookHist1D(booker, key3,
"residual_x",
"Residual in X", 120, -3, 3,
"Residual in X [cm]");
80 bookHist1D(booker, key3,
"residual_y",
"Residual in Y", 600, -15, 15,
"Residual in Y [cm]");
91 for (
const auto&
region :
gem->regions()) {
92 Int_t region_id =
region->region();
100 Int_t station_id =
station->station();
102 const auto& superChamberVec =
station->superChambers();
103 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
105 Int_t layer_id =
chamber->id().layer();
106 ME3IdsKey key3{region_id, station_id, layer_id};
120 for (
const auto&
region :
gem->regions()) {
121 Int_t region_id =
region->region();
127 "muon_simhit_occ_eta",
128 "Muon SimHit Eta Occupancy",
136 "matched_rechit_occ_eta",
137 "Matched RecHit Eta Occupancy",
144 Int_t station_id =
station->station();
148 bookHist1D(booker, key2,
"muon_simhit_occ_phi",
"Muon SimHit Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
151 bookHist1D(booker, key2,
"matched_rechit_occ_phi",
"Matched RecHit Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
158 const auto& superChamberVec =
station->superChambers();
159 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
161 Int_t layer_id =
chamber->id().layer();
162 ME3IdsKey key3{region_id, station_id, layer_id};
178 Int_t cls = rechit->clusterSize();
179 Int_t rechit_first_strip = rechit->firstClusterStrip();
182 matched = simhit_strip == rechit_first_strip;
184 Int_t rechit_last_strip = rechit_first_strip + cls - 1;
185 matched = (simhit_strip >= rechit_first_strip) and (simhit_strip <= rechit_last_strip);
196 if (not simhit_container.
isValid()) {
203 if (not rechit_collection.
isValid()) {
208 for (
auto rechit = rechit_collection->begin(); rechit != rechit_collection->end(); rechit++) {
210 Int_t region_id = gem_id.
region();
211 Int_t station_id = gem_id.station();
212 Int_t layer_id = gem_id.layer();
215 ME3IdsKey key3{region_id, station_id, layer_id};
218 GlobalPoint&& rechit_global_pos = surface.toGlobal(rechit->localPosition());
220 Float_t rechit_g_x = rechit_global_pos.
x();
221 Float_t rechit_g_y = rechit_global_pos.
y();
222 Float_t rechit_g_abs_z = std::fabs(rechit_global_pos.
z());
223 Float_t rechit_g_r = rechit_global_pos.
perp();
224 Float_t rechit_g_phi = rechit_global_pos.
phi();
226 Int_t cls = rechit->clusterSize();
229 me_occ_zr_[region_id]->Fill(rechit_g_abs_z, rechit_g_r);
239 for (
const auto& simhit : *simhit_container.
product()) {
240 if (
gem->idToDet(simhit.detUnitId()) ==
nullptr) {
248 GEMDetId simhit_gemid{simhit.detUnitId()};
249 const BoundPlane& surface =
gem->idToDet(simhit_gemid)->surface();
251 Int_t region_id = simhit_gemid.region();
252 Int_t station_id = simhit_gemid.station();
253 Int_t layer_id = simhit_gemid.layer();
254 Int_t chamber_id = simhit_gemid.chamber();
255 Int_t roll_id = simhit_gemid.roll();
258 ME3IdsKey key3{region_id, station_id, layer_id};
260 const LocalPoint& simhit_local_pos = simhit.localPosition();
261 const GlobalPoint& simhit_global_pos = surface.toGlobal(simhit_local_pos);
263 Float_t simhit_g_abs_eta = std::fabs(simhit_global_pos.
eta());
264 Float_t simhit_g_phi = simhit_global_pos.
phi();
266 Int_t simhit_strip =
gem->etaPartition(simhit_gemid)->strip(simhit_local_pos);
274 for (
auto rechit =
range.first; rechit !=
range.second; ++rechit) {
275 if (
gem->idToDet(rechit->gemId()) ==
nullptr) {
281 const LocalPoint& rechit_local_pos = rechit->localPosition();
283 Float_t resolution_x =
std::sqrt(rechit->localPositionError().xx());
284 Float_t resolution_y =
std::sqrt(rechit->localPositionError().yy());
286 Float_t residual_x = rechit_local_pos.
x() - simhit_local_pos.
x();
287 Float_t residual_y = rechit_local_pos.
y() - simhit_local_pos.
y();
289 Float_t pull_x = residual_x / resolution_x;
290 Float_t pull_y = residual_y / resolution_y;