CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackClusterRemover.cc
Go to the documentation of this file.
6 
25 
27 
30 
34 //
35 // class decleration
36 //
37 
39  public:
40  TrackClusterRemover(const edm::ParameterSet& iConfig) ;
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") << "TrackClusterRemover: Charge check asked without cluster collection ";
151  throw cms::Exception("Configuration Error") << "TrackClusterRemover: 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") << "TrackClusterRemover: Missing configuration for detector with subDetID = " << (i+1);
177  if (pblocks_[i].usesCharge_ && !usingCharge) {
178  throw cms::Exception("Configuration Error") << "TrackClusterRemover: 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 TrackClusterRemover::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 << "TrackClusterRemover::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 TrackClusterRemover::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  "TrackClusterRemover: 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  strips[cluster.key()] = false;
296  //if (!clusterWasteSolution_) collectedStrip[hit->geographicalId()].insert(cluster);
297  assert(collectedStrips_.size() > cluster.key());
298  //assert(hit->geographicalId() == cluster->geographicalId()); //This condition fails
299  if (!clusterWasteSolution_) collectedStrips_[cluster.key()]=true;
300 }
301 
302 
305  uint32_t subdet = detid.subdetId();
306 
307  assert ((subdet > 0) && (subdet <= NumberOfParamBlocks));
308 
309  // chi2 cut
310  if (chi2 > pblocks_[subdet-1].maxChi2_) return;
311 
312  if ((subdet == PixelSubdetector::PixelBarrel) || (subdet == PixelSubdetector::PixelEndcap)) {
313  if (!doPixel_) return;
314  // this is a pixel, and i *know* it is
315  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
316 
317  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
318 
319  if (cluster.id() != pixelSourceProdID) throw cms::Exception("Inconsistent Data") <<
320  "TrackClusterRemover: pixel cluster ref from Product ID = " << cluster.id() <<
321  " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
322 
323  assert(cluster.id() == pixelSourceProdID);
324 //DBG// cout << "HIT NEW PIXEL DETID = " << detid.rawId() << ", Cluster [ " << cluster.key().first << " / " << cluster.key().second << " ] " << endl;
325 
326  // if requested, cut on cluster size
327  if (pblocks_[subdet-1].usesSize_ && (cluster->pixels().size() > pblocks_[subdet-1].maxSize_)) return;
328 
329  // mark as used
330  pixels[cluster.key()] = false;
331 
332  //if(!clusterWasteSolution_) collectedPixel[detid.rawId()].insert(cluster);
333  assert(collectedPixels_.size() > cluster.key());
334  //assert(detid.rawId() == cluster->geographicalId()); //This condition fails
335  if(!clusterWasteSolution_) collectedPixels_[cluster.key()]=true;
336 
337  } else { // aka Strip
338  if (!doStrip_) return;
339  const type_info &hitType = typeid(*hit);
340  if (hitType == typeid(SiStripRecHit2D)) {
341  const SiStripRecHit2D *stripHit = static_cast<const SiStripRecHit2D *>(hit);
342 //DBG// cout << "Plain RecHit 2D: " << endl;
343  process(stripHit->omniClusterRef(),detid, true);}
344  else if (hitType == typeid(SiStripRecHit1D)) {
345  const SiStripRecHit1D *hit1D = static_cast<const SiStripRecHit1D *>(hit);
346  process(hit1D->omniClusterRef(),detid, true);
347  } else if (hitType == typeid(SiStripMatchedRecHit2D)) {
348  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
349 //DBG// cout << "Matched RecHit 2D: " << endl;
350  process(matchHit->monoClusterRef(),detid, true);
351  process(matchHit->stereoClusterRef(),detid, true);
352  } else if (hitType == typeid(ProjectedSiStripRecHit2D)) {
353  const ProjectedSiStripRecHit2D *projHit = static_cast<const ProjectedSiStripRecHit2D *>(hit);
354 //DBG// cout << "Projected RecHit 2D: " << endl;
355  process(projHit->originalHit().omniClusterRef(),detid, true);
356  } else throw cms::Exception("NOT IMPLEMENTED") << "Don't know how to handle " << hitType.name() << " on detid " << detid.rawId() << "\n";
357  }
358 }
359 
360 /* Schematic picture of n-th step Iterative removal
361  * (that os removing clusters after n-th step tracking)
362  * clusters: [ C1 ] -> [ C2 ] -> ... -> [ Cn ] -> [ Cn + 1 ]
363  * ^ ^ ^--- OUTPUT "new" ID
364  * |-- before any removal |----- Source clusters
365  * |-- OUTPUT "old" ID |----- Hits in Traj. point here
366  * | \----- Old ClusterRemovalInfo "new" ID
367  * \-- Old ClusterRemovalInfo "old" ID
368  */
369 
370 
371 void
373 {
374  ProductID pixelOldProdID, stripOldProdID;
375 
377  if (doPixel_) {
378  iEvent.getByToken(pixelClusters_, pixelClusters);
379  pixelSourceProdID = pixelClusters.id();
380  }
381 //DBG// std::cout << "TrackClusterRemover: Read pixel " << pixelClusters_.encode() << " = ID " << pixelSourceProdID << std::endl;
382 
384  if (doStrip_) {
385  iEvent.getByToken(stripClusters_, stripClusters);
386  stripSourceProdID = stripClusters.id();
387  }
388 //DBG// std::cout << "TrackClusterRemover: Read strip " << stripClusters_.encode() << " = ID " << stripSourceProdID << std::endl;
389 
390  auto_ptr<ClusterRemovalInfo> cri;
392  if (doStrip_ && doPixel_) cri.reset(new ClusterRemovalInfo(pixelClusters, stripClusters));
393  else if (doStrip_) cri.reset(new ClusterRemovalInfo(stripClusters));
394  else if (doPixel_) cri.reset(new ClusterRemovalInfo(pixelClusters));
395  }
396 
397  Handle<ClusterRemovalInfo> oldRemovalInfo;
399  iEvent.getByToken(oldRemovalInfo_, oldRemovalInfo);
400  // Check ProductIDs
401  if ( (oldRemovalInfo->stripNewRefProd().id() == stripClusters.id()) &&
402  (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.id()) ) {
403 
404  cri->getOldClustersFrom(*oldRemovalInfo);
405 
406  pixelOldProdID = oldRemovalInfo->pixelRefProd().id();
407  stripOldProdID = oldRemovalInfo->stripRefProd().id();
408 
409  } else {
410 
413  throw cms::Exception("Inconsistent Data") << "TrackClusterRemover: " <<
414  "Input collection product IDs are [pixel: " << pixelClusters.id() << ", strip: " << stripClusters.id() << "] \n" <<
415  "\t but the *old* ClusterRemovalInfo " << labels.productInstance << " refers as 'new product ids' to " <<
416  "[pixel: " << oldRemovalInfo->pixelNewRefProd().id() << ", strip: " << oldRemovalInfo->stripNewRefProd().id() << "]\n" <<
417  "NOTA BENE: when running TrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
418  }
419  } else { // then Old == Source
420  pixelOldProdID = pixelSourceProdID;
421  stripOldProdID = stripSourceProdID;
422  }
423 
424  if (doStrip_) {
425  strips.resize(stripClusters->dataSize()); fill(strips.begin(), strips.end(), true);
426  }
427  if (doPixel_) {
428  pixels.resize(pixelClusters->dataSize()); fill(pixels.begin(), pixels.end(), true);
429  }
430  if(mergeOld_) {
433  iEvent.getByToken(oldPxlMaskToken_ ,oldPxlMask);
434  iEvent.getByToken(oldStrMaskToken_ ,oldStrMask);
435  LogDebug("TrackClusterRemover")<<"to merge in, "<<oldStrMask->size()<<" strp and "<<oldPxlMask->size()<<" pxl";
436  oldStrMask->copyMaskTo(collectedStrips_);
437  oldPxlMask->copyMaskTo(collectedPixels_);
438  }else {
439  collectedStrips_.resize(stripClusters->dataSize()); fill(collectedStrips_.begin(), collectedStrips_.end(), false);
440  collectedPixels_.resize(pixelClusters->dataSize()); fill(collectedPixels_.begin(), collectedPixels_.end(), false);
441  }
442 
443  if (doTracks_) {
444 
445  Handle<TrajTrackAssociationCollection> trajectories_totrack;
446  iEvent.getByToken(trajectories_,trajectories_totrack);
447 
448  std::vector<Handle<edm::ValueMap<int> > > quals;
449  if ( overrideTrkQuals_.size() > 0) {
450  quals.resize(1);
451  iEvent.getByToken(overrideTrkQuals_[0],quals[0]);
452  }
453 
454  TrajTrackAssociationCollection::const_iterator asst=trajectories_totrack->begin();
455 
456  for ( ; asst!=trajectories_totrack->end();++asst){
457  const Track & track = *(asst->val);
458  if (filterTracks_) {
459  bool goodTk = true;
460  if ( quals.size()!=0) {
461  int qual=(*(quals[0]))[asst->val];
462  if ( qual < 0 ) {goodTk=false;}
463  //note that this does not work for some trackquals (goodIterative or undefQuality)
464  else
465  goodTk = ( qual & (1<<trackQuality_))>>trackQuality_;
466  }
467  else
468  goodTk=(track.quality(trackQuality_));
469  if ( !goodTk) continue;
471  }
472  const Trajectory &tj = *(asst->key);
473  const vector<TrajectoryMeasurement> &tms = tj.measurements();
474  vector<TrajectoryMeasurement>::const_iterator itm, endtm;
475  for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
476  const TrackingRecHit *hit = itm->recHit()->hit();
477  if (!hit->isValid()) continue;
478  process( hit, itm->estimate() );
479  }
480  }
481  }
482 
483  if (doStripChargeCheck_) {
485  iEvent.getByToken(rphiRecHitToken_, rechitsrphi);
486  const SiStripRecHit2DCollection::DataContainer * rphiRecHits = & (rechitsrphi).product()->data();
488  recHit = rphiRecHits->begin(); recHit!= rphiRecHits->end(); recHit++){
489  SiStripDetId detid = recHit->geographicalId();
490  process(recHit->omniClusterRef(),detid,false);
491  }
493  iEvent.getByToken(stereoRecHitToken_, rechitsstereo);
494  const SiStripRecHit2DCollection::DataContainer * stereoRecHits = & (rechitsstereo).product()->data();
496  recHit = stereoRecHits->begin(); recHit!= stereoRecHits->end(); recHit++){
497  SiStripDetId detid = recHit->geographicalId();
498  process(recHit->omniClusterRef(),detid,false);
499  }
500 
501  }
502 // if(doPixelChargeCheck_) {
503 // edm::Handle<SiPixelRecHitCollection> pixelrechits;
504 // iEvent.getByToken(pixelRecHitsToken_,pixelrechits);
505 // }
506 
508  auto_ptr<edmNew::DetSetVector<SiPixelCluster> > newPixelClusters = cleanup(*pixelClusters, pixels,
509  cri->pixelIndices(), mergeOld_ ? &oldRemovalInfo->pixelIndices() : 0);
510  OrphanHandle<edmNew::DetSetVector<SiPixelCluster> > newPixels = iEvent.put(newPixelClusters);
511 //DBG// std::cout << "TrackClusterRemover: Wrote pixel " << newPixels.id() << " from " << pixelSourceProdID << std::endl;
512  cri->setNewPixelClusters(newPixels);
513  }
515  auto_ptr<edmNew::DetSetVector<SiStripCluster> > newStripClusters = cleanup(*stripClusters, strips,
516  cri->stripIndices(), mergeOld_ ? &oldRemovalInfo->stripIndices() : 0);
517  OrphanHandle<edmNew::DetSetVector<SiStripCluster> > newStrips = iEvent.put(newStripClusters);
518 //DBG// std::cout << "TrackClusterRemover: Wrote strip " << newStrips.id() << " from " << stripSourceProdID << std::endl;
519  cri->setNewStripClusters(newStrips);
520  }
521 
522 
523  if (clusterWasteSolution_) {
524  // double fraction_pxl= cri->pixelIndices().size() / (double) pixels.size();
525  // double fraction_strp= cri->stripIndices().size() / (double) strips.size();
526  // edm::LogWarning("TrackClusterRemover")<<" fraction: " << fraction_pxl <<" "<<fraction_strp;
527  iEvent.put(cri);
528  }
529 
530  pixels.clear(); strips.clear();
531 
532  if (!clusterWasteSolution_){
533  //auto_ptr<edmNew::DetSetVector<SiPixelClusterRefNew> > removedPixelClsuterRefs(new edmNew::DetSetVector<SiPixelClusterRefNew>());
534  //auto_ptr<edmNew::DetSetVector<SiStripRecHit1D::ClusterRef> > removedStripClsuterRefs(new edmNew::DetSetVector<SiStripRecHit1D::ClusterRef>());
535 
536  std::auto_ptr<StripMaskContainer> removedStripClusterMask(
538  LogDebug("TrackClusterRemover")<<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true);
539  // std::cout << "TrackClusterRemover " <<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true) <<std::endl;
540  iEvent.put( removedStripClusterMask );
541 
542  std::auto_ptr<PixelMaskContainer> removedPixelClusterMask(
544  LogDebug("TrackClusterRemover")<<"total pxl to skip: "<<std::count(collectedPixels_.begin(),collectedPixels_.end(),true);
545  iEvent.put( removedPixelClusterMask );
546 
547  }
548 
549 
550 }
551 
#define LogDebug(id)
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
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
static const unsigned int NumberOfParamBlocks
edm::EDGetTokenT< SiStripRecHit2DCollection > stereoRecHitToken_
ParamBlock pblocks_[NumberOfParamBlocks]
std::vector< data_type > DataContainer
ProductID id() const
Definition: HandleBase.cc:15
ParamBlock(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
TrackQuality
track quality
Definition: TrackBase.h:93
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
OmniClusterRef const & stereoClusterRef() const
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
bool exists(std::string const &parameterName) const
checks if a parameter exists
void process(const TrackingRecHit *hit, float chi2)
reco::TrackBase::TrackQuality trackQuality_
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)
TrackClusterRemover(const edm::ParameterSet &iConfig)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
DataContainer const & measurements() const
Definition: Trajectory.h:203
int iEvent
Definition: GenABIO.cc:230
edm::ProductID stripSourceProdID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:740
ClusterStripRef cluster_strip() const
data_type const * data(size_t cell) const
float sensorThickness(const SiStripDetId &detid) const
std::vector< uint8_t > pixels
edm::EDGetTokenT< SiStripRecHit2DCollection > rphiRecHitToken_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:221
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
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< edmNew::DetSetVector< SiStripCluster > > stripClusters_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
std::vector< uint8_t > strips
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
key_type key() const
Accessor for product key.
Definition: Ref.h:266
std::vector< bool > collectedStrips_
bool isValid() const
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:375
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
size_type size() const
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > overrideTrkQuals_
edm::EDGetTokenT< TrajTrackAssociationCollection > trajectories_
edm::ProductID pixelSourceProdID
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
ModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:132
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
long double T
std::vector< bool > collectedPixels_
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)
const_iterator begin(bool update=false) const
Our base class.
Definition: SiPixelRecHit.h:23