CMS 3D CMS Logo

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