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