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:
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 
165  readPSet(iConfig, "Common",-1);
166  if (doPixel_) {
167  readPSet(iConfig, "Pixel" ,0,1);
168  readPSet(iConfig, "PXB" ,0);
169  readPSet(iConfig, "PXE" ,1);
170  }
171  if (doStrip_) {
172  readPSet(iConfig, "Strip" ,2,3,4,5);
173  readPSet(iConfig, "StripInner" ,2,3);
174  readPSet(iConfig, "StripOuter" ,4,5);
175  readPSet(iConfig, "TIB" ,2);
176  readPSet(iConfig, "TID" ,3);
177  readPSet(iConfig, "TOB" ,4);
178  readPSet(iConfig, "TEC" ,5);
179  }
180 
181  bool usingCharge = false;
182  for (size_t i = 0; i < NumberOfParamBlocks; ++i) {
183  if (!pblocks_[i].isSet_) throw cms::Exception("Configuration Error") << "HITrackClusterRemover: Missing configuration for detector with subDetID = " << (i+1);
184  if (pblocks_[i].usesCharge_ && !usingCharge) {
185  throw cms::Exception("Configuration Error") << "HITrackClusterRemover: Configuration for subDetID = " << (i+1) << " uses cluster charge, which is not enabled.";
186  }
187  }
188 
189  if (!clusterWasteSolution_){
190  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
191  produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
192  }
194  filterTracks_=false;
195  if (iConfig.exists("TrackQuality")){
196  filterTracks_=true;
197  trackQuality_=reco::TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality"));
198  minNumberOfLayersWithMeasBeforeFiltering_ = iConfig.existsAs<int>("minNumberOfLayersWithMeasBeforeFiltering") ?
199  iConfig.getParameter<int>("minNumberOfLayersWithMeasBeforeFiltering") : 0;
200  }
201 
202  if (doTracks_) tracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trajectories"));
203  if (doPixel_) pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
204  if (doStrip_) stripClusters_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<InputTag>("stripClusters"));
205  if (mergeOld_) {
206  oldRemovalInfo_ = consumes<ClusterRemovalInfo>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
207  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
208  oldStrMaskToken_ = consumes<StripMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
209  }
210 
211  if (doStripChargeCheck_) {
212  rphiRecHitToken_ = consumes<SiStripRecHit2DCollection>(InputTag(stripRecHits_,"rphiRecHit"));
213  stereoRecHitToken_ = consumes<SiStripRecHit2DCollection>(InputTag(stripRecHits_,"stereoRecHit"));
214  }
215 // if(doPixelChargeCheck_) pixelRecHitsToken_ = consumes<SiPixelRecHitCollection>(InputTag(pixelRecHits_));
216 
217 }
218 
219 
221 {
222 }
223 
225  const ClusterRemovalInfo::Indices &oldRefs)
226 {
227  for (size_t i = 0, n = refs.size(); i < n; ++i) {
228  refs[i] = oldRefs[refs[i]];
229  }
230 }
231 
232 
233 template<typename T>
234 std::unique_ptr<edmNew::DetSetVector<T> >
235 HITrackClusterRemover::cleanup(const edmNew::DetSetVector<T> &oldClusters, const std::vector<uint8_t> &isGood,
237  typedef typename edmNew::DetSetVector<T> DSV;
238  typedef typename edmNew::DetSetVector<T>::FastFiller DSF;
239  typedef typename edmNew::DetSet<T> DS;
240  auto output = std::make_unique<DSV>();
241  output->reserve(oldClusters.size(), oldClusters.dataSize());
242 
243  unsigned int countOld=0;
244  unsigned int countNew=0;
245 
246  // cluster removal loop
247  const T * firstOffset = & oldClusters.data().front();
248  for (typename DSV::const_iterator itdet = oldClusters.begin(), enddet = oldClusters.end(); itdet != enddet; ++itdet) {
249  DS oldDS = *itdet;
250 
251  if (oldDS.empty()) continue; // skip empty detsets
252 
253  uint32_t id = oldDS.detId();
254  DSF outds(*output, id);
255 
256  for (typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
257  uint32_t index = ((&*it) - firstOffset);
258  countOld++;
259  if (isGood[index]) {
260  outds.push_back(*it);
261  countNew++;
262  refs.push_back(index);
263  //std::cout << "HITrackClusterRemover::cleanup " << typeid(T).name() << " reference " << index << " to " << (refs.size() - 1) << std::endl;
264  }
265 
266  }
267  if (outds.empty()) outds.abort(); // not write in an empty DSV
268  }
269 
270  if (oldRefs != 0) mergeOld(refs, *oldRefs);
271  return output;
272 }
273 
275 {
276  if (detid.subdetId()>=SiStripDetId::TIB) {
277  if (detid.subdetId()==SiStripDetId::TOB) return 0.047;
280  return 0.047;
281  return 0.029; // so it is TEC ring 1-4 or TIB or TOB;
282  } else if (detid.subdetId()==PixelSubdetector::PixelBarrel) return 0.0285;
283  else return 0.027;
284 }
285 
286 void HITrackClusterRemover::process(OmniClusterRef const & ocluster, SiStripDetId & detid, bool fromTrack) {
287  SiStripRecHit2D::ClusterRef cluster = ocluster.cluster_strip();
288  if (cluster.id() != stripSourceProdID) throw cms::Exception("Inconsistent Data") <<
289  "HITrackClusterRemover: strip cluster ref from Product ID = " << cluster.id() <<
290  " does not match with source cluster collection (ID = " << stripSourceProdID << ")\n.";
291 
292  uint32_t subdet = detid.subdetId();
293  assert(cluster.id() == stripSourceProdID);
294  if (pblocks_[subdet-1].usesSize_ && (cluster->amplitudes().size() > pblocks_[subdet-1].maxSize_)) return;
295  if (!fromTrack) {
296  int clusCharge=0;
297  for( std::vector<uint8_t>::const_iterator iAmp = cluster->amplitudes().begin(); iAmp != cluster->amplitudes().end(); ++iAmp){
298  clusCharge += *iAmp;
299  }
300  if (pblocks_[subdet-1].cutOnStripCharge_ && (clusCharge > (pblocks_[subdet-1].minGoodStripCharge_*sensorThickness(detid)))) return;
301  }
302 
303  if (collectedStrips_.size()<=cluster.key())
304  edm::LogError("BadCollectionSize")<<collectedStrips_.size()<<" is smaller than "<<cluster.key();
305 
306  assert(collectedStrips_.size() > cluster.key());
307  strips[cluster.key()] = false;
308  if (!clusterWasteSolution_) collectedStrips_[cluster.key()]=true;
309 
310 }
311 
312 
313 void HITrackClusterRemover::process(const TrackingRecHit *hit, unsigned char chi2, const TrackerGeometry* tg) {
314  SiStripDetId detid = hit->geographicalId();
315  uint32_t subdet = detid.subdetId();
316 
317  assert ((subdet > 0) && (subdet <= NumberOfParamBlocks));
318 
319  // chi2 cut
320  if (chi2 > Traj2TrackHits::toChi2x5(pblocks_[subdet-1].maxChi2_)) return;
321 
323  if (!doPixel_) return;
324  // this is a pixel, and i *know* it is
325  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
326 
327  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
328 
329  if (cluster.id() != pixelSourceProdID) throw cms::Exception("Inconsistent Data") <<
330  "HITrackClusterRemover: pixel cluster ref from Product ID = " << cluster.id() <<
331  " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
332 
333  assert(cluster.id() == pixelSourceProdID);
334 //DBG// cout << "HIT NEW PIXEL DETID = " << detid.rawId() << ", Cluster [ " << cluster.key().first << " / " << cluster.key().second << " ] " << endl;
335 
336  // if requested, cut on cluster size
337  if (pblocks_[subdet-1].usesSize_ && (cluster->pixels().size() > pblocks_[subdet-1].maxSize_)) return;
338 
339  // mark as used
340  pixels[cluster.key()] = false;
341 
342  //if(!clusterWasteSolution_) collectedPixel[detid.rawId()].insert(cluster);
343  assert(collectedPixels_.size() > cluster.key());
344  //assert(detid.rawId() == cluster->geographicalId()); //This condition fails
345  if(!clusterWasteSolution_) collectedPixels_[cluster.key()]=true;
346 
347  } else { // aka Strip
348  if (!doStrip_) return;
349  const type_info &hitType = typeid(*hit);
350  if (hitType == typeid(SiStripRecHit2D)) {
351  const SiStripRecHit2D *stripHit = static_cast<const SiStripRecHit2D *>(hit);
352 //DBG// cout << "Plain RecHit 2D: " << endl;
353  process(stripHit->omniClusterRef(),detid, true);}
354  else if (hitType == typeid(SiStripRecHit1D)) {
355  const SiStripRecHit1D *hit1D = static_cast<const SiStripRecHit1D *>(hit);
356  process(hit1D->omniClusterRef(),detid, true);
357  } else if (hitType == typeid(SiStripMatchedRecHit2D)) {
358  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
359 //DBG// cout << "Matched RecHit 2D: " << endl;
360  process(matchHit->monoClusterRef(),detid, true);
361  process(matchHit->stereoClusterRef(),detid, true);
362  } else if (hitType == typeid(ProjectedSiStripRecHit2D)) {
363  const ProjectedSiStripRecHit2D *projHit = static_cast<const ProjectedSiStripRecHit2D *>(hit);
364 //DBG// cout << "Projected RecHit 2D: " << endl;
365  process(projHit->originalHit().omniClusterRef(),detid, true);
366  } else throw cms::Exception("NOT IMPLEMENTED") << "Don't know how to handle " << hitType.name() << " on detid " << detid.rawId() << "\n";
367  }
368 }
369 
370 /* Schematic picture of n-th step Iterative removal
371  * (that os removing clusters after n-th step tracking)
372  * clusters: [ C1 ] -> [ C2 ] -> ... -> [ Cn ] -> [ Cn + 1 ]
373  * ^ ^ ^--- OUTPUT "new" ID
374  * |-- before any removal |----- Source clusters
375  * |-- OUTPUT "old" ID |----- Hits in Traj. point here
376  * | \----- Old ClusterRemovalInfo "new" ID
377  * \-- Old ClusterRemovalInfo "old" ID
378  */
379 
380 
381 void
383 {
384  ProductID pixelOldProdID, stripOldProdID;
385 
387  iSetup.get<TrackerDigiGeometryRecord>().get(tgh);
388 
390  if (doPixel_) {
391  iEvent.getByToken(pixelClusters_, pixelClusters);
392  pixelSourceProdID = pixelClusters.id();
393  }
394 //DBG// std::cout << "HITrackClusterRemover: Read pixel " << pixelClusters_.encode() << " = ID " << pixelSourceProdID << std::endl;
395 
397  if (doStrip_) {
398  iEvent.getByToken(stripClusters_, stripClusters);
399  stripSourceProdID = stripClusters.id();
400  }
401 //DBG// std::cout << "HITrackClusterRemover: Read strip " << stripClusters_.encode() << " = ID " << stripSourceProdID << std::endl;
402 
403  std::unique_ptr<ClusterRemovalInfo> cri;
405  if (doStrip_ && doPixel_) cri = std::make_unique<ClusterRemovalInfo>(pixelClusters, stripClusters);
406  else if (doStrip_) cri = std::make_unique<ClusterRemovalInfo>(stripClusters);
407  else if (doPixel_) cri = std::make_unique<ClusterRemovalInfo>(pixelClusters);
408  }
409 
410  Handle<ClusterRemovalInfo> oldRemovalInfo;
412  iEvent.getByToken(oldRemovalInfo_, oldRemovalInfo);
413  // Check ProductIDs
414  if ( (oldRemovalInfo->stripNewRefProd().id() == stripClusters.id()) &&
415  (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.id()) ) {
416 
417  cri->getOldClustersFrom(*oldRemovalInfo);
418 
419  pixelOldProdID = oldRemovalInfo->pixelRefProd().id();
420  stripOldProdID = oldRemovalInfo->stripRefProd().id();
421 
422  } else {
423 
426  throw cms::Exception("Inconsistent Data") << "HITrackClusterRemover: " <<
427  "Input collection product IDs are [pixel: " << pixelClusters.id() << ", strip: " << stripClusters.id() << "] \n" <<
428  "\t but the *old* ClusterRemovalInfo " << labels.productInstance << " refers as 'new product ids' to " <<
429  "[pixel: " << oldRemovalInfo->pixelNewRefProd().id() << ", strip: " << oldRemovalInfo->stripNewRefProd().id() << "]\n" <<
430  "NOTA BENE: when running HITrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
431  }
432  } else { // then Old == Source
433  pixelOldProdID = pixelSourceProdID;
434  stripOldProdID = stripSourceProdID;
435  }
436 
437  if (doStrip_) {
438  strips.resize(stripClusters->dataSize()); fill(strips.begin(), strips.end(), true);
439  }
440  if (doPixel_) {
441  pixels.resize(pixelClusters->dataSize()); fill(pixels.begin(), pixels.end(), true);
442  }
443  if(mergeOld_) {
446  iEvent.getByToken(oldPxlMaskToken_ ,oldPxlMask);
447  iEvent.getByToken(oldStrMaskToken_ ,oldStrMask);
448  LogDebug("HITrackClusterRemover")<<"to merge in, "<<oldStrMask->size()<<" strp and "<<oldPxlMask->size()<<" pxl";
449  oldStrMask->copyMaskTo(collectedStrips_);
450  oldPxlMask->copyMaskTo(collectedPixels_);
451  assert(stripClusters->dataSize()>=collectedStrips_.size());
452  collectedStrips_.resize(stripClusters->dataSize(), false);
453  }else {
454  collectedStrips_.resize(stripClusters->dataSize(), false);
455  collectedPixels_.resize(pixelClusters->dataSize(), false);
456  }
457 
458  if (doTracks_) {
459 
461  iEvent.getByToken(tracks_,tracks);
462 
463  std::vector<Handle<edm::ValueMap<int> > > quals;
464  if ( overrideTrkQuals_.size() > 0) {
465  quals.resize(1);
466  iEvent.getByToken(overrideTrkQuals_[0],quals[0]);
467  }
468  int it=0;
469  for (const auto & track: *tracks) {
470  if (filterTracks_) {
471  bool goodTk = true;
472  if ( quals.size()!=0) {
473  int qual=(*(quals[0])). get(it++);
474  if ( qual < 0 ) {goodTk=false;}
475  //note that this does not work for some trackquals (goodIterative or undefQuality)
476  else
477  goodTk = ( qual & (1<<trackQuality_))>>trackQuality_;
478  }
479  else
480  goodTk=(track.quality(trackQuality_));
481  if ( !goodTk) continue;
482  if(track.hitPattern().trackerLayersWithMeasurement() < minNumberOfLayersWithMeasBeforeFiltering_) continue;
483  }
484  auto const & chi2sX5 = track.extra()->chi2sX5();
485  assert(chi2sX5.size()==track.recHitsSize());
486  auto hb = track.recHitsBegin();
487  for(unsigned int h=0;h<track.recHitsSize();h++){
488  auto hit = *(hb+h);
489  if (!hit->isValid()) continue;
490  process( hit, chi2sX5[h], tgh.product());
491  }
492  }
493  }
494 
495  if (doStripChargeCheck_) {
497  iEvent.getByToken(rphiRecHitToken_, rechitsrphi);
498  const SiStripRecHit2DCollection::DataContainer * rphiRecHits = & (rechitsrphi).product()->data();
500  recHit = rphiRecHits->begin(); recHit!= rphiRecHits->end(); recHit++){
501  SiStripDetId detid = recHit->geographicalId();
502  process(recHit->omniClusterRef(),detid,false);
503  }
505  iEvent.getByToken(stereoRecHitToken_, rechitsstereo);
506  const SiStripRecHit2DCollection::DataContainer * stereoRecHits = & (rechitsstereo).product()->data();
508  recHit = stereoRecHits->begin(); recHit!= stereoRecHits->end(); recHit++){
509  SiStripDetId detid = recHit->geographicalId();
510  process(recHit->omniClusterRef(),detid,false);
511  }
512 
513  }
514 // if(doPixelChargeCheck_) {
515 // edm::Handle<SiPixelRecHitCollection> pixelrechits;
516 // iEvent.getByToken(pixelRecHitsToken_,pixelrechits);
517 // }
518 
521  iEvent.put(cleanup(*pixelClusters, pixels, cri->pixelIndices(), mergeOld_ ? &oldRemovalInfo->pixelIndices() : 0));
522 //DBG// std::cout << "HITrackClusterRemover: Wrote pixel " << newPixels.id() << " from " << pixelSourceProdID << std::endl;
523  cri->setNewPixelClusters(newPixels);
524  }
526  OrphanHandle<edmNew::DetSetVector<SiStripCluster> > newStrips = iEvent.put(cleanup(*stripClusters, strips, cri->stripIndices(), mergeOld_ ? &oldRemovalInfo->stripIndices() : 0));
527 //DBG// std::cout << "HITrackClusterRemover: Wrote strip " << newStrips.id() << " from " << stripSourceProdID << std::endl;
528  cri->setNewStripClusters(newStrips);
529  }
530 
531 
532  if (clusterWasteSolution_) {
533  // double fraction_pxl= cri->pixelIndices().size() / (double) pixels.size();
534  // double fraction_strp= cri->stripIndices().size() / (double) strips.size();
535  // edm::LogWarning("HITrackClusterRemover")<<" fraction: " << fraction_pxl <<" "<<fraction_strp;
536  iEvent.put(std::move(cri));
537  }
538 
539  pixels.clear(); strips.clear();
540 
541  if (!clusterWasteSolution_){
542  //auto_ptr<edmNew::DetSetVector<SiPixelClusterRefNew> > removedPixelClsuterRefs(new edmNew::DetSetVector<SiPixelClusterRefNew>());
543  //auto_ptr<edmNew::DetSetVector<SiStripRecHit1D::ClusterRef> > removedStripClsuterRefs(new edmNew::DetSetVector<SiStripRecHit1D::ClusterRef>());
544 
545  LogDebug("HITrackClusterRemover")<<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true);
546  // std::cout << "HITrackClusterRemover " <<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true) <<std::endl;
547  iEvent.put(std::make_unique<StripMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiStripCluster> >(stripClusters),collectedStrips_));
548 
549  LogDebug("HITrackClusterRemover")<<"total pxl to skip: "<<std::count(collectedPixels_.begin(),collectedPixels_.end(),true);
550  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),collectedPixels_));
551 
552  }
553  collectedStrips_.clear();
554  collectedPixels_.clear();
555 
556 }
557 
#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:122
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:186
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:460
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)
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:90
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::TrackCollection > tracks_
reco::TrackBase::TrackQuality trackQuality_
ClusterStripRef cluster_strip() const
data_type const * data(size_t cell) const
size_t size() const
Definition: ContainerMask.h:54
OmniClusterRef const & monoClusterRef() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
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:125
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
const T & get() const
Definition: EventSetup.h:55
std::vector< bool > collectedStrips_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitToken_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
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
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:86
def move(src, dest)
Definition: eostools.py:510
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