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