CMS 3D CMS Logo

SiPixelPhase1TrackEfficiency.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1TrackEfficiency
4 // Class: SiPixelPhase1TrackEfficiency
5 //
6 
7 // Original Author: Marcel Schneider
8 
14 
30 
38 
40 
41 namespace {
42 
43  class SiPixelPhase1TrackEfficiency final : public SiPixelPhase1Base {
44  enum { VALID, MISSING, INACTIVE, EFFICIENCY, VERTICES };
45 
46  public:
47  explicit SiPixelPhase1TrackEfficiency(const edm::ParameterSet& conf);
48  void analyze(const edm::Event&, const edm::EventSetup&) override;
49 
50  private:
54  edm::EDGetTokenT<TrajTrackAssociationCollection> trajTrackCollectionToken_;
56  bool applyVertexCut_;
57 
63  edm::ESGetToken<PixelClusterParameterEstimator, TkPixelCPERecord> pixelClusterParameterEstimatorToken_;
64 
65  const TrackerTopology* trackerTopology_;
66  const Propagator* trackerPropagator_;
67  const MeasurementEstimator* chi2MeasurementEstimator_;
68  };
69 
70  SiPixelPhase1TrackEfficiency::SiPixelPhase1TrackEfficiency(const edm::ParameterSet& iConfig)
71  : SiPixelPhase1Base(iConfig) //,
72  {
73  tracker_ = consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("tracker"));
74  tracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
75  vtxToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryvertices"));
76  applyVertexCut_ = iConfig.getUntrackedParameter<bool>("VertexCut", true);
77  trajTrackCollectionToken_ =
78  consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajectoryInput"));
79  clustersToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("clusters"));
80 
81  trackerTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
82  trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
83  propagatorToken_ = esConsumes<Propagator, TrackingComponentsRecord>(edm::ESInputTag("", "PropagatorWithMaterial"));
84  chi2MeasurementEstimatorBaseToken_ =
85  esConsumes<Chi2MeasurementEstimatorBase, TrackingComponentsRecord>(edm::ESInputTag("", "Chi2"));
86  measurementTrackerToken_ = esConsumes<MeasurementTracker, CkfComponentsRecord>();
87  pixelClusterParameterEstimatorToken_ =
88  esConsumes<PixelClusterParameterEstimator, TkPixelCPERecord>(edm::ESInputTag("", "PixelCPEGeneric"));
89  }
90 
92  if (!checktrigger(iEvent, iSetup, DCS))
93  return;
94 
95  // get geometry
96  edm::ESHandle<TrackerGeometry> tracker = iSetup.getHandle(trackerGeomToken_);
97  assert(tracker.isValid());
98 
99  // get primary vertex
101  iEvent.getByToken(vtxToken_, vertices);
102 
103  // TrackerTopology for module informations
104  edm::ESHandle<TrackerTopology> trackerTopologyHandle = iSetup.getHandle(trackerTopoToken_);
105  trackerTopology_ = trackerTopologyHandle.product();
106 
107  // Tracker propagator for propagating tracks to other layers
108  edm::ESHandle<Propagator> propagatorHandle = iSetup.getHandle(propagatorToken_);
109  std::unique_ptr<Propagator> propagatorUniquePtr(propagatorHandle.product()->clone());
110  trackerPropagator_ = propagatorUniquePtr.get();
111  const_cast<Propagator*>(trackerPropagator_)->setPropagationDirection(oppositeToMomentum);
112 
113  // Measurement estimator
114  edm::ESHandle<Chi2MeasurementEstimatorBase> chi2MeasurementEstimatorHandle =
115  iSetup.getHandle(chi2MeasurementEstimatorBaseToken_);
116  chi2MeasurementEstimator_ = chi2MeasurementEstimatorHandle.product();
117 
118  //Tracker
120  iEvent.getByToken(tracker_, trackerMeas);
121 
122  edm::ESHandle<MeasurementTracker> measurementTrackerHandle = iSetup.getHandle(measurementTrackerToken_);
123 
124  //vertices
125  if (!vertices.isValid())
126  return;
127  histo[VERTICES].fill(vertices->size(), DetId(0), &iEvent);
128  if (applyVertexCut_ && vertices->empty())
129  return;
130 
131  // should be used for weird cuts
132  //const auto primaryVertex = vertices->at(0);
133 
134  // get the map
136  iEvent.getByToken(tracksToken_, tracks);
137  if (!tracks.isValid())
138  return;
139 
140  //new
141  edm::Handle<TrajTrackAssociationCollection> trajTrackCollectionHandle;
142  iEvent.getByToken(trajTrackCollectionToken_, trajTrackCollectionHandle);
143  if (!trajTrackCollectionHandle.isValid())
144  return;
145 
146  //Access Pixel Clusters
148  iEvent.getByToken(clustersToken_, siPixelClusters);
149  if (!siPixelClusters.isValid())
150  return;
151  //
152 
153  edm::ESHandle<PixelClusterParameterEstimator> cpEstimator = iSetup.getHandle(pixelClusterParameterEstimatorToken_);
154  if (!cpEstimator.isValid())
155  return;
156 
157  const PixelClusterParameterEstimator& cpe(*cpEstimator);
158  const TrackerGeometry* tkgeom = &(*tracker);
159 
161 
162  // Hp cut
163  int TRACK_QUALITY_HIGH_PURITY_BIT = 2;
164  int TRACK_QUALITY_HIGH_PURITY_MASK = 1 << TRACK_QUALITY_HIGH_PURITY_BIT;
165 
166  // Pt cut
167  float TRACK_PT_CUT_VAL = 1.0f;
168 
169  // Nstrip cut
170  int TRACK_NSTRIP_CUT_VAL = 10;
171 
172  //D0
173  std::array<float, 4> TRACK_D0_CUT_BARREL_VAL = {{0.01f, 0.02f, 0.02f, 0.02f}};
174  float TRACK_D0_CUT_FORWARD_VAL = 0.05f;
175 
176  //Dz
177  float TRACK_DZ_CUT_BARREL_VAL = 0.01f;
178  float TRACK_DZ_CUT_FORWARD_VAL = 0.5f;
179 
180  bool isBpixtrack = false, isFpixtrack = false;
181  int nStripHits = 0;
182  int nBpixL1Hits = 0;
183  int nBpixL2Hits = 0;
184  int nBpixL3Hits = 0;
185  int nBpixL4Hits = 0;
186  int nFpixD1Hits = 0;
187  int nFpixD2Hits = 0;
188  int nFpixD3Hits = 0;
189  bool passcuts = true;
190  bool passcuts_hit = true;
191 
192  TrajectoryStateOnSurface tsosPXB2;
193  bool valid_layerFrom = false;
194 
195  const GeometricSearchTracker* gst_ = trackerMeas->geometricSearchTracker();
196  const auto* pxbLayer1_ = gst_->pixelBarrelLayers().front();
197  const LayerMeasurements* theLayerMeasurements_ = new LayerMeasurements(*measurementTrackerHandle, *trackerMeas);
198 
199  std::vector<TrajectoryMeasurement> expTrajMeasurements;
200  std::vector<std::pair<int, bool[3]>> eff_pxb1_vector;
201 
202  for (const auto& pair : *trajTrackCollectionHandle) {
203  const edm::Ref<std::vector<Trajectory>> traj = pair.key;
204  const reco::TrackRef track = pair.val;
205 
206  expTrajMeasurements.clear();
207  eff_pxb1_vector.clear();
208  //this cut is needed to be consisten with residuals calculation
209  if (applyVertexCut_ &&
210  (track->pt() < 0.75 || std::abs(track->dxy(vertices->at(0).position())) > 5 * track->dxyError()))
211  continue;
212 
213  isBpixtrack = false, isFpixtrack = false;
214  nStripHits = 0;
215  nBpixL1Hits = 0;
216  nBpixL2Hits = 0;
217  nBpixL3Hits = 0;
218  nBpixL4Hits = 0;
219  nFpixD1Hits = 0;
220  nFpixD2Hits = 0;
221  nFpixD3Hits = 0;
222  passcuts = true;
223  passcuts_hit = true;
224 
225  // first, look at the full track to see whether it is good
226  // auto const & trajParams = track.extra()->trajParams();
227 
228  auto hb = track->recHitsBegin();
229  for (unsigned int h = 0; h < track->recHitsSize(); h++) {
230  auto hit = *(hb + h);
231  if (!hit->isValid())
232  continue;
233 
234  DetId id = hit->geographicalId();
235  uint32_t subdetid = (id.subdetId());
236 
237  //Check the location of valid hit
238  if (subdetid == PixelSubdetector::PixelBarrel && hit->isValid()) {
239  isBpixtrack = true;
240  if (trackerTopology_->pxbLayer(id) == 1)
241  nBpixL1Hits++;
242  if (trackerTopology_->pxbLayer(id) == 2)
243  nBpixL2Hits++;
244  if (trackerTopology_->pxbLayer(id) == 3)
245  nBpixL3Hits++;
246  if (trackerTopology_->pxbLayer(id) == 4)
247  nBpixL4Hits++;
248  }
249  if (subdetid == PixelSubdetector::PixelEndcap && hit->isValid()) {
250  isFpixtrack = true;
251  if (trackerTopology_->pxfDisk(id) == 1)
252  nFpixD1Hits++;
253  if (trackerTopology_->pxfDisk(id) == 2)
254  nFpixD2Hits++;
255  if (trackerTopology_->pxfDisk(id) == 3)
256  nFpixD3Hits++;
257  }
258 
259  // count strip hits
260  if (subdetid == StripSubdetector::TIB)
261  nStripHits++;
262  if (subdetid == StripSubdetector::TOB)
263  nStripHits++;
264  if (subdetid == StripSubdetector::TID)
265  nStripHits++;
266  if (subdetid == StripSubdetector::TEC)
267  nStripHits++;
268 
269  // check that we are in the pixel
270  // if (subdetid == PixelSubdetector::PixelBarrel) isBpixtrack = true;
271  // if (subdetid == PixelSubdetector::PixelEndcap) isFpixtrack = true;
272  }
273 
274  if (!isBpixtrack && !isFpixtrack)
275  continue;
276 
277  // Hp cut
278  if (!((track->qualityMask() & TRACK_QUALITY_HIGH_PURITY_MASK) >> TRACK_QUALITY_HIGH_PURITY_BIT))
279  passcuts = false;
280 
281  // Pt cut
282  if (!(TRACK_PT_CUT_VAL < track->pt()))
283  passcuts = false;
284 
285  // Nstrip cut
286  if (!(TRACK_NSTRIP_CUT_VAL < nStripHits))
287  passcuts = false;
288 
289  // then, look at each hit
290  for (unsigned int h = 0; h < track->recHitsSize(); h++) {
291  passcuts_hit = true;
292  auto hit = *(hb + h);
293 
294  DetId id = hit->geographicalId();
295  uint32_t subdetid = (id.subdetId());
296  if (subdetid != PixelSubdetector::PixelBarrel && subdetid != PixelSubdetector::PixelEndcap)
297  continue;
298 
299  bool isHitValid = hit->getType() == TrackingRecHit::valid;
300  bool isHitMissing = hit->getType() == TrackingRecHit::missing;
301  bool isHitInactive = hit->getType() == TrackingRecHit::inactive;
302 
303  //D0
304  if (subdetid == PixelSubdetector::PixelBarrel) {
305  if (!((std::abs(track->dxy(vertices->at(0).position())) * -1.0) <
306  TRACK_D0_CUT_BARREL_VAL[trackerTopology_->pxbLayer(id) - 1]))
307  passcuts_hit = false;
308  }
309  if (subdetid == PixelSubdetector::PixelEndcap) {
310  if (!((std::abs(track->dxy(vertices->at(0).position())) * -1.0) < TRACK_D0_CUT_FORWARD_VAL))
311  passcuts_hit = false;
312  }
313 
314  //Dz
315  if (subdetid == PixelSubdetector::PixelBarrel) {
316  if (!(std::abs(track->dz(vertices->at(0).position())) < TRACK_DZ_CUT_BARREL_VAL))
317  passcuts_hit = false;
318  }
319  if (subdetid == PixelSubdetector::PixelEndcap) {
320  if (!(std::abs(track->dz(vertices->at(0).position())) < TRACK_DZ_CUT_FORWARD_VAL))
321  passcuts_hit = false;
322  }
323 
324  // Pixhit cut
325  if (subdetid == PixelSubdetector::PixelBarrel) {
326  if (trackerTopology_->pxbLayer(id) == 1)
327  if (!((nBpixL2Hits > 0 && nBpixL3Hits > 0 && nBpixL4Hits > 0) ||
328  (nBpixL2Hits > 0 && nBpixL3Hits > 0 && nFpixD1Hits > 0) ||
329  (nBpixL2Hits > 0 && nFpixD1Hits > 0 && nFpixD2Hits > 0) ||
330  (nFpixD1Hits > 0 && nFpixD2Hits > 0 && nFpixD3Hits > 0)))
331  passcuts_hit = false;
332  if (trackerTopology_->pxbLayer(id) == 2)
333  if (!((nBpixL1Hits > 0 && nBpixL3Hits > 0 && nBpixL4Hits > 0) ||
334  (nBpixL1Hits > 0 && nBpixL3Hits > 0 && nFpixD1Hits > 0) ||
335  (nBpixL1Hits > 0 && nFpixD1Hits > 0 && nFpixD2Hits > 0)))
336  passcuts_hit = false;
337  if (trackerTopology_->pxbLayer(id) == 3)
338  if (!((nBpixL1Hits > 0 && nBpixL2Hits > 0 && nBpixL4Hits > 0) ||
339  (nBpixL1Hits > 0 && nBpixL2Hits > 0 && nFpixD1Hits > 0)))
340  passcuts_hit = false;
341  if (trackerTopology_->pxbLayer(id) == 4)
342  if (!((nBpixL1Hits > 0 && nBpixL2Hits > 0 && nBpixL3Hits > 0)))
343  passcuts_hit = false;
344  }
345  if (subdetid == PixelSubdetector::PixelEndcap) {
346  if (trackerTopology_->pxfDisk(id) == 1)
347  if (!((nBpixL1Hits > 0 && nBpixL2Hits > 0 && nBpixL3Hits > 0) ||
348  (nBpixL1Hits > 0 && nBpixL2Hits > 0 && nFpixD2Hits > 0) ||
349  (nBpixL1Hits > 0 && nFpixD2Hits > 0 && nFpixD3Hits > 0)))
350  passcuts_hit = false;
351  if (trackerTopology_->pxfDisk(id) == 2)
352  if (!((nBpixL1Hits > 0 && nBpixL2Hits > 0 && nFpixD1Hits > 0) ||
353  (nBpixL1Hits > 0 && nFpixD1Hits > 0 && nFpixD3Hits > 0)))
354  passcuts_hit = false;
355  if (trackerTopology_->pxfDisk(id) == 3)
356  if (!((nBpixL1Hits > 0 && nFpixD1Hits > 0 && nFpixD2Hits > 0)))
357  passcuts_hit = false;
358  }
359  /*
360  //Fiducial Cut - will work on it later
361  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(hit);
362  const PixelGeomDetUnit* geomdetunit = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
363  const PixelTopology& topol = geomdetunit->specificTopology();
364 
365  LocalPoint lp;
366  if (pixhit) {
367  lp = pixhit->localPosition();
368  }
369 
370  MeasurementPoint mp = topol.measurementPosition(lp);
371  int row = (int) mp.x() % 80;
372  int col = (int) mp.y() % 52;
373 
374  int centerrow = 40;
375  int centercol = 26;
376 
377  if (!((col < (centercol + 10)) && (col > (centercol - 10)) && (row < (centerrow + 10)) && (row > (centerrow -10 )))) passcuts_hit = false;
378  */
379 
380  if (passcuts_hit == true && passcuts) {
381  if (!(subdetid == PixelSubdetector::PixelBarrel && trackerTopology_->pxbLayer(id) == 1)) {
382  if (isHitValid) {
383  histo[VALID].fill(id, &iEvent);
384  histo[EFFICIENCY].fill(1, id, &iEvent);
385  }
386  if (isHitMissing) {
387  histo[MISSING].fill(id, &iEvent);
388  histo[EFFICIENCY].fill(0, id, &iEvent);
389  }
390  if (isHitInactive) {
391  histo[INACTIVE].fill(id, &iEvent);
392  }
393  }
394  }
395  }
396 
398  valid_layerFrom = false;
399 
400  //propagation only from PXB2 and PXD1, more cuts later
401  for (const auto& tm : traj->measurements()) {
402  if (tm.recHit().get() && tm.recHitR().isValid()) {
403  DetId where = tm.recHitR().geographicalId();
404  int source_det = where.subdetId();
405 
406  if (source_det == PixelSubdetector::SubDetector::PixelBarrel) {
407  int source_layer = trackerTopology_->pxbLayer(where);
408  if (source_layer == 2) {
409  if (tm.updatedState().isValid()) {
410  tsosPXB2 = tm.updatedState();
411  valid_layerFrom = true;
412  }
413  }
414  }
415 
416  if (source_det == PixelSubdetector::SubDetector::PixelEndcap) {
417  int source_layer = trackerTopology_->pxfDisk(where);
418  if (source_layer == 1) {
419  if (tm.updatedState().isValid()) {
420  tsosPXB2 = tm.updatedState();
421  valid_layerFrom = true;
422  }
423  }
424  }
425  }
426  } //uodated tsosPXB2 here
427 
428  if (!valid_layerFrom)
429  continue;
430  if (!tsosPXB2.isValid())
431  continue;
432 
433  //propagation A: Calculate the efficiency by the distance to the closest cluster
434  expTrajMeasurements =
435  theLayerMeasurements_->measurements(*pxbLayer1_, tsosPXB2, *trackerPropagator_, *chi2MeasurementEstimator_);
436  auto compDets = pxbLayer1_->compatibleDets(tsosPXB2, *trackerPropagator_, *chi2MeasurementEstimator_);
437  std::pair<int, bool[3]> eff_map;
438  bool valid = false;
439  bool missing = false;
440  passcuts_hit = true;
441 
442  //Fiducial Cut, only calculate the efficiency of the central pixels
443  for (uint p = 0; p < expTrajMeasurements.size(); p++) {
444  TrajectoryMeasurement pxb1TM(expTrajMeasurements[p]);
445  const auto& pxb1Hit = pxb1TM.recHit();
446  int detidHit = pxb1Hit->geographicalId();
447  if (detidHit == 0)
448  continue;
449 
450  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(pxb1Hit->hit());
451  const PixelGeomDetUnit* geomdetunit = dynamic_cast<const PixelGeomDetUnit*>(tracker->idToDet(detidHit));
452  const PixelTopology& topol = geomdetunit->specificTopology();
453 
454  LocalPoint lp;
455  if (pixhit) {
456  lp = pixhit->localPosition();
457  }
458 
459  MeasurementPoint mp = topol.measurementPosition(lp);
460  int row = (int)mp.x() % 80;
461  int col = (int)mp.y() % 52;
462 
463  int centerrow = 40;
464  int centercol = 26;
465 
466  if (!((col < (centercol + 10)) && (col > (centercol - 10)) && (row < (centerrow + 10)) &&
467  (row > (centerrow - 10))))
468  passcuts_hit = false;
469 
470  //Access the distance to the closest cluster
471  for (const auto& detAndState : compDets) {
472  const auto& pXb1_lpos = detAndState.second.localPosition();
473  int detid = detAndState.first->geographicalId().rawId();
475  iter_cl != siPixelClusters->end();
476  iter_cl++) {
477  DetId detId(iter_cl->id());
478  float minD[2];
479  minD[0] = minD[1] = 10000.;
480  if (detId.rawId() != detAndState.first->geographicalId().rawId())
481  continue;
482  if (pxb1Hit->geographicalId().rawId() != detAndState.first->geographicalId().rawId())
483  continue;
484  const PixelGeomDetUnit* pixdet = (const PixelGeomDetUnit*)tkgeom->idToDetUnit(detId);
485  edmNew::DetSet<SiPixelCluster>::const_iterator itCluster = iter_cl->begin();
486  if (passcuts_hit) {
487  for (; itCluster != iter_cl->end(); ++itCluster) {
488  LocalPoint lp(itCluster->x(), itCluster->y(), 0.);
489  PixelClusterParameterEstimator::ReturnType params = cpe.getParameters(*itCluster, *pixdet);
490  lp = std::get<0>(params);
491 
492  float Xdist = abs(lp.x() - pXb1_lpos.x());
493  float Ydist = abs(lp.y() - pXb1_lpos.y());
494  if (Xdist < minD[0]) {
495  minD[0] = Xdist;
496  }
497  if (Ydist < minD[1]) {
498  minD[1] = Ydist;
499  }
500  }
501 
502  if ((minD[0] < 0.02) && (minD[1] < 0.02)) {
503  valid = true;
504  missing = false;
505 
506  } else {
507  missing = true;
508  valid = false;
509  }
510  }
511  }
512 
513  //cuts: exactly the same as for other hits but assuming PXB1
514 
515  //D0
516  if (!((std::abs(track->dxy(vertices->at(0).position())) * -1.0) <
517  TRACK_D0_CUT_BARREL_VAL[trackerTopology_->pxbLayer(detid) - 1]))
518  passcuts_hit = false;
519  //Dz
520  if (!(std::abs(track->dz(vertices->at(0).position())) < TRACK_DZ_CUT_BARREL_VAL))
521  passcuts_hit = false;
522  // Pixhit cut
523  if (!((nBpixL2Hits > 0 && nBpixL3Hits > 0 && nBpixL4Hits > 0) ||
524  (nBpixL2Hits > 0 && nBpixL3Hits > 0 && nFpixD1Hits > 0) ||
525  (nBpixL2Hits > 0 && nFpixD1Hits > 0 && nFpixD2Hits > 0) ||
526  (nFpixD1Hits > 0 && nFpixD2Hits > 0 && nFpixD3Hits > 0)))
527  passcuts_hit = false;
528  bool found_det = false;
529 
530  if (passcuts && passcuts_hit) {
531  for (unsigned int i_eff = 0; i_eff < eff_pxb1_vector.size(); i_eff++) {
532  //in case found hit in the same det, take only the valid hit
533  if (eff_pxb1_vector[i_eff].first == detid) {
534  found_det = true;
535  if (eff_pxb1_vector[i_eff].second[0] == false && valid == true) {
536  eff_pxb1_vector[i_eff].second[0] = valid;
537  eff_pxb1_vector[i_eff].second[1] = missing;
538  }
539  }
540  }
541  if (!found_det) {
542  eff_map.first = detid;
543  eff_map.second[0] = valid;
544  eff_map.second[1] = missing;
545  eff_pxb1_vector.push_back(eff_map);
546  }
547  }
548  }
549  }
550 
551  //propagation B: filling inactive hits
552 
553  for (uint p = 0; p < expTrajMeasurements.size(); p++) {
554  TrajectoryMeasurement pxb1TM(expTrajMeasurements[p]);
555  const auto& pxb1Hit = pxb1TM.recHit();
556  bool inactive = (pxb1Hit->getType() == TrackingRecHit::inactive);
557  int detid = pxb1Hit->geographicalId();
558  bool found_det = false;
559 
560  if (passcuts && passcuts_hit) {
561  for (unsigned int i_eff = 0; i_eff < eff_pxb1_vector.size(); i_eff++) {
562  //in case found hit in the same det, take only the valid hit
563  if (eff_pxb1_vector[i_eff].first == detid) {
564  found_det = true;
565  if (eff_pxb1_vector[i_eff].second[0] == false && valid == true) {
566  eff_pxb1_vector[i_eff].second[2] = inactive;
567  }
568  }
569  }
570 
571  //if no other hit in det
572  if (!found_det) {
573  eff_map.first = detid;
574  eff_map.second[2] = inactive;
575  eff_pxb1_vector.push_back(eff_map);
576  }
577  }
578 
579  } //traj loop
580 
581  if (eff_pxb1_vector.size() == 1) {
582  //eff map is filled -> decide what to do for double hits, ie eff_pxb1_vector.size>1 ... if 1 just use MISSING and VALID as usual
583 
584  if (eff_pxb1_vector[0].second[0]) {
585  histo[VALID].fill(eff_pxb1_vector[0].first, &iEvent);
586  histo[EFFICIENCY].fill(1, eff_pxb1_vector[0].first, &iEvent);
587  }
588  if (eff_pxb1_vector[0].second[1]) {
589  histo[MISSING].fill(eff_pxb1_vector[0].first, &iEvent);
590  histo[EFFICIENCY].fill(0, eff_pxb1_vector[0].first, &iEvent);
591  }
592 
593  if (eff_pxb1_vector[0].second[2]) {
594  histo[INACTIVE].fill(eff_pxb1_vector[0].first, &iEvent);
595  }
596  }
597 
598  } //trajTrackHandle
599 
600  histo[VALID].executePerEventHarvesting(&iEvent);
601  histo[MISSING].executePerEventHarvesting(&iEvent);
602  histo[INACTIVE].executePerEventHarvesting(&iEvent);
603  }
604 
605 } // namespace
606 
607 DEFINE_FWK_MODULE(SiPixelPhase1TrackEfficiency);
Chi2MeasurementEstimatorBase.h
Propagator.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Point2DBase
Definition: Point2DBase.h:9
Chi2MeasurementEstimator.h
MeasurementEstimator
Definition: MeasurementEstimator.h:19
PixelClusterParameterEstimator
Definition: PixelClusterParameterEstimator.h:15
LayerMeasurements::measurements
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: LayerMeasurements.cc:122
edm::ESInputTag
Definition: ESInputTag.h:87
MeasurementTrackerEvent.h
PixelSubdetector.h
FreeTrajectoryState.h
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
TrackerGeometry.h
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
PixelTopology.h
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
sistrip::tracker_
static const char tracker_[]
Definition: ConstantsForGranularity.h:23
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
edm::EDGetTokenT
Definition: EDGetToken.h:33
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
cuy.col
col
Definition: cuy.py:1010
PixelClusterParameterEstimator.h
SiPixelCluster.h
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
oppositeToMomentum
Definition: PropagationDirection.h:4
cms::cuda::assert
assert(be >=bs)
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CkfComponentsRecord.h
edm::Handle< reco::VertexCollection >
parallelization.uint
uint
Definition: parallelization.py:124
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
SiPixelPhase1Base
Definition: SiPixelPhase1Base.h:46
Propagator
Definition: Propagator.h:44
DetId
Definition: DetId.h:17
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
edmNew::DetSet::end
iterator end()
Definition: DetSetNew.h:56
MakerMacros.h
TrackerTopology.h
LayerMeasurements
Definition: LayerMeasurements.h:18
Track.h
HIInitialJetCoreClusterSplitting_cff.siPixelClusters
siPixelClusters
Definition: HIInitialJetCoreClusterSplitting_cff.py:27
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
LayerMeasurements.h
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
edm::ESHandle< TrackerGeometry >
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
h
Point3DBase< float, LocalTag >
SiPixelRecHit.h
PixelTopology
Definition: PixelTopology.h:10
TrajTrackAssociation.h
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
Vertex.h
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
MeasurementTrackerEvent::geometricSearchTracker
const GeometricSearchTracker * geometricSearchTracker() const
Definition: MeasurementTrackerEvent.h:73
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
TrackingRecHit::missing
Definition: TrackingRecHit.h:47
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
CertificationClient_cfi.DCS
DCS
Definition: CertificationClient_cfi.py:9
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition: EventSetup.h:58
hcalSimParameters_cfi.hb
hb
Definition: hcalSimParameters_cfi.py:60
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd >
TrackingRecHit::valid
Definition: TrackingRecHit.h:46
SiPixelPhase1Base::analyze
void analyze(edm::Event const &e, edm::EventSetup const &) override=0
VertexFwd.h
SiPixelPhase1Base.h
BaseTrackerRecHit::localPosition
LocalPoint localPosition() const override
Definition: BaseTrackerRecHit.h:56
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
Propagator::clone
virtual Propagator * clone() const =0
TrackingComponentsRecord.h
GeometricSearchTracker
Definition: GeometricSearchTracker.h:15
PixelGeomDetUnit.h
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GeomDetEnumerators::PixelEndcap
Definition: GeomDetEnumerators.h:12
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
TrackingRecHit::inactive
Definition: TrackingRecHit.h:48
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
combine.missing
missing
Definition: combine.py:5
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
StripSubdetector.h
edm::InputTag
Definition: InputTag.h:15
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MeasurementTracker.h
GeometricSearchTracker::pixelBarrelLayers
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
Definition: GeometricSearchTracker.h:44
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
PixelClusterParameterEstimator::ReturnType
std::tuple< LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType > ReturnType
Definition: PixelClusterParameterEstimator.h:22
TrackerGeometry
Definition: TrackerGeometry.h:14
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31