CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SeedClusterRemover Class Reference
Inheritance diagram for SeedClusterRemover:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Classes

struct  ParamBlock
 

Public Member Functions

template<typename T >
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)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 SeedClusterRemover (const edm::ParameterSet &iConfig)
 
 ~SeedClusterRemover ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

template<typename T >
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)
 
void mergeOld (reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
 
void process (const TrackingRecHit *hit, float chi2)
 
void process (const OmniClusterRef &cluRef, uint32_t subdet)
 
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)
 

Private Attributes

bool clusterWasteSolution_
 
std::vector< bool > collectedPixels_
 
std::vector< bool > collectedStrips_
 
bool doPixel_
 
bool doStrip_
 
bool filterTracks_
 
bool mergeOld_
 
edm::InputTag oldRemovalInfo_
 
std::vector< edm::InputTagoverrideTrkQuals_
 
ParamBlock pblocks_ [NumberOfParamBlocks]
 
edm::InputTag pixelClusters_
 
std::vector< uint8_t > pixels
 
edm::ProductID pixelSourceProdID
 
edm::InputTag stripClusters_
 
std::vector< uint8_t > strips
 
edm::ProductID stripSourceProdID
 
reco::TrackBase::TrackQuality trackQuality_
 
edm::InputTag trajectories_
 

Static Private Attributes

static const unsigned int NumberOfParamBlocks = 6
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 38 of file SeedClusterRemover.cc.

Constructor & Destructor Documentation

SeedClusterRemover::SeedClusterRemover ( const edm::ParameterSet iConfig)

Definition at line 116 of file SeedClusterRemover.cc.

References clusterWasteSolution_, doPixel_, doStrip_, edm::hlt::Exception, edm::ParameterSet::exists(), lumiContext::fill, filterTracks_, edm::ParameterSet::getParameter(), i, NumberOfParamBlocks, overrideTrkQuals_, pblocks_, reco::TrackBase::qualityByName(), readPSet(), trackQuality_, and reco::TrackBase::undefQuality.

116  :
117  trajectories_(iConfig.getParameter<InputTag>("trajectories")),
118  doStrip_(iConfig.existsAs<bool>("doStrip") ? iConfig.getParameter<bool>("doStrip") : true),
119  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
120  stripClusters_(doStrip_ ? iConfig.getParameter<InputTag>("stripClusters") : InputTag("NONE")),
121  pixelClusters_(doPixel_ ? iConfig.getParameter<InputTag>("pixelClusters") : InputTag("NONE")),
122  mergeOld_(iConfig.exists("oldClusterRemovalInfo")),
123  oldRemovalInfo_(mergeOld_ ? iConfig.getParameter<InputTag>("oldClusterRemovalInfo") : InputTag("NONE")),
125 {
126  if (iConfig.exists("overrideTrkQuals"))
127  overrideTrkQuals_.push_back(iConfig.getParameter<edm::InputTag>("overrideTrkQuals"));
128  if (iConfig.exists("clusterLessSolution"))
129  clusterWasteSolution_=!iConfig.getParameter<bool>("clusterLessSolution");
130  if (doPixel_ && clusterWasteSolution_) produces< edmNew::DetSetVector<SiPixelCluster> >();
131  if (doStrip_ && clusterWasteSolution_) produces< edmNew::DetSetVector<SiStripCluster> >();
132  if (clusterWasteSolution_) produces< ClusterRemovalInfo >();
133 
134  fill(pblocks_, pblocks_+NumberOfParamBlocks, ParamBlock());
135  readPSet(iConfig, "Common",-1);
136  if (doPixel_) {
137  readPSet(iConfig, "Pixel" ,0,1);
138  readPSet(iConfig, "PXB" ,0);
139  readPSet(iConfig, "PXE" ,1);
140  }
141  if (doStrip_) {
142  readPSet(iConfig, "Strip" ,2,3,4,5);
143  readPSet(iConfig, "StripInner" ,2,3);
144  readPSet(iConfig, "StripOuter" ,4,5);
145  readPSet(iConfig, "TIB" ,2);
146  readPSet(iConfig, "TID" ,3);
147  readPSet(iConfig, "TOB" ,4);
148  readPSet(iConfig, "TEC" ,5);
149  }
150 
151  bool usingCharge = false;
152  for (size_t i = 0; i < NumberOfParamBlocks; ++i) {
153  if (!pblocks_[i].isSet_) throw cms::Exception("Configuration Error") << "SeedClusterRemover: Missing configuration for detector with subDetID = " << (i+1);
154  if (pblocks_[i].usesCharge_ && !usingCharge) {
155  throw cms::Exception("Configuration Error") << "SeedClusterRemover: Configuration for subDetID = " << (i+1) << " uses cluster charge, which is not enabled.";
156  }
157  }
158 
159  if (!clusterWasteSolution_){
160  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
161  produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
162  }
164  filterTracks_=false;
165  if (iConfig.exists("TrackQuality")){
166  filterTracks_=true;
167  trackQuality_=reco::TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality"));
168  }
169 
170 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
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:187
edm::InputTag oldRemovalInfo_
static const unsigned int NumberOfParamBlocks
edm::InputTag trajectories_
edm::InputTag stripClusters_
bool exists(std::string const &parameterName) const
checks if a parameter exists
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)
ParamBlock pblocks_[NumberOfParamBlocks]
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
std::vector< edm::InputTag > overrideTrkQuals_
edm::InputTag pixelClusters_
reco::TrackBase::TrackQuality trackQuality_
SeedClusterRemover::~SeedClusterRemover ( )

Definition at line 173 of file SeedClusterRemover.cc.

174 {
175 }

Member Function Documentation

template<typename T >
std::auto_ptr<edmNew::DetSetVector<T> > SeedClusterRemover::cleanup ( const edmNew::DetSetVector< T > &  oldClusters,
const std::vector< uint8_t > &  isGood,
reco::ClusterRemovalInfo::Indices refs,
const reco::ClusterRemovalInfo::Indices oldRefs 
)
private

Referenced by produce().

template<typename T >
auto_ptr<edmNew::DetSetVector<T> > SeedClusterRemover::cleanup ( const edmNew::DetSetVector< T > &  oldClusters,
const std::vector< uint8_t > &  isGood,
reco::ClusterRemovalInfo::Indices refs,
const reco::ClusterRemovalInfo::Indices oldRefs 
)

Definition at line 188 of file SeedClusterRemover.cc.

References edmNew::DetSetVector< T >::begin(), edmNew::DetSetVector< T >::data(), edmNew::DetSetVector< T >::dataSize(), edmNew::DetSetVector< T >::end(), getHLTprescales::index, mergeOld(), convertSQLitetoXML_cfg::output, and edmNew::DetSetVector< T >::size().

189  {
190  typedef typename edmNew::DetSetVector<T> DSV;
191  typedef typename edmNew::DetSetVector<T>::FastFiller DSF;
192  typedef typename edmNew::DetSet<T> DS;
193  auto_ptr<DSV> output(new DSV());
194  output->reserve(oldClusters.size(), oldClusters.dataSize());
195 
196  unsigned int countOld=0;
197  unsigned int countNew=0;
198 
199  // cluster removal loop
200  const T * firstOffset = & oldClusters.data().front();
201  for (typename DSV::const_iterator itdet = oldClusters.begin(), enddet = oldClusters.end(); itdet != enddet; ++itdet) {
202  DS oldDS = *itdet;
203 
204  if (oldDS.empty()) continue; // skip empty detsets
205 
206  uint32_t id = oldDS.detId();
207  DSF outds(*output, id);
208 
209  for (typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
210  uint32_t index = ((&*it) - firstOffset);
211  countOld++;
212  if (isGood[index]) {
213  outds.push_back(*it);
214  countNew++;
215  refs.push_back(index);
216  //std::cout << "SeedClusterRemover::cleanup " << typeid(T).name() << " reference " << index << " to " << (refs.size() - 1) << std::endl;
217  }
218 
219  }
220  if (outds.empty()) outds.abort(); // not write in an empty DSV
221  }
222 
223  if (oldRefs != 0) mergeOld(refs, *oldRefs);
224  return output;
225 }
const_iterator begin() const
size_type dataSize() const
data_type const * data(size_t cell) const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
const_iterator end() const
size_type size() const
long double T
void SeedClusterRemover::mergeOld ( reco::ClusterRemovalInfo::Indices refs,
const reco::ClusterRemovalInfo::Indices oldRefs 
)
private

Definition at line 177 of file SeedClusterRemover.cc.

References i, and n.

Referenced by cleanup().

179 {
180  for (size_t i = 0, n = refs.size(); i < n; ++i) {
181  refs[i] = oldRefs[refs[i]];
182  }
183 }
int i
Definition: DBlmapReader.cc:9
void SeedClusterRemover::process ( const TrackingRecHit hit,
float  chi2 
)
inlineprivate

Definition at line 245 of file SeedClusterRemover.cc.

References SiPixelRecHit::cluster(), clusterWasteSolution_, collectedPixels_, cond::rpcobgas::detid, doPixel_, doStrip_, edm::hlt::Exception, TrackingRecHit::geographicalId(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::key(), SeedClusterRemover::ParamBlock::maxSize_, SiStripMatchedRecHit2D::monoClusterRef(), NumberOfParamBlocks, TrackerSingleRecHit::omniClusterRef(), ProjectedSiStripRecHit2D::originalHit(), pblocks_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pixels, pixelSourceProdID, DetId::rawId(), SiStripMatchedRecHit2D::stereoClusterRef(), and DetId::subdetId().

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), and produce().

245  {
246  DetId detid = hit->geographicalId();
247  uint32_t subdet = detid.subdetId();
248 
249  assert ((subdet > 0) && (subdet <= NumberOfParamBlocks));
250 
251  // chi2 cut
252  if (chi2 > pblocks_[subdet-1].maxChi2_) return;
253 
254  if ((subdet == PixelSubdetector::PixelBarrel) || (subdet == PixelSubdetector::PixelEndcap)) {
255  if (!doPixel_) return;
256  // this is a pixel, and i *know* it is
257  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
258 
259  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
260 
261  if (cluster.id() != pixelSourceProdID) throw cms::Exception("Inconsistent Data") <<
262  "SeedClusterRemover: pixel cluster ref from Product ID = " << cluster.id() <<
263  " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
264 
265  assert(cluster.id() == pixelSourceProdID);
266 //DBG// cout << "HIT NEW PIXEL DETID = " << detid.rawId() << ", Cluster [ " << cluster.key().first << " / " << cluster.key().second << " ] " << endl;
267 
268  // if requested, cut on cluster size
269  if (pblocks_[subdet-1].usesSize_ && (cluster->pixels().size() > pblocks_[subdet-1].maxSize_)) return;
270 
271  // mark as used
272  pixels[cluster.key()] = false;
273 
274  //if(!clusterWasteSolution_) collectedPixel[detid.rawId()].insert(cluster);
275  assert(collectedPixels_.size() > cluster.key());
276  //assert(detid.rawId() == cluster->geographicalId()); //This condition fails
277  if(!clusterWasteSolution_) collectedPixels_[cluster.key()]=true;
278 
279  } else { // aka Strip
280  if (!doStrip_) return;
281  const type_info &hitType = typeid(*hit);
282  if (hitType == typeid(SiStripRecHit2D)) {
283  const SiStripRecHit2D *stripHit = static_cast<const SiStripRecHit2D *>(hit);
284 //DBG// cout << "Plain RecHit 2D: " << endl;
285  process(stripHit->omniClusterRef(),subdet);}
286  else if (hitType == typeid(SiStripRecHit1D)) {
287  const SiStripRecHit1D *hit1D = static_cast<const SiStripRecHit1D *>(hit);
288  process(hit1D->omniClusterRef(),subdet);
289  } else if (hitType == typeid(SiStripMatchedRecHit2D)) {
290  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
291 //DBG// cout << "Matched RecHit 2D: " << endl;
292  process(matchHit->monoClusterRef(),subdet);
293  process(matchHit->stereoClusterRef(),subdet);
294  } else if (hitType == typeid(ProjectedSiStripRecHit2D)) {
295  const ProjectedSiStripRecHit2D *projHit = static_cast<const ProjectedSiStripRecHit2D *>(hit);
296 //DBG// cout << "Projected RecHit 2D: " << endl;
297  process(projHit->originalHit().omniClusterRef(),subdet);
298  } else throw cms::Exception("NOT IMPLEMENTED") << "Don't know how to handle " << hitType.name() << " on detid " << detid.rawId() << "\n";
299  }
300 }
static const unsigned int NumberOfParamBlocks
void process(const TrackingRecHit *hit, float chi2)
OmniClusterRef const & stereoClusterRef() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
edm::ProductID pixelSourceProdID
ParamBlock pblocks_[NumberOfParamBlocks]
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:39
Definition: DetId.h:20
OmniClusterRef const & omniClusterRef() const
ClusterRef cluster() const
Definition: SiPixelRecHit.h:41
key_type key() const
Accessor for product key.
Definition: Ref.h:266
std::vector< bool > collectedPixels_
std::vector< uint8_t > pixels
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
DetId geographicalId() const
const SiStripRecHit2D & originalHit() const
Our base class.
Definition: SiPixelRecHit.h:22
void SeedClusterRemover::process ( const OmniClusterRef cluRef,
uint32_t  subdet 
)
inlineprivate

Definition at line 228 of file SeedClusterRemover.cc.

References OmniClusterRef::cluster_strip(), clusterWasteSolution_, collectedStrips_, edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::key(), SeedClusterRemover::ParamBlock::maxSize_, pblocks_, strips, and stripSourceProdID.

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave().

228  {
229  SiStripRecHit2D::ClusterRef cluster = ocluster.cluster_strip();
230  if (cluster.id() != stripSourceProdID) throw cms::Exception("Inconsistent Data") <<
231  "SeedClusterRemover: strip cluster ref from Product ID = " << cluster.id() <<
232  " does not match with source cluster collection (ID = " << stripSourceProdID << ")\n.";
233 
234  assert(cluster.id() == stripSourceProdID);
235  if (pblocks_[subdet-1].usesSize_ && (cluster->amplitudes().size() > pblocks_[subdet-1].maxSize_)) return;
236 
237  strips[cluster.key()] = false;
238  //if (!clusterWasteSolution_) collectedStrip[hit->geographicalId()].insert(cluster);
239  assert(collectedStrips_.size() > cluster.key());
240  //assert(hit->geographicalId() == cluster->geographicalId()); //This condition fails
241  if (!clusterWasteSolution_) collectedStrips_[cluster.key()]=true;
242 }
std::vector< bool > collectedStrips_
ParamBlock pblocks_[NumberOfParamBlocks]
edm::ProductID stripSourceProdID
key_type key() const
Accessor for product key.
Definition: Ref.h:266
std::vector< uint8_t > strips
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
void SeedClusterRemover::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 314 of file SeedClusterRemover.cc.

References cleanup(), clusterWasteSolution_, collectedPixels_, collectedStrips_, prof2calltree::count, doPixel_, doStrip_, edm::InputTag::encode(), edm::hlt::Exception, lumiContext::fill, edm::Event::getByLabel(), edm::HandleBase::id(), LogDebug, mergeOld_, oldRemovalInfo_, clustersummaryproducer_cfg::pixelClusters, pixelClusters_, pixels, pixelSourceProdID, process(), edm::Event::put(), edm::ProductID::reset(), clustersummaryproducer_cfg::stripClusters, stripClusters_, strips, stripSourceProdID, and trajectories_.

315 {
316  ProductID pixelOldProdID, stripOldProdID;
317 
319  if (doPixel_) {
320  iEvent.getByLabel(pixelClusters_, pixelClusters);
321  pixelSourceProdID = pixelClusters.id();
322  }
323 //DBG// std::cout << "SeedClusterRemover: Read pixel " << pixelClusters_.encode() << " = ID " << pixelSourceProdID << std::endl;
324 
326  if (doStrip_) {
327  iEvent.getByLabel(stripClusters_, stripClusters);
328  stripSourceProdID = stripClusters.id();
329  }
330 //DBG// std::cout << "SeedClusterRemover: Read strip " << stripClusters_.encode() << " = ID " << stripSourceProdID << std::endl;
331 
332  auto_ptr<ClusterRemovalInfo> cri;
334  if (doStrip_ && doPixel_) cri.reset(new ClusterRemovalInfo(pixelClusters, stripClusters));
335  else if (doStrip_) cri.reset(new ClusterRemovalInfo(stripClusters));
336  else if (doPixel_) cri.reset(new ClusterRemovalInfo(pixelClusters));
337  }
338 
339  Handle<ClusterRemovalInfo> oldRemovalInfo;
341  iEvent.getByLabel(oldRemovalInfo_, oldRemovalInfo);
342  // Check ProductIDs
343  if ( (oldRemovalInfo->stripNewRefProd().id() == stripClusters.id()) &&
344  (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.id()) ) {
345 
346  cri->getOldClustersFrom(*oldRemovalInfo);
347 
348  pixelOldProdID = oldRemovalInfo->pixelRefProd().id();
349  stripOldProdID = oldRemovalInfo->stripRefProd().id();
350 
351  } else {
352  throw cms::Exception("Inconsistent Data") << "SeedClusterRemover: " <<
353  "Input collection product IDs are [pixel: " << pixelClusters.id() << ", strip: " << stripClusters.id() << "] \n" <<
354  "\t but the *old* ClusterRemovalInfo " << oldRemovalInfo_.encode() << " refers as 'new product ids' to " <<
355  "[pixel: " << oldRemovalInfo->pixelNewRefProd().id() << ", strip: " << oldRemovalInfo->stripNewRefProd().id() << "]\n" <<
356  "NOTA BENE: when running SeedClusterRemover with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
357  }
358  } else { // then Old == Source
359  pixelOldProdID = pixelSourceProdID;
360  stripOldProdID = stripSourceProdID;
361  }
362 
363  if (doStrip_) {
364  strips.resize(stripClusters->dataSize()); fill(strips.begin(), strips.end(), true);
365  }
366  if (doPixel_) {
367  pixels.resize(pixelClusters->dataSize()); fill(pixels.begin(), pixels.end(), true);
368  }
369  typedef edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > PixelMaskContainer;
370  typedef edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > StripMaskContainer;
371  if(mergeOld_) {
374  iEvent.getByLabel(oldRemovalInfo_,oldPxlMask);
375  iEvent.getByLabel(oldRemovalInfo_,oldStrMask);
376  LogDebug("SeedClusterRemover")<<"to merge in, "<<oldStrMask->size()<<" strp and "<<oldPxlMask->size()<<" pxl";
377  oldStrMask->copyMaskTo(collectedStrips_);
378  oldPxlMask->copyMaskTo(collectedPixels_);
379  }else {
380  collectedStrips_.resize(stripClusters->dataSize()); fill(collectedStrips_.begin(), collectedStrips_.end(), false);
381  collectedPixels_.resize(pixelClusters->dataSize()); fill(collectedPixels_.begin(), collectedPixels_.end(), false);
382  }
383 
384 
386  iEvent.getByLabel(trajectories_,seeds);
387 
388  TrajectorySeedCollection::const_iterator seed=seeds->begin();
389 
390  for (;seed!=seeds->end();++seed){
391  TrajectorySeed::range hits=seed->recHits();
393  for (;hit!=hits.second;++hit){
394  if (!hit->isValid()) continue;
395  process( &(*hit), 0. );
396  }
397  }
398 
399 
401  auto_ptr<edmNew::DetSetVector<SiPixelCluster> > newPixelClusters = cleanup(*pixelClusters, pixels,
402  cri->pixelIndices(), mergeOld_ ? &oldRemovalInfo->pixelIndices() : 0);
403  OrphanHandle<edmNew::DetSetVector<SiPixelCluster> > newPixels = iEvent.put(newPixelClusters);
404 //DBG// std::cout << "SeedClusterRemover: Wrote pixel " << newPixels.id() << " from " << pixelSourceProdID << std::endl;
405  cri->setNewPixelClusters(newPixels);
406  }
408  auto_ptr<edmNew::DetSetVector<SiStripCluster> > newStripClusters = cleanup(*stripClusters, strips,
409  cri->stripIndices(), mergeOld_ ? &oldRemovalInfo->stripIndices() : 0);
410  OrphanHandle<edmNew::DetSetVector<SiStripCluster> > newStrips = iEvent.put(newStripClusters);
411 //DBG// std::cout << "SeedClusterRemover: Wrote strip " << newStrips.id() << " from " << stripSourceProdID << std::endl;
412  cri->setNewStripClusters(newStrips);
413  }
414 
415 
416  if (clusterWasteSolution_) {
417  // double fraction_pxl= cri->pixelIndices().size() / (double) pixels.size();
418  // double fraction_strp= cri->stripIndices().size() / (double) strips.size();
419  // edm::LogWarning("SeedClusterRemover")<<" fraction: " << fraction_pxl <<" "<<fraction_strp;
420  iEvent.put(cri);
421  }
422 
423  pixels.clear(); strips.clear();
424 
425  if (!clusterWasteSolution_){
426  //auto_ptr<edmNew::DetSetVector<SiPixelClusterRefNew> > removedPixelClsuterRefs(new edmNew::DetSetVector<SiPixelClusterRefNew>());
427  //auto_ptr<edmNew::DetSetVector<SiStripRecHit1D::ClusterRef> > removedStripClsuterRefs(new edmNew::DetSetVector<SiStripRecHit1D::ClusterRef>());
428 
429  std::auto_ptr<StripMaskContainer> removedStripClusterMask(
430  new StripMaskContainer(edm::RefProd<edmNew::DetSetVector<SiStripCluster> >(stripClusters),collectedStrips_));
431  LogDebug("SeedClusterRemover")<<"total strip to skip: "<<std::count(collectedStrips_.begin(),collectedStrips_.end(),true);
432  iEvent.put( removedStripClusterMask );
433 
434  std::auto_ptr<PixelMaskContainer> removedPixelClusterMask(
435  new PixelMaskContainer(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),collectedPixels_));
436  LogDebug("SeedClusterRemover")<<"total pxl to skip: "<<std::count(collectedPixels_.begin(),collectedPixels_.end(),true);
437  iEvent.put( removedPixelClusterMask );
438 
439  }
440 
441 
442 }
#define LogDebug(id)
string fill
Definition: lumiContext.py:319
edm::InputTag oldRemovalInfo_
ProductID id() const
Definition: HandleBase.cc:15
void process(const TrackingRecHit *hit, float chi2)
edm::InputTag trajectories_
edm::InputTag stripClusters_
std::string encode() const
Definition: InputTag.cc:72
std::vector< bool > collectedStrips_
edm::ProductID pixelSourceProdID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::ProductID stripSourceProdID
void reset()
Definition: ProductID.h:39
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)
std::vector< uint8_t > strips
edm::InputTag pixelClusters_
std::vector< bool > collectedPixels_
std::vector< uint8_t > pixels
void SeedClusterRemover::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 
)
private

Definition at line 98 of file SeedClusterRemover.cc.

References edm::ParameterSet::exists(), lumiContext::fill, and edm::ParameterSet::getParameter().

Referenced by SeedClusterRemover().

100 {
101  if (iConfig.exists(name)) {
102  ParamBlock pblock(iConfig.getParameter<ParameterSet>(name));
103  if (id1 == -1) {
105  } else {
106  pblocks_[id1] = pblock;
107  if (id2 != -1) pblocks_[id2] = pblock;
108  if (id3 != -1) pblocks_[id3] = pblock;
109  if (id4 != -1) pblocks_[id4] = pblock;
110  if (id5 != -1) pblocks_[id5] = pblock;
111  if (id6 != -1) pblocks_[id6] = pblock;
112  }
113  }
114 }
T getParameter(std::string const &) const
string fill
Definition: lumiContext.py:319
static const unsigned int NumberOfParamBlocks
bool exists(std::string const &parameterName) const
checks if a parameter exists
ParamBlock pblocks_[NumberOfParamBlocks]

Member Data Documentation

bool SeedClusterRemover::clusterWasteSolution_
private

Definition at line 85 of file SeedClusterRemover.cc.

Referenced by process(), produce(), and SeedClusterRemover().

std::vector<bool> SeedClusterRemover::collectedPixels_
private

Definition at line 89 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

std::vector<bool> SeedClusterRemover::collectedStrips_
private

Definition at line 88 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

bool SeedClusterRemover::doPixel_
private

Definition at line 61 of file SeedClusterRemover.cc.

Referenced by process(), produce(), and SeedClusterRemover().

bool SeedClusterRemover::doStrip_
private

Definition at line 61 of file SeedClusterRemover.cc.

Referenced by process(), produce(), and SeedClusterRemover().

bool SeedClusterRemover::filterTracks_
private

Definition at line 86 of file SeedClusterRemover.cc.

Referenced by SeedClusterRemover().

bool SeedClusterRemover::mergeOld_
private

Definition at line 63 of file SeedClusterRemover.cc.

Referenced by produce().

const unsigned int SeedClusterRemover::NumberOfParamBlocks = 6
staticprivate

Definition at line 57 of file SeedClusterRemover.cc.

Referenced by process(), and SeedClusterRemover().

edm::InputTag SeedClusterRemover::oldRemovalInfo_
private

Definition at line 64 of file SeedClusterRemover.cc.

Referenced by produce().

std::vector<edm::InputTag> SeedClusterRemover::overrideTrkQuals_
private

Definition at line 60 of file SeedClusterRemover.cc.

Referenced by SeedClusterRemover().

ParamBlock SeedClusterRemover::pblocks_[NumberOfParamBlocks]
private

Definition at line 66 of file SeedClusterRemover.cc.

Referenced by process(), and SeedClusterRemover().

edm::InputTag SeedClusterRemover::pixelClusters_
private

Definition at line 62 of file SeedClusterRemover.cc.

Referenced by produce().

std::vector<uint8_t> SeedClusterRemover::pixels
private

Definition at line 70 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

edm::ProductID SeedClusterRemover::pixelSourceProdID
private

Definition at line 71 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

edm::InputTag SeedClusterRemover::stripClusters_
private

Definition at line 62 of file SeedClusterRemover.cc.

Referenced by produce().

std::vector<uint8_t> SeedClusterRemover::strips
private

Definition at line 70 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

edm::ProductID SeedClusterRemover::stripSourceProdID
private

Definition at line 71 of file SeedClusterRemover.cc.

Referenced by process(), and produce().

reco::TrackBase::TrackQuality SeedClusterRemover::trackQuality_
private

Definition at line 87 of file SeedClusterRemover.cc.

Referenced by SeedClusterRemover().

edm::InputTag SeedClusterRemover::trajectories_
private

Definition at line 59 of file SeedClusterRemover.cc.

Referenced by produce().