CMS 3D CMS Logo

HITrackClusterRemover.cc
Go to the documentation of this file.
6 
23 
25 
29 
34 
36 
37 //
38 // class decleration
39 //
40 
42 public:
44  ~HITrackClusterRemover() override;
45  void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override;
46 
47 private:
49  struct ParamBlock {
51  ParamBlock(const edm::ParameterSet &iConfig)
52  : isSet_(true),
53  usesCharge_(iConfig.exists("maxCharge")),
54  usesSize_(iConfig.exists("maxSize")),
55  cutOnPixelCharge_(iConfig.exists("minGoodPixelCharge")),
56  cutOnStripCharge_(iConfig.exists("minGoodStripCharge")),
57  maxChi2_(iConfig.getParameter<double>("maxChi2")),
58  maxCharge_(usesCharge_ ? iConfig.getParameter<double>("maxCharge") : 0),
59  minGoodPixelCharge_(cutOnPixelCharge_ ? iConfig.getParameter<double>("minGoodPixelCharge") : 0),
60  minGoodStripCharge_(cutOnStripCharge_ ? iConfig.getParameter<double>("minGoodStripCharge") : 0),
61  maxSize_(usesSize_ ? iConfig.getParameter<uint32_t>("maxSize") : 0) {}
64  size_t maxSize_;
65  };
66  static const unsigned int NumberOfParamBlocks = 6;
67 
68  bool doTracks_;
70  bool mergeOld_;
79  std::vector<edm::EDGetTokenT<edm::ValueMap<int> > > overrideTrkQuals_;
81  // edm::EDGetTokenT<SiPixelRecHitCollection> pixelRecHitsToken_;
82 
84  void readPSet(const edm::ParameterSet &iConfig,
85  const std::string &name,
86  int id1 = -1,
87  int id2 = -1,
88  int id3 = -1,
89  int id4 = -1,
90  int id5 = -1,
91  int id6 = -1);
92 
93  std::vector<uint8_t> pixels, strips; // avoid unneed alloc/dealloc of this
94  edm::ProductID pixelSourceProdID, stripSourceProdID; // ProdIDs refs must point to (for consistency tests)
95 
96  inline void process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry *tg);
97  inline void process(const OmniClusterRef &cluRef, SiStripDetId &detid, bool fromTrack);
98 
99  template <typename T>
100  std::unique_ptr<edmNew::DetSetVector<T> > cleanup(const edmNew::DetSetVector<T> &oldClusters,
101  const std::vector<uint8_t> &isGood,
103  const reco::ClusterRemovalInfo::Indices *oldRefs);
104 
105  // Carries in full removal info about a given det from oldRefs
107 
113  std::vector<bool> collectedStrips_;
114  std::vector<bool> collectedPixels_;
115 
116  float sensorThickness(const SiStripDetId &detid) const;
117 };
118 
119 using namespace std;
120 using namespace edm;
121 using namespace reco;
122 
124  const edm::ParameterSet &iConfig, const std::string &name, int id1, int id2, int id3, int id4, int id5, int id6) {
125  if (iConfig.exists(name)) {
126  ParamBlock pblock(iConfig.getParameter<ParameterSet>(name));
127  if (id1 == -1) {
128  fill(pblocks_, pblocks_ + NumberOfParamBlocks, pblock);
129  } else {
130  pblocks_[id1] = pblock;
131  if (id2 != -1)
132  pblocks_[id2] = pblock;
133  if (id3 != -1)
134  pblocks_[id3] = pblock;
135  if (id4 != -1)
136  pblocks_[id4] = pblock;
137  if (id5 != -1)
138  pblocks_[id5] = pblock;
139  if (id6 != -1)
140  pblocks_[id6] = pblock;
141  }
142  }
143 }
144 
147  doTracks_(iConfig.exists("trajectories")),
148  doStrip_(iConfig.existsAs<bool>("doStrip") ? iConfig.getParameter<bool>("doStrip") : true),
149  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
150  mergeOld_(iConfig.exists("oldClusterRemovalInfo")),
151  clusterWasteSolution_(true),
152  doStripChargeCheck_(
153  iConfig.existsAs<bool>("doStripChargeCheck") ? iConfig.getParameter<bool>("doStripChargeCheck") : false),
154  doPixelChargeCheck_(
155  iConfig.existsAs<bool>("doPixelChargeCheck") ? iConfig.getParameter<bool>("doPixelChargeCheck") : false),
156  stripRecHits_(doStripChargeCheck_ ? iConfig.getParameter<std::string>("stripRecHits")
157  : std::string("siStripMatchedRecHits")),
158  pixelRecHits_(doPixelChargeCheck_ ? iConfig.getParameter<std::string>("pixelRecHits")
159  : std::string("siPixelRecHits")) {
160  mergeOld_ = mergeOld_ && !iConfig.getParameter<InputTag>("oldClusterRemovalInfo").label().empty();
161  if (iConfig.exists("overrideTrkQuals"))
162  overrideTrkQuals_.push_back(consumes<edm::ValueMap<int> >(iConfig.getParameter<InputTag>("overrideTrkQuals")));
163  if (iConfig.exists("clusterLessSolution"))
164  clusterWasteSolution_ = !iConfig.getParameter<bool>("clusterLessSolution");
166  throw cms::Exception("Configuration Error")
167  << "HITrackClusterRemover: Charge check asked without cluster collection ";
169  throw cms::Exception("Configuration Error")
170  << "HITrackClusterRemover: Pixel cluster charge check not yet implemented";
171 
173  produces<edmNew::DetSetVector<SiPixelCluster> >();
175  produces<edmNew::DetSetVector<SiStripCluster> >();
177  produces<ClusterRemovalInfo>();
178 
180 
182  readPSet(iConfig, "Common", -1);
183  if (doPixel_) {
184  readPSet(iConfig, "Pixel", 0, 1);
185  readPSet(iConfig, "PXB", 0);
186  readPSet(iConfig, "PXE", 1);
187  }
188  if (doStrip_) {
189  readPSet(iConfig, "Strip", 2, 3, 4, 5);
190  readPSet(iConfig, "StripInner", 2, 3);
191  readPSet(iConfig, "StripOuter", 4, 5);
192  readPSet(iConfig, "TIB", 2);
193  readPSet(iConfig, "TID", 3);
194  readPSet(iConfig, "TOB", 4);
195  readPSet(iConfig, "TEC", 5);
196  }
197 
198  bool usingCharge = false;
199  for (size_t i = 0; i < NumberOfParamBlocks; ++i) {
200  if (!pblocks_[i].isSet_)
201  throw cms::Exception("Configuration Error")
202  << "HITrackClusterRemover: Missing configuration for detector with subDetID = " << (i + 1);
203  if (pblocks_[i].usesCharge_ && !usingCharge) {
204  throw cms::Exception("Configuration Error") << "HITrackClusterRemover: Configuration for subDetID = " << (i + 1)
205  << " uses cluster charge, which is not enabled.";
206  }
207  }
208 
209  if (!clusterWasteSolution_) {
210  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
211  produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
212  }
214  filterTracks_ = false;
215  if (iConfig.exists("TrackQuality")) {
216  filterTracks_ = true;
219  iConfig.existsAs<int>("minNumberOfLayersWithMeasBeforeFiltering")
220  ? iConfig.getParameter<int>("minNumberOfLayersWithMeasBeforeFiltering")
221  : 0;
222  }
223 
224  if (doTracks_)
225  tracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trajectories"));
226  if (doPixel_)
227  pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
228  if (doStrip_)
229  stripClusters_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<InputTag>("stripClusters"));
230  if (mergeOld_) {
231  oldRemovalInfo_ = consumes<ClusterRemovalInfo>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
232  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
233  oldStrMaskToken_ = consumes<StripMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
234  }
235 
236  if (doStripChargeCheck_) {
237  rphiRecHitToken_ = consumes<SiStripRecHit2DCollection>(InputTag(stripRecHits_, "rphiRecHit"));
238  stereoRecHitToken_ = consumes<SiStripRecHit2DCollection>(InputTag(stripRecHits_, "stereoRecHit"));
239  }
240  // if(doPixelChargeCheck_) pixelRecHitsToken_ = consumes<SiPixelRecHitCollection>(InputTag(pixelRecHits_));
241 }
242 
244 
246  for (size_t i = 0, n = refs.size(); i < n; ++i) {
247  refs[i] = oldRefs[refs[i]];
248  }
249 }
250 
251 template <typename T>
252 std::unique_ptr<edmNew::DetSetVector<T> > HITrackClusterRemover::cleanup(
253  const edmNew::DetSetVector<T> &oldClusters,
254  const std::vector<uint8_t> &isGood,
256  const reco::ClusterRemovalInfo::Indices *oldRefs) {
257  typedef typename edmNew::DetSetVector<T> DSV;
258  typedef typename edmNew::DetSetVector<T>::FastFiller DSF;
259  typedef typename edmNew::DetSet<T> DS;
260  auto output = std::make_unique<DSV>();
261  output->reserve(oldClusters.size(), oldClusters.dataSize());
262 
263  unsigned int countOld = 0;
264  unsigned int countNew = 0;
265 
266  // cluster removal loop
267  const T *firstOffset = &oldClusters.data().front();
268  for (typename DSV::const_iterator itdet = oldClusters.begin(), enddet = oldClusters.end(); itdet != enddet; ++itdet) {
269  DS oldDS = *itdet;
270 
271  if (oldDS.empty())
272  continue; // skip empty detsets
273 
274  uint32_t id = oldDS.detId();
275  DSF outds(*output, id);
276 
277  for (typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
278  uint32_t index = ((&*it) - firstOffset);
279  countOld++;
280  if (isGood[index]) {
281  outds.push_back(*it);
282  countNew++;
283  refs.push_back(index);
284  //std::cout << "HITrackClusterRemover::cleanup " << typeid(T).name() << " reference " << index << " to " << (refs.size() - 1) << std::endl;
285  }
286  }
287  if (outds.empty())
288  outds.abort(); // not write in an empty DSV
289  }
290 
291  if (oldRefs != nullptr)
292  mergeOld(refs, *oldRefs);
293  return output;
294 }
295 
297  if (detid.subdetId() >= SiStripDetId::TIB) {
298  if (detid.subdetId() == SiStripDetId::TOB)
299  return 0.047;
302  return 0.047;
303  return 0.029; // so it is TEC ring 1-4 or TIB or TOB;
304  } else if (detid.subdetId() == PixelSubdetector::PixelBarrel)
305  return 0.0285;
306  else
307  return 0.027;
308 }
309 
310 void HITrackClusterRemover::process(OmniClusterRef const &ocluster, SiStripDetId &detid, bool fromTrack) {
311  SiStripRecHit2D::ClusterRef cluster = ocluster.cluster_strip();
312  if (cluster.id() != stripSourceProdID)
313  throw cms::Exception("Inconsistent Data")
314  << "HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.id()
315  << " does not match with source cluster collection (ID = " << stripSourceProdID << ")\n.";
316 
317  uint32_t subdet = detid.subdetId();
318  assert(cluster.id() == stripSourceProdID);
319  if (pblocks_[subdet - 1].usesSize_ && (cluster->amplitudes().size() > pblocks_[subdet - 1].maxSize_))
320  return;
321  if (!fromTrack) {
322  if (pblocks_[subdet - 1].cutOnStripCharge_ &&
323  (cluster->charge() > (pblocks_[subdet - 1].minGoodStripCharge_ * sensorThickness(detid))))
324  return;
325  }
326 
327  if (collectedStrips_.size() <= cluster.key())
328  edm::LogError("BadCollectionSize") << collectedStrips_.size() << " is smaller than " << cluster.key();
329 
330  assert(collectedStrips_.size() > cluster.key());
331  strips[cluster.key()] = false;
333  collectedStrips_[cluster.key()] = true;
334 }
335 
336 void HITrackClusterRemover::process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry *tg) {
337  SiStripDetId detid = hit->geographicalId();
338  uint32_t subdet = detid.subdetId();
339 
340  assert((subdet > 0) && (subdet <= NumberOfParamBlocks));
341 
342  // chi2 cut
343  if (chi2 > Traj2TrackHits::toChi2x5(pblocks_[subdet - 1].maxChi2_))
344  return;
345 
347  if (!doPixel_)
348  return;
349  // this is a pixel, and i *know* it is
350  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
351 
352  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
353 
354  if (cluster.id() != pixelSourceProdID)
355  throw cms::Exception("Inconsistent Data")
356  << "HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.id()
357  << " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
358 
359  assert(cluster.id() == pixelSourceProdID);
360  //DBG// cout << "HIT NEW PIXEL DETID = " << detid.rawId() << ", Cluster [ " << cluster.key().first << " / " << cluster.key().second << " ] " << endl;
361 
362  // if requested, cut on cluster size
363  if (pblocks_[subdet - 1].usesSize_ && (cluster->pixels().size() > pblocks_[subdet - 1].maxSize_))
364  return;
365 
366  // mark as used
367  pixels[cluster.key()] = false;
368 
369  //if(!clusterWasteSolution_) collectedPixel[detid.rawId()].insert(cluster);
370  assert(collectedPixels_.size() > cluster.key());
371  //assert(detid.rawId() == cluster->geographicalId()); //This condition fails
373  collectedPixels_[cluster.key()] = true;
374 
375  } else { // aka Strip
376  if (!doStrip_)
377  return;
378  const type_info &hitType = typeid(*hit);
379  if (hitType == typeid(SiStripRecHit2D)) {
380  const SiStripRecHit2D *stripHit = static_cast<const SiStripRecHit2D *>(hit);
381  //DBG// cout << "Plain RecHit 2D: " << endl;
382  process(stripHit->omniClusterRef(), detid, true);
383  } else if (hitType == typeid(SiStripRecHit1D)) {
384  const SiStripRecHit1D *hit1D = static_cast<const SiStripRecHit1D *>(hit);
385  process(hit1D->omniClusterRef(), detid, true);
386  } else if (hitType == typeid(SiStripMatchedRecHit2D)) {
387  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
388  //DBG// cout << "Matched RecHit 2D: " << endl;
389  process(matchHit->monoClusterRef(), detid, true);
390  process(matchHit->stereoClusterRef(), detid, true);
391  } else if (hitType == typeid(ProjectedSiStripRecHit2D)) {
392  const ProjectedSiStripRecHit2D *projHit = static_cast<const ProjectedSiStripRecHit2D *>(hit);
393  //DBG// cout << "Projected RecHit 2D: " << endl;
394  process(projHit->originalHit().omniClusterRef(), detid, true);
395  } else
396  throw cms::Exception("NOT IMPLEMENTED")
397  << "Don't know how to handle " << hitType.name() << " on detid " << detid.rawId() << "\n";
398  }
399 }
400 
401 /* Schematic picture of n-th step Iterative removal
402  * (that os removing clusters after n-th step tracking)
403  * clusters: [ C1 ] -> [ C2 ] -> ... -> [ Cn ] -> [ Cn + 1 ]
404  * ^ ^ ^--- OUTPUT "new" ID
405  * |-- before any removal |----- Source clusters
406  * |-- OUTPUT "old" ID |----- Hits in Traj. point here
407  * | \----- Old ClusterRemovalInfo "new" ID
408  * \-- Old ClusterRemovalInfo "old" ID
409  */
410 
412  ProductID pixelOldProdID, stripOldProdID;
413 
414  const auto &tgh = &iSetup.getData(tTrackerGeom_);
415 
417  if (doPixel_) {
418  iEvent.getByToken(pixelClusters_, pixelClusters);
420  }
421  //DBG// std::cout << "HITrackClusterRemover: Read pixel " << pixelClusters_.encode() << " = ID " << pixelSourceProdID << std::endl;
422 
424  if (doStrip_) {
425  iEvent.getByToken(stripClusters_, stripClusters);
427  }
428  //DBG// std::cout << "HITrackClusterRemover: Read strip " << stripClusters_.encode() << " = ID " << stripSourceProdID << std::endl;
429 
430  std::unique_ptr<ClusterRemovalInfo> cri;
431  if (clusterWasteSolution_) {
432  if (doStrip_ && doPixel_)
433  cri = std::make_unique<ClusterRemovalInfo>(pixelClusters, stripClusters);
434  else if (doStrip_)
435  cri = std::make_unique<ClusterRemovalInfo>(stripClusters);
436  else if (doPixel_)
437  cri = std::make_unique<ClusterRemovalInfo>(pixelClusters);
438  }
439 
440  Handle<ClusterRemovalInfo> oldRemovalInfo;
442  iEvent.getByToken(oldRemovalInfo_, oldRemovalInfo);
443  // Check ProductIDs
444  if ((oldRemovalInfo->stripNewRefProd().id() == stripClusters.id()) &&
445  (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.id())) {
446  cri->getOldClustersFrom(*oldRemovalInfo);
447 
448  pixelOldProdID = oldRemovalInfo->pixelRefProd().id();
449  stripOldProdID = oldRemovalInfo->stripRefProd().id();
450 
451  } else {
453  labelsForToken(oldRemovalInfo_, labels);
454  throw cms::Exception("Inconsistent Data")
455  << "HITrackClusterRemover: "
456  << "Input collection product IDs are [pixel: " << pixelClusters.id() << ", strip: " << stripClusters.id()
457  << "] \n"
458  << "\t but the *old* ClusterRemovalInfo " << labels.productInstance << " refers as 'new product ids' to "
459  << "[pixel: " << oldRemovalInfo->pixelNewRefProd().id()
460  << ", strip: " << oldRemovalInfo->stripNewRefProd().id() << "]\n"
461  << "NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory "
462  "MUST be already re-keyed.\n";
463  }
464  } else { // then Old == Source
465  pixelOldProdID = pixelSourceProdID;
466  stripOldProdID = stripSourceProdID;
467  }
468 
469  if (doStrip_) {
470  strips.resize(stripClusters->dataSize());
471  fill(strips.begin(), strips.end(), true);
472  }
473  if (doPixel_) {
474  pixels.resize(pixelClusters->dataSize());
475  fill(pixels.begin(), pixels.end(), true);
476  }
477  if (mergeOld_) {
480  iEvent.getByToken(oldPxlMaskToken_, oldPxlMask);
481  iEvent.getByToken(oldStrMaskToken_, oldStrMask);
482  LogDebug("HITrackClusterRemover") << "to merge in, " << oldStrMask->size() << " strp and " << oldPxlMask->size()
483  << " pxl";
484  oldStrMask->copyMaskTo(collectedStrips_);
485  oldPxlMask->copyMaskTo(collectedPixels_);
486  assert(stripClusters->dataSize() >= collectedStrips_.size());
487  collectedStrips_.resize(stripClusters->dataSize(), false);
488  } else {
489  collectedStrips_.resize(stripClusters->dataSize(), false);
490  collectedPixels_.resize(pixelClusters->dataSize(), false);
491  }
492 
493  if (doTracks_) {
495  iEvent.getByToken(tracks_, tracks);
496 
497  std::vector<Handle<edm::ValueMap<int> > > quals;
498  if (!overrideTrkQuals_.empty()) {
499  quals.resize(1);
500  iEvent.getByToken(overrideTrkQuals_[0], quals[0]);
501  }
502  int it = 0;
503  for (const auto &track : *tracks) {
504  if (filterTracks_) {
505  bool goodTk = true;
506  if (!quals.empty()) {
507  int qual = (*(quals[0])).get(it++);
508  if (qual < 0) {
509  goodTk = false;
510  }
511  //note that this does not work for some trackquals (goodIterative or undefQuality)
512  else
513  goodTk = (qual & (1 << trackQuality_)) >> trackQuality_;
514  } else
515  goodTk = (track.quality(trackQuality_));
516  if (!goodTk)
517  continue;
518  if (track.hitPattern().trackerLayersWithMeasurement() < minNumberOfLayersWithMeasBeforeFiltering_)
519  continue;
520  }
521  auto const &chi2sX5 = track.extra()->chi2sX5();
522  assert(chi2sX5.size() == track.recHitsSize());
523  auto hb = track.recHitsBegin();
524  for (unsigned int h = 0; h < track.recHitsSize(); h++) {
525  auto hit = *(hb + h);
526  if (!hit->isValid())
527  continue;
528  process(hit, chi2sX5[h], tgh);
529  }
530  }
531  }
532 
533  if (doStripChargeCheck_) {
535  iEvent.getByToken(rphiRecHitToken_, rechitsrphi);
536  const SiStripRecHit2DCollection::DataContainer *rphiRecHits = &(rechitsrphi).product()->data();
538  recHit != rphiRecHits->end();
539  recHit++) {
540  SiStripDetId detid = recHit->geographicalId();
541  process(recHit->omniClusterRef(), detid, false);
542  }
544  iEvent.getByToken(stereoRecHitToken_, rechitsstereo);
545  const SiStripRecHit2DCollection::DataContainer *stereoRecHits = &(rechitsstereo).product()->data();
547  recHit != stereoRecHits->end();
548  recHit++) {
549  SiStripDetId detid = recHit->geographicalId();
550  process(recHit->omniClusterRef(), detid, false);
551  }
552  }
553  // if(doPixelChargeCheck_) {
554  // edm::Handle<SiPixelRecHitCollection> pixelrechits;
555  // iEvent.getByToken(pixelRecHitsToken_,pixelrechits);
556  // }
557 
560  cleanup(*pixelClusters, pixels, cri->pixelIndices(), mergeOld_ ? &oldRemovalInfo->pixelIndices() : nullptr));
561  //DBG// std::cout << "HITrackClusterRemover: Wrote pixel " << newPixels.id() << " from " << pixelSourceProdID << std::endl;
562  cri->setNewPixelClusters(newPixels);
563  }
566  cleanup(*stripClusters, strips, cri->stripIndices(), mergeOld_ ? &oldRemovalInfo->stripIndices() : nullptr));
567  //DBG// std::cout << "HITrackClusterRemover: Wrote strip " << newStrips.id() << " from " << stripSourceProdID << std::endl;
568  cri->setNewStripClusters(newStrips);
569  }
570 
571  if (clusterWasteSolution_) {
572  // double fraction_pxl= cri->pixelIndices().size() / (double) pixels.size();
573  // double fraction_strp= cri->stripIndices().size() / (double) strips.size();
574  // edm::LogWarning("HITrackClusterRemover")<<" fraction: " << fraction_pxl <<" "<<fraction_strp;
575  iEvent.put(std::move(cri));
576  }
577 
578  pixels.clear();
579  strips.clear();
580 
581  if (!clusterWasteSolution_) {
582  //auto_ptr<edmNew::DetSetVector<SiPixelClusterRefNew> > removedPixelClsuterRefs(new edmNew::DetSetVector<SiPixelClusterRefNew>());
583  //auto_ptr<edmNew::DetSetVector<SiStripRecHit1D::ClusterRef> > removedStripClsuterRefs(new edmNew::DetSetVector<SiStripRecHit1D::ClusterRef>());
584 
585  LogDebug("HITrackClusterRemover") << "total strip to skip: "
586  << std::count(collectedStrips_.begin(), collectedStrips_.end(), true);
587  // std::cout << "HITrackClusterRemover " <<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true) <<std::endl;
588  iEvent.put(std::make_unique<StripMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiStripCluster> >(stripClusters),
590 
591  LogDebug("HITrackClusterRemover") << "total pxl to skip: "
592  << std::count(collectedPixels_.begin(), collectedPixels_.end(), true);
593  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),
595  }
596  collectedStrips_.clear();
597  collectedPixels_.clear();
598 }
599 
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
void copyMaskTo(std::vector< bool > &) const
Definition: ContainerMask.h:87
size_type dataSize() const
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
void process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry *tg)
std::vector< data_type > DataContainer
static unsigned char toChi2x5(float chi2)
TrackQuality
track quality
Definition: TrackBase.h:150
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SiStripModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:109
HITrackClusterRemover(const edm::ParameterSet &iConfig)
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > overrideTrkQuals_
bool exists(std::string const &parameterName) const
checks if a parameter exists
OmniClusterRef const & stereoClusterRef() const
OmniClusterRef const & omniClusterRef() const
data_type const * data(size_t cell) const
std::vector< uint8_t > strips
static const unsigned int NumberOfParamBlocks
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
assert(be >=bs)
OmniClusterRef const & monoClusterRef() const
key_type key() const
Accessor for product key.
Definition: Ref.h:250
const_iterator end(bool update=false) const
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
char const * label
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
int iEvent
Definition: GenABIO.cc:224
float sensorThickness(const SiStripDetId &detid) const
edm::EDGetTokenT< reco::TrackCollection > tracks_
reco::TrackBase::TrackQuality trackQuality_
const SiPixelClusterRefProd & pixelNewRefProd() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool getData(T &iHolder) const
Definition: EventSetup.h:122
std::vector< uint32_t > Indices
static constexpr auto TOB
Definition: SiStripDetId.h:39
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:124
ParamBlock pblocks_[NumberOfParamBlocks]
void readPSet(const edm::ParameterSet &iConfig, const std::string &name, int id1=-1, int id2=-1, int id3=-1, int id4=-1, int id5=-1, int id6=-1)
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
const_iterator begin(bool update=false) const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
auto const & tracks
cannot be loose
size_type size() const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< bool > collectedStrips_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitToken_
static constexpr auto TIB
Definition: SiStripDetId.h:37
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
std::unique_ptr< edmNew::DetSetVector< T > > cleanup(const edmNew::DetSetVector< T > &oldClusters, const std::vector< uint8_t > &isGood, reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices *oldRefs)
fixed size matrix
HLT enums.
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
SiStripRecHit2D originalHit() const
std::vector< uint8_t > pixels
ParamBlock(const edm::ParameterSet &iConfig)
ClusterStripRef cluster_strip() const
size_t size() const
Definition: ContainerMask.h:53
std::vector< bool > collectedPixels_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
long double T
const SiStripClusterRefProd & stripRefProd() const
def move(src, dest)
Definition: eostools.py:511
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
Our base class.
Definition: SiPixelRecHit.h:23
const SiPixelClusterRefProd & pixelRefProd() const
const SiStripClusterRefProd & stripNewRefProd() const
#define LogDebug(id)