45 event.getByToken(simHitToken, simHit);
46 event.getByToken(rpcDigiToken, rpcDigis);
49 PSimHitContainer::const_iterator simIt;
52 std::map<RPCDetId, std::vector<double> > allsims;
54 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++)
58 int ptype = simIt->particleType();
60 if (ptype == 13 || ptype == -13)
63 std::vector<double> buff;
64 if (allsims.find(Rsid) != allsims.end())
69 buff.push_back(simIt->localPosition().x());
78 xyview->Fill(sim_x, sim_y);
84 xyvDplu4->Fill(sim_x, sim_y);
87 else if (Rsid.
region() == (-1))
91 xyvDmin4->Fill(sim_x, sim_y);
94 rzview->Fill(p.
z(), p.
perp());
98 for (detUnitIt = rpcDigis->begin(); detUnitIt != rpcDigis->end(); ++detUnitIt)
100 const RPCDetId Rsid = (*detUnitIt).first;
104 std::vector<double> sims;
105 if (allsims.find(Rsid) != allsims.end())
107 sims = allsims[Rsid];
113 StripProf->Fill(digiIt->strip());
114 BxDist->Fill(digiIt->bx());
116 if (Rsid.
region() == (+1))
119 BxDisc_4Plus->Fill(digiIt->bx());
121 else if (Rsid.
region() == (-1))
124 BxDisc_4Min->Fill(digiIt->bx());
128 const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx()*25;
129 hDigiTimeAll->Fill(digiTime);
130 if ( digiIt->hasTime() ) {
131 hDigiTime->Fill(digiTime);
132 if ( roll->
isIRPC() ) hDigiTimeIRPC->Fill(digiTime);
133 else hDigiTimeNoIRPC->Fill(digiTime);
137 if (sims.size() == 1 && ndigi == 1)
139 double dis = roll->
centreOfStrip(range.first->strip()).
x() - sims[0];
144 if (Rsid.
ring() == -2)
146 else if (Rsid.
ring() == -1)
148 else if (Rsid.
ring() == 0)
150 else if (Rsid.
ring() == 1)
152 else if (Rsid.
ring() == 2)
156 ResLayer1_barrel->Fill(dis);
158 ResLayer2_barrel->Fill(dis);
160 ResLayer3_barrel->Fill(dis);
162 ResLayer4_barrel->Fill(dis);
164 ResLayer5_barrel->Fill(dis);
166 ResLayer6_barrel->Fill(dis);
171 if (Rsid.
ring() == 2)
175 if (Rsid.
roll() == 1)
176 Res_Endcap1_Ring2_A->Fill(dis);
177 if (Rsid.
roll() == 2)
178 Res_Endcap1_Ring2_B->Fill(dis);
179 if (Rsid.
roll() == 3)
180 Res_Endcap1_Ring2_C->Fill(dis);
184 if (Rsid.
roll() == 1)
185 Res_Endcap23_Ring2_A->Fill(dis);
186 if (Rsid.
roll() == 2)
187 Res_Endcap23_Ring2_B->Fill(dis);
188 if (Rsid.
roll() == 3)
189 Res_Endcap23_Ring2_C->Fill(dis);
192 if (Rsid.
ring() == 3)
194 if (Rsid.
roll() == 1)
195 Res_Endcap123_Ring3_A->Fill(dis);
196 if (Rsid.
roll() == 2)
197 Res_Endcap123_Ring3_B->Fill(dis);
198 if (Rsid.
roll() == 3)
199 Res_Endcap123_Ring3_C->Fill(dis);
203 if (Rsid.
region() == (+1))
215 if (Rsid.
region() == (-1))
235 xyview = booker.
book2D(
"X_Vs_Y_View",
"X_Vs_Y_View", 155, -775., 775., 155, -775., 775.);
237 xyvDplu4 = booker.
book2D(
"Dplu4_XvsY",
"Dplu4_XvsY", 155, -775., 775., 155, -775., 775.);
238 xyvDmin4 = booker.
book2D(
"Dmin4_XvsY",
"Dmin4_XvsY", 155, -775., 775., 155, -775., 775.);
240 rzview = booker.
book2D(
"R_Vs_Z_View",
"R_Vs_Z_View", 216, -1080., 1080., 52, 260., 780.);
241 Res = booker.
book1D(
"Digi_SimHit_difference",
"Digi_SimHit_difference", 300, -8, 8);
242 ResWmin2 = booker.
book1D(
"W_Min2_Residuals",
"W_Min2_Residuals", 400, -8, 8);
243 ResWmin1 = booker.
book1D(
"W_Min1_Residuals",
"W_Min1_Residuals", 400, -8, 8);
244 ResWzer0 = booker.
book1D(
"W_Zer0_Residuals",
"W_Zer0_Residuals", 400, -8, 8);
245 ResWplu1 = booker.
book1D(
"W_Plu1_Residuals",
"W_Plu1_Residuals", 400, -8, 8);
246 ResWplu2 = booker.
book1D(
"W_Plu2_Residuals",
"W_Plu2_Residuals", 400, -8, 8);
248 ResLayer1_barrel = booker.
book1D(
"ResLayer1_barrel",
"ResLayer1_barrel", 400, -8, 8);
249 ResLayer2_barrel = booker.
book1D(
"ResLayer2_barrel",
"ResLayer2_barrel", 400, -8, 8);
250 ResLayer3_barrel = booker.
book1D(
"ResLayer3_barrel",
"ResLayer3_barrel", 400, -8, 8);
251 ResLayer4_barrel = booker.
book1D(
"ResLayer4_barrel",
"ResLayer4_barrel", 400, -8, 8);
252 ResLayer5_barrel = booker.
book1D(
"ResLayer5_barrel",
"ResLayer5_barrel", 400, -8, 8);
253 ResLayer6_barrel = booker.
book1D(
"ResLayer6_barrel",
"ResLayer6_barrel", 400, -8, 8);
255 BxDist = booker.
book1D(
"Bunch_Crossing",
"Bunch_Crossing", 20, -10., 10.);
256 StripProf = booker.
book1D(
"Strip_Profile",
"Strip_Profile", 100, 0, 100);
258 BxDisc_4Plus = booker.
book1D(
"BxDisc_4Plus",
"BxDisc_4Plus", 20, -10., 10.);
259 BxDisc_4Min = booker.
book1D(
"BxDisc_4Min",
"BxDisc_4Min", 20, -10., 10.);
262 ResDmin1 = booker.
book1D(
"Disk_Min1_Residuals",
"Disk_Min1_Residuals", 400, -8, 8);
263 ResDmin2 = booker.
book1D(
"Disk_Min2_Residuals",
"Disk_Min2_Residuals", 400, -8, 8);
264 ResDmin3 = booker.
book1D(
"Disk_Min3_Residuals",
"Disk_Min3_Residuals", 400, -8, 8);
265 ResDplu1 = booker.
book1D(
"Disk_Plu1_Residuals",
"Disk_Plu1_Residuals", 400, -8, 8);
266 ResDplu2 = booker.
book1D(
"Disk_Plu2_Residuals",
"Disk_Plu2_Residuals", 400, -8, 8);
267 ResDplu3 = booker.
book1D(
"Disk_Plu3_Residuals",
"Disk_Plu3_Residuals", 400, -8, 8);
269 ResDmin4 = booker.
book1D(
"Disk_Min4_Residuals",
"Disk_Min4_Residuals", 400, -8, 8);
270 ResDplu4 = booker.
book1D(
"Disk_Plu4_Residuals",
"Disk_Plu4_Residuals", 400, -8, 8);
272 Res_Endcap1_Ring2_A = booker.
book1D(
"Res_Endcap1_Ring2_A",
"Res_Endcap1_Ring2_A", 400, -8, 8);
273 Res_Endcap1_Ring2_B = booker.
book1D(
"Res_Endcap1_Ring2_B",
"Res_Endcap1_Ring2_B", 400, -8, 8);
274 Res_Endcap1_Ring2_C = booker.
book1D(
"Res_Endcap1_Ring2_C",
"Res_Endcap1_Ring2_C", 400, -8, 8);
276 Res_Endcap23_Ring2_A = booker.
book1D(
"Res_Endcap23_Ring2_A",
"Res_Endcap23_Ring2_A", 400, -8, 8);
277 Res_Endcap23_Ring2_B = booker.
book1D(
"Res_Endcap23_Ring2_B",
"Res_Endcap23_Ring2_B", 400, -8, 8);
278 Res_Endcap23_Ring2_C = booker.
book1D(
"Res_Endcap23_Ring2_C",
"Res_Endcap23_Ring2_C", 400, -8, 8);
280 Res_Endcap123_Ring3_A = booker.
book1D(
"Res_Endcap123_Ring3_A",
"Res_Endcap123_Ring3_A", 400, -8, 8);
281 Res_Endcap123_Ring3_B = booker.
book1D(
"Res_Endcap123_Ring3_B",
"Res_Endcap123_Ring3_B", 400, -8, 8);
282 Res_Endcap123_Ring3_C = booker.
book1D(
"Res_Endcap123_Ring3_C",
"Res_Endcap123_Ring3_C", 400, -8, 8);
285 hDigiTimeAll = booker.
book1D(
"DigiTimeAll" ,
"Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5);
286 hDigiTime = booker.
book1D(
"DigiTime" ,
"Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5);
287 hDigiTimeIRPC = booker.
book1D(
"DigiTimeIRPC" ,
"IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
288 hDigiTimeNoIRPC = booker.
book1D(
"DigiTimeNoIRPC",
"non-IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5);
T getUntrackedParameter(std::string const &, T const &) const
LocalPoint centreOfStrip(int strip) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
RPCDigiValid(const edm::ParameterSet &ps)
T x() const
Cartesian x coordinate.
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< RPCDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.