12 LogDebug(
"MuonME0RecHitsValidation") <<
"Info : Loading Geometry information\n";
15 unsigned int nregion = 2;
17 edm::LogInfo(
"MuonME0RecHitsValidation") <<
"+++ Info : # of region : " << nregion << std::endl;
19 LogDebug(
"MuonME0RecHitsValidation") <<
"+++ Info : finish to get geometry information from ES.\n";
21 for (
unsigned int region_num = 0; region_num < nregion; region_num++) {
23 for (
unsigned int layer_num = 0; layer_num < 6; layer_num++) {
24 me0_rh_xy[region_num][layer_num] =
BookHistXY(ibooker,
"me0_rh",
"RecHit", region_num, layer_num);
31 layerLabel[layer_num] +
" " +
" ; x_{SimHit} - x_{RecHit} ; entries";
33 layerLabel[layer_num] +
" " +
" ; y_{SimHit} - y_{RecHit} ; entries";
36 ibooker.
book1D(histo_name_DeltaX.c_str(), histo_label_DeltaX.c_str(), 100, -10, 10);
38 ibooker.
book1D(histo_name_DeltaY.c_str(), histo_label_DeltaY.c_str(), 100, -10, 10);
46 " ; #frac{x_{SimHit} - x_{RecHit}}{#sigma_{x,RecHit}} ; entries";
49 " ; #frac{y_{SimHit} - y_{RecHit}}{#sigma_{y,RecHit}} ; entries";
52 ibooker.
book1D(histo_name_PullX.c_str(), histo_label_DeltaX.c_str(), 100, -10, 10);
54 ibooker.
book1D(histo_name_PullY.c_str(), histo_label_DeltaY.c_str(), 100, -10, 10);
71 edm::LogError(
"ME0RecHitsValidation") <<
"Cannot get ME0Hits/ME0RecHits by Token simInputTagToken";
75 for (
auto hits = ME0Hits->begin();
hits != ME0Hits->end();
hits++) {
77 Int_t sh_region =
id.region();
78 Int_t sh_layer =
id.layer();
80 Int_t sh_chamber =
id.chamber();
81 Int_t sh_roll =
id.roll();
84 if (ME0Geometry_->
idToDet(
hits->detUnitId()) ==
nullptr) {
85 edm::LogInfo(
"ME0RecHitsValidation") <<
"simHit did not matched with GEMGeometry." << std::endl;
92 Float_t
x =
recHit->localPosition().x();
93 Float_t xErr =
recHit->localPositionError().xx();
94 Float_t
y =
recHit->localPosition().y();
95 Float_t yErr =
recHit->localPositionError().yy();
98 Float_t clusterSize = 0;
99 Float_t firstClusterStrip = 0;
107 Short_t roll = (Short_t)
id.roll();
112 Float_t globalR = rhGP.
perp();
113 Float_t globalX = rhGP.
x();
114 Float_t globalY = rhGP.
y();
115 Float_t globalZ = rhGP.
z();
117 Float_t x_sim = hitLP.x();
118 Float_t y_sim = hitLP.y();
119 Float_t pullX = (x_sim -
x) /
sqrt(xErr);
120 Float_t pullY = (y_sim -
y) /
sqrt(yErr);
125 std::vector<int> stripsFired;
126 for (
int i = firstClusterStrip;
i < (firstClusterStrip + clusterSize);
i++) {
127 stripsFired.push_back(
i);
130 const bool cond1(sh_region ==
region and sh_layer ==
layer and sh_station ==
station);
131 const bool cond2(sh_chamber ==
chamber and sh_roll == roll);
133 (
std::find(stripsFired.begin(), stripsFired.end(), (firstClusterStrip + 1)) != stripsFired.end())
or
141 int layer_num =
layer - 1;
143 if (cond1 and cond2 and cond3) {