CMS 3D CMS Logo

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