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