CMS 3D CMS Logo

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