CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiPixelRecHitsValid.cc
Go to the documentation of this file.
1 // SiPixelRecHitsValid.cc
2 // Description: see SiPixelRecHitsValid.h
3 // Author: Jason Shaev, JHU
4 // Created 6/7/06
5 //
6 // G. Giurgiu, JHU (ggiurgiu@pha.jhu.edu)
7 // added pull distributions (12/27/06)
8 //--------------------------------
9 
11 
23 
25 
32 
40 
43 
44 #include <cmath>
45 
47  : tTopoEsToken(esConsumes()),
48  tGeomEsToken(esConsumes()),
49  trackerHitAssociatorConfig_(ps, consumesCollector()),
50  siPixelRecHitCollectionToken_(consumes<SiPixelRecHitCollection>(ps.getParameter<edm::InputTag>("src"))) {}
51 
53 
55  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/clustBPIX");
56 
57  Char_t histo[200];
58 
59  // ---------------------------------------------------------------
60  // All histograms that depend on plaquette number have 7 indexes.
61  // The first 4 (0-3) correspond to Panel 1 plaquettes 1-4.
62  // The last 3 (4-6) correspond to Panel 2 plaquettes 1-3.
63  // ---------------------------------------------------------------
64 
65  //Cluster y-size by module number for barrel
66  for (int i = 0; i < 8; i++) {
67  sprintf(histo, "Clust_y_size_Module%d", i + 1);
68  clustYSizeModule[i] = ibooker.book1D(histo, "Cluster y-size by Module", 20, 0.5, 20.5);
69  } // end for
70 
71  //Cluster x-size by layer for barrel
72  for (int i = 0; i < 3; i++) {
73  sprintf(histo, "Clust_x_size_Layer%d", i + 1);
74  clustXSizeLayer[i] = ibooker.book1D(histo, "Cluster x-size by Layer", 20, 0.5, 20.5);
75  } // end for
76 
77  //Cluster charge by module for 3 layers of barrel
78  for (int i = 0; i < 8; i++) {
79  //Cluster charge by module for Layer1
80  sprintf(histo, "Clust_charge_Layer1_Module%d", i + 1);
81  clustChargeLayer1Modules[i] = ibooker.book1D(histo, "Cluster charge Layer 1 by Module", 50, 0., 200000.);
82 
83  //Cluster charge by module for Layer2
84  sprintf(histo, "Clust_charge_Layer2_Module%d", i + 1);
85  clustChargeLayer2Modules[i] = ibooker.book1D(histo, "Cluster charge Layer 2 by Module", 50, 0., 200000.);
86 
87  //Cluster charge by module for Layer3
88  sprintf(histo, "Clust_charge_Layer3_Module%d", i + 1);
89  clustChargeLayer3Modules[i] = ibooker.book1D(histo, "Cluster charge Layer 3 by Module", 50, 0., 200000.);
90  } // end for
91 
92  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/clustFPIX");
93  //Cluster x-size, y-size, and charge by plaquette for Disks in Forward
94  for (int i = 0; i < 7; i++) {
95  //Cluster x-size for Disk1 by Plaquette
96  sprintf(histo, "Clust_x_size_Disk1_Plaquette%d", i + 1);
97  clustXSizeDisk1Plaquettes[i] = ibooker.book1D(histo, "Cluster X-size for Disk1 by Plaquette", 20, 0.5, 20.5);
98 
99  //Cluster x-size for Disk2 by Plaquette
100  sprintf(histo, "Clust_x_size_Disk2_Plaquette%d", i + 1);
101  clustXSizeDisk2Plaquettes[i] = ibooker.book1D(histo, "Cluster X-size for Disk2 by Plaquette", 20, 0.5, 20.5);
102 
103  //Cluster y-size for Disk1 by Plaquette
104  sprintf(histo, "Clust_y_size_Disk1_Plaquette%d", i + 1);
105  clustYSizeDisk1Plaquettes[i] = ibooker.book1D(histo, "Cluster Y-size for Disk1 by Plaquette", 20, 0.5, 20.5);
106 
107  //Cluster y-size for Disk2 by Plaquette
108  sprintf(histo, "Clust_y_size_Disk2_Plaquette%d", i + 1);
109  clustYSizeDisk2Plaquettes[i] = ibooker.book1D(histo, "Cluster Y-size for Disk2 by Plaquette", 20, 0.5, 20.5);
110 
111  //Cluster charge for Disk1 by Plaquette
112  sprintf(histo, "Clust_charge_Disk1_Plaquette%d", i + 1);
113  clustChargeDisk1Plaquettes[i] = ibooker.book1D(histo, "Cluster charge for Disk1 by Plaquette", 50, 0., 200000.);
114 
115  //Cluster charge for Disk2 by Plaquette
116  sprintf(histo, "Clust_charge_Disk2_Plaquette%d", i + 1);
117  clustChargeDisk2Plaquettes[i] = ibooker.book1D(histo, "Cluster charge for Disk2 by Plaquette", 50, 0., 200000.);
118  } // end for
119 
120  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/recHitBPIX");
121  //RecHit Bunch crossing all barrel hits
122  recHitBunchB = ibooker.book1D("RecHit_Bunch_Barrel", "RecHit Bunch Crossing, Barrel", 20, -10., 10.);
123 
124  //RecHit Event, in-time bunch, all barrel hits
125  recHitEventB = ibooker.book1D("RecHit_Event_Barrel", "RecHit Event (in-time bunch), Barrel", 100, 0., 100.);
126 
127  //RecHit X Resolution all barrel hits
128  recHitXResAllB = ibooker.book1D("RecHit_xres_b_All", "RecHit X Res All Modules in Barrel", 100, -200., 200.);
129 
130  //RecHit Y Resolution all barrel hits
131  recHitYResAllB = ibooker.book1D("RecHit_yres_b_All", "RecHit Y Res All Modules in Barrel", 100, -200., 200.);
132 
133  //RecHit X distribution for full modules for barrel
134  recHitXFullModules = ibooker.book1D("RecHit_x_FullModules", "RecHit X distribution for full modules", 100, -2., 2.);
135 
136  //RecHit X distribution for half modules for barrel
137  recHitXHalfModules = ibooker.book1D("RecHit_x_HalfModules", "RecHit X distribution for half modules", 100, -1., 1.);
138 
139  //RecHit Y distribution all modules for barrel
140  recHitYAllModules = ibooker.book1D("RecHit_y_AllModules", "RecHit Y distribution for all modules", 100, -4., 4.);
141 
142  //RecHit X resolution for flipped and unflipped ladders by layer for barrel
143  for (int i = 0; i < 3; i++) {
144  //RecHit no. of matched simHits all ladders by layer
145  sprintf(histo, "RecHit_NsimHit_Layer%d", i + 1);
146  recHitNsimHitLayer[i] = ibooker.book1D(histo, "RecHit Number of simHits by Layer", 30, 0., 30.);
147 
148  //RecHit X resolution for flipped ladders by layer
149  sprintf(histo, "RecHit_XRes_FlippedLadder_Layer%d", i + 1);
150  recHitXResFlippedLadderLayers[i] = ibooker.book1D(histo, "RecHit XRes Flipped Ladders by Layer", 100, -200., 200.);
151 
152  //RecHit X resolution for unflipped ladders by layer
153  sprintf(histo, "RecHit_XRes_UnFlippedLadder_Layer%d", i + 1);
155  ibooker.book1D(histo, "RecHit XRes NonFlipped Ladders by Layer", 100, -200., 200.);
156  } // end for
157 
158  //RecHit Y resolutions for layers by module for barrel
159  for (int i = 0; i < 8; i++) {
160  //Rec Hit Y resolution by module for Layer1
161  sprintf(histo, "RecHit_YRes_Layer1_Module%d", i + 1);
162  recHitYResLayer1Modules[i] = ibooker.book1D(histo, "RecHit YRes Layer1 by module", 100, -200., 200.);
163 
164  //RecHit Y resolution by module for Layer2
165  sprintf(histo, "RecHit_YRes_Layer2_Module%d", i + 1);
166  recHitYResLayer2Modules[i] = ibooker.book1D(histo, "RecHit YRes Layer2 by module", 100, -200., 200.);
167 
168  //RecHit Y resolution by module for Layer3
169  sprintf(histo, "RecHit_YRes_Layer3_Module%d", i + 1);
170  recHitYResLayer3Modules[i] = ibooker.book1D(histo, "RecHit YRes Layer3 by module", 100, -200., 200.);
171  } // end for
172 
173  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/recHitFPIX");
174  //RecHit Bunch crossing all plaquettes
175  recHitBunchF = ibooker.book1D("RecHit_Bunch_Forward", "RecHit Bunch Crossing, Forward", 20, -10., 10.);
176 
177  //RecHit Event, in-time bunch, all plaquettes
178  recHitEventF = ibooker.book1D("RecHit_Event_Forward", "RecHit Event (in-time bunch), Forward", 100, 0., 100.);
179 
180  //RecHit No. of simHits, by disk
181  recHitNsimHitDisk1 = ibooker.book1D("RecHit_NsimHit_Disk1", "RecHit Number of simHits, Disk1", 30, 0., 30.);
182  recHitNsimHitDisk2 = ibooker.book1D("RecHit_NsimHit_Disk2", "RecHit Number of simHits, Disk2", 30, 0., 30.);
183 
184  //RecHit X resolution all plaquettes
185  recHitXResAllF = ibooker.book1D("RecHit_xres_f_All", "RecHit X Res All in Forward", 100, -200., 200.);
186 
187  //RecHit Y resolution all plaquettes
188  recHitYResAllF = ibooker.book1D("RecHit_yres_f_All", "RecHit Y Res All in Forward", 100, -200., 200.);
189 
190  //RecHit X distribution for plaquette with x-size 1 in forward
192  ibooker.book1D("RecHit_x_Plaquette_xsize1", "RecHit X Distribution for plaquette x-size1", 100, -2., 2.);
193 
194  //RecHit X distribution for plaquette with x-size 2 in forward
196  ibooker.book1D("RecHit_x_Plaquette_xsize2", "RecHit X Distribution for plaquette x-size2", 100, -2., 2.);
197 
198  //RecHit Y distribution for plaquette with y-size 2 in forward
200  ibooker.book1D("RecHit_y_Plaquette_ysize2", "RecHit Y Distribution for plaquette y-size2", 100, -4., 4.);
201 
202  //RecHit Y distribution for plaquette with y-size 3 in forward
204  ibooker.book1D("RecHit_y_Plaquette_ysize3", "RecHit Y Distribution for plaquette y-size3", 100, -4., 4.);
205 
206  //RecHit Y distribution for plaquette with y-size 4 in forward
208  ibooker.book1D("RecHit_y_Plaquette_ysize4", "RecHit Y Distribution for plaquette y-size4", 100, -4., 4.);
209 
210  //RecHit Y distribution for plaquette with y-size 5 in forward
212  ibooker.book1D("RecHit_y_Plaquette_ysize5", "RecHit Y Distribution for plaquette y-size5", 100, -4., 4.);
213 
214  //X and Y resolutions for both disks by plaquette in forward
215  for (int i = 0; i < 7; i++) {
216  //X resolution for Disk1 by plaquette
217  sprintf(histo, "RecHit_XRes_Disk1_Plaquette%d", i + 1);
218  recHitXResDisk1Plaquettes[i] = ibooker.book1D(histo, "RecHit XRes Disk1 by plaquette", 100, -200., 200.);
219  //X resolution for Disk2 by plaquette
220  sprintf(histo, "RecHit_XRes_Disk2_Plaquette%d", i + 1);
221  recHitXResDisk2Plaquettes[i] = ibooker.book1D(histo, "RecHit XRes Disk2 by plaquette", 100, -200., 200.);
222 
223  //Y resolution for Disk1 by plaquette
224  sprintf(histo, "RecHit_YRes_Disk1_Plaquette%d", i + 1);
225  recHitYResDisk1Plaquettes[i] = ibooker.book1D(histo, "RecHit YRes Disk1 by plaquette", 100, -200., 200.);
226  //Y resolution for Disk2 by plaquette
227  sprintf(histo, "RecHit_YRes_Disk2_Plaquette%d", i + 1);
228  recHitYResDisk2Plaquettes[i] = ibooker.book1D(histo, "RecHit YRes Disk2 by plaquette", 100, -200., 200.);
229  }
230 
231  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsBPIX");
232  recHitXPullAllB = ibooker.book1D("RecHit_xres_b_All", "RecHit X Pull All Modules in Barrel", 100, -10.0, 10.0);
233  recHitYPullAllB = ibooker.book1D("RecHit_yres_b_All", "RecHit Y Pull All Modules in Barrel", 100, -10.0, 10.0);
234 
235  for (int i = 0; i < 3; i++) {
236  sprintf(histo, "RecHit_XPull_FlippedLadder_Layer%d", i + 1);
238  ibooker.book1D(histo, "RecHit XPull Flipped Ladders by Layer", 100, -10.0, 10.0);
239 
240  sprintf(histo, "RecHit_XPull_UnFlippedLadder_Layer%d", i + 1);
242  ibooker.book1D(histo, "RecHit XPull NonFlipped Ladders by Layer", 100, -10.0, 10.0);
243  }
244 
245  for (int i = 0; i < 8; i++) {
246  sprintf(histo, "RecHit_YPull_Layer1_Module%d", i + 1);
247  recHitYPullLayer1Modules[i] = ibooker.book1D(histo, "RecHit YPull Layer1 by module", 100, -10.0, 10.0);
248 
249  sprintf(histo, "RecHit_YPull_Layer2_Module%d", i + 1);
250  recHitYPullLayer2Modules[i] = ibooker.book1D(histo, "RecHit YPull Layer2 by module", 100, -10.0, 10.0);
251 
252  sprintf(histo, "RecHit_YPull_Layer3_Module%d", i + 1);
253  recHitYPullLayer3Modules[i] = ibooker.book1D(histo, "RecHit YPull Layer3 by module", 100, -10.0, 10.0);
254  }
255 
256  ibooker.setCurrentFolder("TrackerRecHitsV/TrackerRecHits/Pixel/recHitPullsFPIX");
257  recHitXPullAllF = ibooker.book1D("RecHit_XPull_f_All", "RecHit X Pull All in Forward", 100, -10.0, 10.0);
258 
259  recHitYPullAllF = ibooker.book1D("RecHit_YPull_f_All", "RecHit Y Pull All in Forward", 100, -10.0, 10.0);
260 
261  for (int i = 0; i < 7; i++) {
262  sprintf(histo, "RecHit_XPull_Disk1_Plaquette%d", i + 1);
263  recHitXPullDisk1Plaquettes[i] = ibooker.book1D(histo, "RecHit XPull Disk1 by plaquette", 100, -10.0, 10.0);
264  sprintf(histo, "RecHit_XPull_Disk2_Plaquette%d", i + 1);
265  recHitXPullDisk2Plaquettes[i] = ibooker.book1D(histo, "RecHit XPull Disk2 by plaquette", 100, -10.0, 10.0);
266 
267  sprintf(histo, "RecHit_YPull_Disk1_Plaquette%d", i + 1);
268  recHitYPullDisk1Plaquettes[i] = ibooker.book1D(histo, "RecHit YPull Disk1 by plaquette", 100, -10.0, 10.0);
269 
270  sprintf(histo, "RecHit_YPull_Disk2_Plaquette%d", i + 1);
271  recHitYPullDisk2Plaquettes[i] = ibooker.book1D(histo, "RecHit YPull Disk2 by plaquette", 100, -10.0, 10.0);
272  }
273 }
274 
276  //Retrieve tracker topology from geometry
277  const TrackerTopology* tTopo = &es.getData(tTopoEsToken);
278 
279  edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
280  if (e.id().event() % 1000 == 0)
281  std::cout << " Run = " << e.id().run() << " Event = " << e.id().event() << std::endl;
282 
283  //Get RecHits
286 
287  //Get event setup
288  const TrackerGeometry* theTracker = &es.getData(tGeomEsToken);
289 
291 
292  //iterate over detunits
293  //for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin(); it != geom->dets().end(); it++) {
294  for (const auto& it : theTracker->dets()) {
295  DetId detId = it->geographicalId();
296  unsigned int subid = detId.subdetId();
297 
298  if (!((subid == 1) || (subid == 2)))
299  continue;
300 
301  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker->idToDet(detId));
302 
303  SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId);
304  if (pixeldet == recHitColl->end())
305  continue;
306  SiPixelRecHitCollection::DetSet pixelrechitRange = *pixeldet;
307  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin();
308  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end();
309  SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin;
310  std::vector<PSimHit> matched;
311 
312  //----Loop over rechits for this detId
313  for (; pixeliter != pixelrechitRangeIteratorEnd; pixeliter++) {
314  matched.clear();
315  matched = associate.associateHit(*pixeliter);
316 
317  if (!matched.empty()) {
318  float closest = 9999.9;
319  std::vector<PSimHit>::const_iterator closestit = matched.begin();
320  LocalPoint lp = pixeliter->localPosition();
321  float rechit_x = lp.x();
322  float rechit_y = lp.y();
323 
324  //loop over sim hits and fill closet
325  for (std::vector<PSimHit>::const_iterator m = matched.begin(); m < matched.end(); m++) {
326  float sim_x1 = (*m).entryPoint().x();
327  float sim_x2 = (*m).exitPoint().x();
328  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
329 
330  float sim_y1 = (*m).entryPoint().y();
331  float sim_y2 = (*m).exitPoint().y();
332  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
333 
334  float x_res = fabs(sim_xpos - rechit_x);
335  float y_res = fabs(sim_ypos - rechit_y);
336 
337  float dist = sqrt(x_res * x_res + y_res * y_res);
338 
339  if (dist < closest) {
340  closest = dist;
341  closestit = m;
342  }
343  } // end sim hit loop
344 
345  if (subid == 1) { //<----------barrel
346  fillBarrel(*pixeliter, *closestit, detId, theGeomDet, tTopo);
347  } // end barrel
348  if (subid == 2) { // <-------forward
349  fillForward(*pixeliter, *closestit, detId, theGeomDet, tTopo);
350  }
351 
352  } // end matched emtpy
353 
354  int NsimHit = matched.size();
355  if (subid == 1) { //<----------barrel
356  for (unsigned int i = 0; i < 3; i++)
357  if (tTopo->pxbLayer(detId) == i + 1)
358  recHitNsimHitLayer[i]->Fill(NsimHit);
359  } // end barrel
360  if (subid == 2) { // <-------forward
361  if (tTopo->pxfDisk(detId) == 1)
362  recHitNsimHitDisk1->Fill(NsimHit);
363  else
364  recHitNsimHitDisk2->Fill(NsimHit);
365  }
366  } // <-----end rechit loop
367  } // <------ end detunit loop
368 }
369 
371  const PSimHit& simHit,
372  DetId detId,
373  const PixelGeomDetUnit* theGeomDet,
374  const TrackerTopology* tTopo) {
375  const float cmtomicron = 10000.0;
376 
377  int bunch = simHit.eventId().bunchCrossing();
378  int event = simHit.eventId().event();
379 
380  recHitBunchB->Fill(bunch);
381  if (bunch == 0)
383 
384  LocalPoint lp = recHit.localPosition();
385  float lp_y = lp.y();
386  float lp_x = lp.x();
387 
388  LocalError lerr = recHit.localPositionError();
389  float lerr_x = sqrt(lerr.xx());
390  float lerr_y = sqrt(lerr.yy());
391 
392  recHitYAllModules->Fill(lp_y);
393 
394  float sim_x1 = simHit.entryPoint().x();
395  float sim_x2 = simHit.exitPoint().x();
396  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
397  float res_x = (lp.x() - sim_xpos) * cmtomicron;
398 
399  recHitXResAllB->Fill(res_x);
400 
401  float sim_y1 = simHit.entryPoint().y();
402  float sim_y2 = simHit.exitPoint().y();
403  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
404  float res_y = (lp.y() - sim_ypos) * cmtomicron;
405 
406  recHitYResAllB->Fill(res_y);
407 
408  float pull_x = (lp_x - sim_xpos) / lerr_x;
409  float pull_y = (lp_y - sim_ypos) / lerr_y;
410 
411  recHitXPullAllB->Fill(pull_x);
412  recHitYPullAllB->Fill(pull_y);
413 
414  int rows = theGeomDet->specificTopology().nrows();
415 
416  if (rows == 160) {
417  recHitXFullModules->Fill(lp_x);
418  } else if (rows == 80) {
419  recHitXHalfModules->Fill(lp_x);
420  }
421 
422  float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 0.)).perp();
423  float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 1.)).perp();
424 
425  if (tmp2 < tmp1) { // flipped
426  for (unsigned int i = 0; i < 3; i++) {
427  if (tTopo->pxbLayer(detId) == i + 1) {
430  }
431  }
432  } else {
433  for (unsigned int i = 0; i < 3; i++) {
434  if (tTopo->pxbLayer(detId) == i + 1) {
437  }
438  }
439  }
440 
441  //get cluster
442  SiPixelRecHit::ClusterRef const& clust = recHit.cluster();
443 
444  // fill module dependent info
445  for (unsigned int i = 0; i < 8; i++) {
446  if (tTopo->pxbModule(detId) == i + 1) {
447  int sizeY = (*clust).sizeY();
448  clustYSizeModule[i]->Fill(sizeY);
449 
450  if (tTopo->pxbLayer(detId) == 1) {
451  float charge = (*clust).charge();
452  clustChargeLayer1Modules[i]->Fill(charge);
453  recHitYResLayer1Modules[i]->Fill(res_y);
454  recHitYPullLayer1Modules[i]->Fill(pull_y);
455  } else if (tTopo->pxbLayer(detId) == 2) {
456  float charge = (*clust).charge();
457  clustChargeLayer2Modules[i]->Fill(charge);
458  recHitYResLayer2Modules[i]->Fill(res_y);
459  recHitYPullLayer2Modules[i]->Fill(pull_y);
460  } else if (tTopo->pxbLayer(detId) == 3) {
461  float charge = (*clust).charge();
462  clustChargeLayer3Modules[i]->Fill(charge);
463  recHitYResLayer3Modules[i]->Fill(res_y);
464  recHitYPullLayer3Modules[i]->Fill(pull_y);
465  }
466  }
467  }
468  int sizeX = (*clust).sizeX();
469  if (tTopo->pxbLayer(detId) == 1)
470  clustXSizeLayer[0]->Fill(sizeX);
471  if (tTopo->pxbLayer(detId) == 2)
472  clustXSizeLayer[1]->Fill(sizeX);
473  if (tTopo->pxbLayer(detId) == 3)
474  clustXSizeLayer[2]->Fill(sizeX);
475 }
476 
478  const PSimHit& simHit,
479  DetId detId,
480  const PixelGeomDetUnit* theGeomDet,
481  const TrackerTopology* tTopo) {
482  int rows = theGeomDet->specificTopology().nrows();
483  int cols = theGeomDet->specificTopology().ncolumns();
484 
485  const float cmtomicron = 10000.0;
486 
487  int bunch = simHit.eventId().bunchCrossing();
488  int event = simHit.eventId().event();
489 
490  recHitBunchF->Fill(bunch);
491  if (bunch == 0)
493 
494  LocalPoint lp = recHit.localPosition();
495  float lp_x = lp.x();
496  float lp_y = lp.y();
497 
498  LocalError lerr = recHit.localPositionError();
499  float lerr_x = sqrt(lerr.xx());
500  float lerr_y = sqrt(lerr.yy());
501 
502  float sim_x1 = simHit.entryPoint().x();
503  float sim_x2 = simHit.exitPoint().x();
504  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
505 
506  float sim_y1 = simHit.entryPoint().y();
507  float sim_y2 = simHit.exitPoint().y();
508  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
509 
510  float pull_x = (lp_x - sim_xpos) / lerr_x;
511  float pull_y = (lp_y - sim_ypos) / lerr_y;
512 
513  if (rows == 80) {
515  } else if (rows == 160) {
517  }
518 
519  if (cols == 104) {
521  } else if (cols == 156) {
523  } else if (cols == 208) {
525  } else if (cols == 260) {
527  }
528 
529  float res_x = (lp.x() - sim_xpos) * cmtomicron;
530 
531  recHitXResAllF->Fill(res_x);
532  recHitXPullAllF->Fill(pull_x);
533 
534  float res_y = (lp.y() - sim_ypos) * cmtomicron;
535 
536  recHitYPullAllF->Fill(pull_y);
537 
538  // get cluster
539  SiPixelRecHit::ClusterRef const& clust = recHit.cluster();
540 
541  // fill plaquette dependent info
542  for (unsigned int i = 0; i < 7; i++) {
543  if (tTopo->pxfModule(detId) == i + 1) {
544  if (tTopo->pxfDisk(detId) == 1) {
545  int sizeX = (*clust).sizeX();
547 
548  int sizeY = (*clust).sizeY();
550 
551  float charge = (*clust).charge();
553 
556 
559  } else {
560  int sizeX = (*clust).sizeX();
562 
563  int sizeY = (*clust).sizeY();
565 
566  float charge = (*clust).charge();
568 
571 
574 
575  } // end else
576  } // end if module
577  else if (tTopo->pxfPanel(detId) == 2 && (tTopo->pxfModule(detId) + 4) == i + 1) {
578  if (tTopo->pxfDisk(detId) == 1) {
579  int sizeX = (*clust).sizeX();
581 
582  int sizeY = (*clust).sizeY();
584 
585  float charge = (*clust).charge();
587 
590 
593  } else {
594  int sizeX = (*clust).sizeX();
596 
597  int sizeY = (*clust).sizeY();
599 
600  float charge = (*clust).charge();
602 
605 
608 
609  } // end else
610  } // end else
611  } // end for
612 }
RunNumber_t run() const
Definition: EventID.h:38
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
EventNumber_t event() const
Definition: EventID.h:40
MonitorElement * clustYSizeModule[8]
MonitorElement * clustXSizeDisk1Plaquettes[7]
float xx() const
Definition: LocalError.h:22
MonitorElement * recHitNsimHitDisk1
MonitorElement * recHitXPullDisk2Plaquettes[7]
MonitorElement * recHitXResFlippedLadderLayers[3]
int event() const
get the contents of the subdetector field (should be protected?)
MonitorElement * recHitXFullModules
MonitorElement * recHitXResAllF
T perp() const
Definition: PV3DBase.h:69
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomEsToken
MonitorElement * recHitXHalfModules
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual int ncolumns() const =0
MonitorElement * recHitYPullAllF
const float cmtomicron
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * recHitXResDisk1Plaquettes[7]
MonitorElement * recHitEventF
MonitorElement * clustXSizeDisk2Plaquettes[7]
MonitorElement * recHitYResAllB
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned int pxfDisk(const DetId &id) const
MonitorElement * recHitYPullDisk2Plaquettes[7]
MonitorElement * recHitNsimHitLayer[3]
MonitorElement * clustXSizeLayer[3]
T y() const
Definition: PV3DBase.h:60
MonitorElement * clustChargeLayer1Modules[8]
virtual int nrows() const =0
MonitorElement * recHitYPlaquetteSize5
unsigned int pxbModule(const DetId &id) const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
MonitorElement * recHitEventB
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * recHitXPlaquetteSize1
MonitorElement * recHitXResDisk2Plaquettes[7]
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override
MonitorElement * recHitXPullNonFlippedLadderLayers[3]
MonitorElement * recHitYPullDisk1Plaquettes[7]
MonitorElement * recHitXPullAllB
MonitorElement * recHitXResAllB
void Fill(long long x)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
MonitorElement * recHitBunchB
MonitorElement * clustChargeLayer2Modules[8]
TrackerHitAssociator::Config trackerHitAssociatorConfig_
MonitorElement * recHitYResDisk2Plaquettes[7]
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
MonitorElement * recHitXResNonFlippedLadderLayers[3]
MonitorElement * recHitYResDisk1Plaquettes[7]
MonitorElement * recHitYResLayer2Modules[8]
MonitorElement * recHitYPlaquetteSize2
float yy() const
Definition: LocalError.h:24
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:19
int bunchCrossing() const
get the detector field from this detid
MonitorElement * recHitYPullLayer3Modules[8]
edm::EDGetTokenT< SiPixelRecHitCollection > siPixelRecHitCollectionToken_
MonitorElement * clustYSizeDisk1Plaquettes[7]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
MonitorElement * recHitBunchF
void fillForward(const SiPixelRecHit &, const PSimHit &, DetId, const PixelGeomDetUnit *, const TrackerTopology *tTopo)
EncodedEventId eventId() const
Definition: PSimHit.h:108
const TrackerGeomDet * idToDet(DetId) const override
unsigned int pxfModule(const DetId &id) const
MonitorElement * recHitXPlaquetteSize2
unsigned int pxbLayer(const DetId &id) const
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoEsToken
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
LocalError localPositionError() const override
MonitorElement * clustChargeLayer3Modules[8]
Definition: DetId.h:17
MonitorElement * recHitYResAllF
MonitorElement * recHitYResLayer3Modules[8]
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * recHitYPullLayer2Modules[8]
MonitorElement * clustYSizeDisk2Plaquettes[7]
edm::EventID id() const
Definition: EventBase.h:59
MonitorElement * recHitYPlaquetteSize4
iterator end()
Definition: DetSetNew.h:56
MonitorElement * recHitXPullFlippedLadderLayers[3]
MonitorElement * recHitNsimHitDisk2
LocalPoint localPosition() const override
MonitorElement * recHitYResLayer1Modules[8]
MonitorElement * recHitYPullLayer1Modules[8]
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
tuple cout
Definition: gather_cfg.py:144
MonitorElement * recHitXPullDisk1Plaquettes[7]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SiPixelRecHitsValid(const edm::ParameterSet &conf)
MonitorElement * recHitYPullAllB
T x() const
Definition: PV3DBase.h:59
MonitorElement * recHitXPullAllF
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
MonitorElement * recHitYPlaquetteSize3
MonitorElement * clustChargeDisk1Plaquettes[7]
unsigned int pxfPanel(const DetId &id) const
MonitorElement * clustChargeDisk2Plaquettes[7]
void fillBarrel(const SiPixelRecHit &, const PSimHit &, DetId, const PixelGeomDetUnit *, const TrackerTopology *tTopo)
Definition: Run.h:45
Our base class.
Definition: SiPixelRecHit.h:23
MonitorElement * recHitYAllModules
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
iterator begin()
Definition: DetSetNew.h:54