46 int findVFAT(
float min_,
float max_,
float x_,
int roll_);
52 std::unordered_map<UInt_t, MonitorElement*>
recHitME_;
63 float step =
abs(max_ - min_) / 3.0;
64 if (x_ < (
min(min_, max_) +
step)) {
66 }
else if (x_ < (
min(min_, max_) + 2.0 *
step)) {
78 GEMGeometry_ = &*hGeom;
80 edm::LogError(
"MuonGEMBaseValidation") <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
87 tagRecHit_ = consumes<GEMRecHitCollection>(
cfg.getParameter<
edm::InputTag>(
"recHitsInputLabel"));
89 nIdxFirstStrip_ =
cfg.getParameter<
int>(
"idxFirstStrip");
90 nClusterSizeBinNum_ =
cfg.getParameter<
int>(
"ClusterSizeBinNum");
92 fGlobXMin_ =
cfg.getParameter<
double>(
"global_x_bound_min");
93 fGlobXMax_ =
cfg.getParameter<
double>(
"global_x_bound_max");
94 fGlobYMin_ =
cfg.getParameter<
double>(
"global_y_bound_min");
95 fGlobYMax_ =
cfg.getParameter<
double>(
"global_y_bound_max");
102 desc.add<
int>(
"idxFirstStrip", 0);
103 desc.add<
int>(
"ClusterSizeBinNum", 9);
105 desc.add<
double>(
"global_x_bound_min", -350);
106 desc.add<
double>(
"global_x_bound_max", 350);
107 desc.add<
double>(
"global_y_bound_min", -260);
108 desc.add<
double>(
"global_y_bound_max", 260);
110 descriptions.
add(
"GEMDQMSource",
desc);
114 std::vector<GEMDetId> listLayerOcc;
116 GEMGeometry_ = initGeometry(iSetup);
117 if (GEMGeometry_ ==
nullptr)
120 const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
121 for (
auto sch : superChambers_) {
122 int n_lay = sch->nChambers();
123 for (
int l = 0;
l < n_lay;
l++) {
124 Bool_t bExist =
false;
125 for (
const auto& ch : gemChambers_)
126 if (ch.id() == sch->chamber(
l + 1)->id())
131 gemChambers_.push_back(*sch->chamber(
l + 1));
138 for (
const auto& ch : gemChambers_) {
142 to_string(gid.
station()) +
"_" + to_string(gid.
layer());
144 to_string(gid.
station()) +
"/" + to_string(gid.
layer());
152 string hName =
"recHit_" + strIdxName;
153 string hTitle =
"recHit " + strIdxTitle;
155 recHitME_[gid] = ibooker.
book1D(hName, hTitle, 24, 0, 24);
157 string hName_2 =
"VFAT_vs_ClusterSize_" + strIdxName;
158 string hTitle_2 =
"VFAT vs ClusterSize " + strIdxTitle;
159 hTitle_2 +=
";Cluster size;VFAT";
160 VFAT_vs_ClusterSize_[gid] =
161 ibooker.
book2D(hName_2, hTitle_2, nClusterSizeBinNum_, 1, nClusterSizeBinNum_ + 1, 24, 0, 24);
163 string hName_fired =
"StripFired_" + strIdxName;
164 string hTitle_fired =
"StripsFired " + strIdxTitle;
165 hTitle_fired +=
";Strip;iEta";
166 StripsFired_vs_eta_[gid] = ibooker.
book2D(hName_fired, hTitle_fired, 384, 1, 385, 8, 1, 9);
168 string hName_rh =
"recHit_x_" + strIdxName;
169 string hTitle_rh =
"recHit local x " + strIdxTitle;
170 hTitle_rh +=
";Local x (cm);iEta";
171 rh_vs_eta_[gid] = ibooker.
book2D(hName_rh, hTitle_rh, 50, -25, 25, 8, 1, 9);
176 for (; nIdxOcc < (Int_t)listLayerOcc.size(); nIdxOcc++)
177 if (listLayerOcc[nIdxOcc] == lid)
179 if (nIdxOcc >= (Int_t)listLayerOcc.size())
180 listLayerOcc.push_back(lid);
183 for (
auto gid : listLayerOcc) {
185 std::string(
"GE") + (gid.region() > 0 ?
"p" :
"m") + to_string(gid.station()) +
"_" + to_string(gid.layer());
187 std::string(
"GE") + (gid.region() > 0 ?
"+" :
"-") + to_string(gid.station()) +
"/" + to_string(gid.layer());
189 string hName_rh =
"recHit_globalPos_Gemini_" + strIdxName;
190 string hTitle_rh =
"recHit global position Gemini chamber : " + strIdxTitle;
191 hTitle_rh +=
";Global X (cm);Global Y (cm)";
192 recGlobalPos[gid] = ibooker.
book2D(hName_rh, hTitle_rh, 100, fGlobXMin_, fGlobXMax_, 100, fGlobYMin_, fGlobYMax_);
197 const GEMGeometry* GEMGeometry_ = initGeometry(eventSetup);
198 if (GEMGeometry_ ==
nullptr)
202 event.getByToken(this->tagRecHit_,
gemRecHits);
204 edm::LogError(
"GEMDQMSource") <<
"GEM recHit is not valid.\n";
207 for (
const auto& ch : gemChambers_) {
209 for (
auto roll : ch.etaPartitions()) {
211 const auto& recHitsRange =
gemRecHits->get(rId);
214 Int_t nIdxStrip =
hit->firstClusterStrip() + 0.5 *
hit->clusterSize() - nIdxFirstStrip_;
215 Int_t nVfat = 8 * ((Int_t)(nIdxStrip / (roll->nstrips() / 3)) + 1) - rId.
roll();
216 recHitME_[cId]->Fill(nVfat);
217 rh_vs_eta_[cId]->Fill(
hit->localPosition().
x(), rId.
roll());
218 Int_t nCLSOverflow = (
hit->clusterSize() <= nClusterSizeBinNum_ ?
hit->clusterSize() : nClusterSizeBinNum_);
219 VFAT_vs_ClusterSize_[cId]->Fill(nCLSOverflow, nVfat);
220 for (
int i =
hit->firstClusterStrip();
i < (
hit->firstClusterStrip() +
hit->clusterSize());
i++) {
221 StripsFired_vs_eta_[cId]->Fill(
i, rId.
roll());
226 recGlobalPos[idLayer]->Fill(recHitGP.
x(), recHitGP.
y());