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");
15 geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
16 geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
27 TString cls_title =
"Cluster Size Distribution";
28 TString cls_x_title =
"Cluster size";
30 me_cls_ = booker.
book1D(
"cls", cls_title +
";" + cls_x_title +
";" +
"Entries", 11, -0.5, 10.5);
33 for (
const auto&
region :
gem->regions()) {
34 Int_t region_id =
region->region();
37 Int_t station_id =
station->station();
39 const auto& superChamberVec =
station->superChambers();
40 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
42 <<
" and station = " << station_id;
45 Int_t layer_id =
chamber->id().layer();
46 ME3IdsKey key3{region_id, station_id, layer_id};
58 for (
const auto&
region :
gem->regions()) {
59 Int_t region_id =
region->region();
62 bookHist1D(booker, region_id,
"residual_x",
"Residual in X", 120, -3, 3,
"Residual in X [cm]");
65 bookHist1D(booker, region_id,
"residual_y",
"Residual in Y", 600, -15, 15,
"Residual in Y [cm]");
69 Int_t station_id =
station->station();
71 const auto& superChamberVec =
station->superChambers();
72 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
74 Int_t layer_id =
chamber->id().layer();
75 ME3IdsKey key3{region_id, station_id, layer_id};
79 bookHist1D(booker, key3,
"residual_x",
"Residual in X", 120, -3, 3,
"Residual in X [cm]");
82 bookHist1D(booker, key3,
"residual_y",
"Residual in Y", 600, -15, 15,
"Residual in Y [cm]");
93 for (
const auto&
region :
gem->regions()) {
94 Int_t region_id =
region->region();
102 Int_t station_id =
station->station();
104 const auto& superChamberVec =
station->superChambers();
105 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
107 Int_t layer_id =
chamber->id().layer();
108 ME3IdsKey key3{region_id, station_id, layer_id};
122 for (
const auto&
region :
gem->regions()) {
123 Int_t region_id =
region->region();
129 "muon_simhit_occ_eta",
130 "Muon SimHit Eta Occupancy",
138 "matched_rechit_occ_eta",
139 "Matched RecHit Eta Occupancy",
146 Int_t station_id =
station->station();
150 bookHist1D(booker, key2,
"muon_simhit_occ_phi",
"Muon SimHit Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
153 bookHist1D(booker, key2,
"matched_rechit_occ_phi",
"Matched RecHit Phi Occupancy", 51, -
M_PI,
M_PI,
"#phi");
160 const auto& superChamberVec =
station->superChambers();
161 if (!superChamberVec.empty() && superChamberVec[0] !=
nullptr) {
163 Int_t layer_id =
chamber->id().layer();
164 ME3IdsKey key3{region_id, station_id, layer_id};
180 Int_t cls = rechit->clusterSize();
181 Int_t rechit_first_strip = rechit->firstClusterStrip();
184 matched = simhit_strip == rechit_first_strip;
186 Int_t rechit_last_strip = rechit_first_strip + cls - 1;
187 matched = (simhit_strip >= rechit_first_strip) and (simhit_strip <= rechit_last_strip);
198 if (not simhit_container.
isValid()) {
205 if (not rechit_collection.
isValid()) {
210 for (
auto rechit = rechit_collection->begin(); rechit != rechit_collection->end(); rechit++) {
212 Int_t region_id = gem_id.
region();
213 Int_t station_id = gem_id.station();
214 Int_t layer_id = gem_id.layer();
217 ME3IdsKey key3{region_id, station_id, layer_id};
220 GlobalPoint&& rechit_global_pos = surface.toGlobal(rechit->localPosition());
222 Float_t rechit_g_x = rechit_global_pos.
x();
223 Float_t rechit_g_y = rechit_global_pos.
y();
224 Float_t rechit_g_abs_z = std::fabs(rechit_global_pos.
z());
225 Float_t rechit_g_r = rechit_global_pos.
perp();
226 Float_t rechit_g_phi = rechit_global_pos.
phi();
228 Int_t cls = rechit->clusterSize();
231 me_occ_zr_[region_id]->Fill(rechit_g_abs_z, rechit_g_r);
241 for (
const auto& simhit : *simhit_container.
product()) {
242 if (
gem->idToDet(simhit.detUnitId()) ==
nullptr) {
250 GEMDetId simhit_gemid{simhit.detUnitId()};
251 const BoundPlane& surface =
gem->idToDet(simhit_gemid)->surface();
253 Int_t region_id = simhit_gemid.region();
254 Int_t station_id = simhit_gemid.station();
255 Int_t layer_id = simhit_gemid.layer();
256 Int_t chamber_id = simhit_gemid.chamber();
257 Int_t roll_id = simhit_gemid.roll();
260 ME3IdsKey key3{region_id, station_id, layer_id};
262 const LocalPoint& simhit_local_pos = simhit.localPosition();
263 const GlobalPoint& simhit_global_pos = surface.toGlobal(simhit_local_pos);
265 Float_t simhit_g_abs_eta = std::fabs(simhit_global_pos.
eta());
266 Float_t simhit_g_phi = simhit_global_pos.
phi();
268 Int_t simhit_strip =
gem->etaPartition(simhit_gemid)->strip(simhit_local_pos);
276 for (
auto rechit =
range.first; rechit !=
range.second; ++rechit) {
277 if (
gem->idToDet(rechit->gemId()) ==
nullptr) {
283 const LocalPoint& rechit_local_pos = rechit->localPosition();
285 Float_t resolution_x =
std::sqrt(rechit->localPositionError().xx());
286 Float_t resolution_y =
std::sqrt(rechit->localPositionError().yy());
288 Float_t residual_x = rechit_local_pos.
x() - simhit_local_pos.
x();
289 Float_t residual_y = rechit_local_pos.
y() - simhit_local_pos.
y();
291 Float_t pull_x = residual_x / resolution_x;
292 Float_t pull_y = residual_y / resolution_y;