CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SeedClusterRemoverPhase2 Class Reference
Inheritance diagram for SeedClusterRemoverPhase2:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SeedClusterRemoverPhase2 (const edm::ParameterSet &iConfig)
 
 ~SeedClusterRemoverPhase2 ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef edm::ContainerMask< edmNew::DetSetVector< Phase2TrackerCluster1D > > Phase2OTMaskContainer
 
typedef edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMaskContainer
 

Private Member Functions

template<typename T >
std::unique_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, const TrackerGeometry *tg)
 

Private Attributes

bool clusterWasteSolution_
 
std::vector< bool > collectedOuterTrackers_
 
std::vector< bool > collectedPixels_
 
bool doOuterTracker_
 
bool doPixel_
 
bool filterTracks_
 
bool mergeOld_
 
edm::EDGetTokenT< Phase2OTMaskContaineroldPh2OTMaskToken_
 
edm::EDGetTokenT< PixelMaskContaineroldPxlMaskToken_
 
edm::EDGetTokenT< reco::ClusterRemovalInfooldRemovalInfo_
 
std::vector< uint8_t > OTs
 
edm::ProductID outerTrackerSourceProdID
 
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
 
std::vector< uint8_t > pixels
 
edm::ProductID pixelSourceProdID
 
reco::TrackBase::TrackQuality trackQuality_
 
edm::EDGetTokenT< TrajectorySeedCollectiontrajectories_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 39 of file SeedClusterRemoverPhase2.cc.

Member Typedef Documentation

Definition at line 49 of file SeedClusterRemoverPhase2.cc.

Definition at line 48 of file SeedClusterRemoverPhase2.cc.

Constructor & Destructor Documentation

SeedClusterRemoverPhase2::SeedClusterRemoverPhase2 ( const edm::ParameterSet iConfig)

Definition at line 82 of file SeedClusterRemoverPhase2.cc.

References clusterWasteSolution_, doOuterTracker_, doPixel_, edm::ParameterSet::exists(), filterTracks_, edm::ParameterSet::getParameter(), mergeOld_, oldPh2OTMaskToken_, oldPxlMaskToken_, oldRemovalInfo_, phase2OTClusters_, pixelClusters_, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, trackQuality_, trajectories_, and reco::TrackBase::undefQuality.

82  :
83  doOuterTracker_(iConfig.existsAs<bool>("doOuterTracker") ? iConfig.getParameter<bool>("doOuterTracker") : true),
84  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
85  mergeOld_(iConfig.exists("oldClusterRemovalInfo")),
87 {
88  if (iConfig.exists("clusterLessSolution"))
89  clusterWasteSolution_=!iConfig.getParameter<bool>("clusterLessSolution");
90  if (doPixel_ && clusterWasteSolution_) produces< edmNew::DetSetVector<SiPixelCluster> >();
91  if (doOuterTracker_ && clusterWasteSolution_) produces< edmNew::DetSetVector<Phase2TrackerCluster1D> >();
92  if (clusterWasteSolution_) produces< ClusterRemovalInfo >();
93 
95  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
96  produces<edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D> > >();
97  }
99  filterTracks_=false;
100  if (iConfig.exists("TrackQuality")){
101  filterTracks_=true;
102  trackQuality_=reco::TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality"));
103  }
104 
105  trajectories_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<InputTag>("trajectories"));
106  if (doPixel_) pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
107  if (doOuterTracker_) phase2OTClusters_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(iConfig.getParameter<InputTag>("phase2OTClusters"));
108  if (mergeOld_) {
109  oldRemovalInfo_ = consumes<ClusterRemovalInfo>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
110  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
111  oldPh2OTMaskToken_ = consumes<Phase2OTMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
112  }
113 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
reco::TrackBase::TrackQuality trackQuality_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_
SeedClusterRemoverPhase2::~SeedClusterRemoverPhase2 ( )

Definition at line 116 of file SeedClusterRemoverPhase2.cc.

117 {
118 }

Member Function Documentation

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

Definition at line 131 of file SeedClusterRemoverPhase2.cc.

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

Referenced by produce().

132  {
133  typedef typename edmNew::DetSetVector<T> DSV;
134  typedef typename edmNew::DetSetVector<T>::FastFiller DSF;
135  typedef typename edmNew::DetSet<T> DS;
136  auto output = std::make_unique<DSV>();
137  output->reserve(oldClusters.size(), oldClusters.dataSize());
138 
139  unsigned int countOld=0;
140  unsigned int countNew=0;
141 
142  // cluster removal loop
143  const T * firstOffset = & oldClusters.data().front();
144  for (typename DSV::const_iterator itdet = oldClusters.begin(), enddet = oldClusters.end(); itdet != enddet; ++itdet) {
145  DS oldDS = *itdet;
146 
147  if (oldDS.empty()) continue; // skip empty detsets
148 
149  uint32_t id = oldDS.detId();
150  DSF outds(*output, id);
151 
152  for (typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
153  uint32_t index = ((&*it) - firstOffset);
154  countOld++;
155  if (isGood[index]) {
156  outds.push_back(*it);
157  countNew++;
158  refs.push_back(index);
159  LogDebug("SeedClusterRemoverPhase2") << "SeedClusterRemoverPhase2::cleanup " << typeid(T).name() << " reference " << index << " to " << (refs.size() - 1);
160  }
161 
162  }
163  if (outds.empty()) outds.abort(); // not write in an empty DSV
164  }
165 
166  if (oldRefs != 0) mergeOld(refs, *oldRefs);
167  return output;
168 }
#define LogDebug(id)
const_iterator end(bool update=false) const
size_type dataSize() const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
data_type const * data(size_t cell) const
size_type size() const
long double T
const_iterator begin(bool update=false) const
void SeedClusterRemoverPhase2::mergeOld ( reco::ClusterRemovalInfo::Indices refs,
const reco::ClusterRemovalInfo::Indices oldRefs 
)
private

Definition at line 120 of file SeedClusterRemoverPhase2.cc.

References mps_fire::i, and gen::n.

Referenced by cleanup().

122 {
123  for (size_t i = 0, n = refs.size(); i < n; ++i) {
124  refs[i] = oldRefs[refs[i]];
125  }
126 }
void SeedClusterRemoverPhase2::process ( const TrackingRecHit hit,
float  chi2,
const TrackerGeometry tg 
)
inlineprivate

Definition at line 173 of file SeedClusterRemoverPhase2.cc.

References Phase2TrackerRecHit1D::cluster(), SiPixelRecHit::cluster(), clusterWasteSolution_, collectedOuterTrackers_, collectedPixels_, doOuterTracker_, doPixel_, Exception, TrackingRecHit::geographicalId(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::key(), LogDebug, OTs, outerTrackerSourceProdID, pixels, pixelSourceProdID, DetId::rawId(), and DetId::subdetId().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), produce(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

173  {
174 
175  DetId detid = hit->geographicalId();
176  uint32_t subdet = detid.subdetId();
177 
178  assert(subdet > 0);
179 
180  const type_info &hitType = typeid(*hit);
181  if (hitType == typeid(SiPixelRecHit)) {
182 
183  if(!doPixel_) return;
184 
185  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
186  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
187  LogDebug("SeedClusterRemoverPhase2") << "Plain Pixel RecHit in det " << detid.rawId();
188 
189  if (cluster.id() != pixelSourceProdID) throw cms::Exception("Inconsistent Data") <<
190  "SeedClusterRemoverPhase2: pixel cluster ref from Product ID = " << cluster.id() <<
191  " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
192 
193  assert(cluster.id() == pixelSourceProdID);
194 
195  // mark as used
196  pixels[cluster.key()] = false;
197 
198  assert(collectedPixels_.size() > cluster.key());
199  if(!clusterWasteSolution_) collectedPixels_[cluster.key()]=true;
200 
201  } else if (hitType == typeid(Phase2TrackerRecHit1D)) {
202 
203  if(!doOuterTracker_) return;
204 
205  const Phase2TrackerRecHit1D *ph2OThit = static_cast<const Phase2TrackerRecHit1D*>(hit);
206  LogDebug("SeedClusterRemoverPhase2") << "Plain Phase2TrackerRecHit1D in det " << detid.rawId();
207 
208  Phase2TrackerRecHit1D::CluRef cluster = ph2OThit->cluster();
209  if (cluster.id() != outerTrackerSourceProdID) throw cms::Exception("Inconsistent Data") <<
210  "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() <<
211  " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
212 
213  assert(cluster.id() == outerTrackerSourceProdID);
214 
215  OTs[cluster.key()] = false;
216  assert(collectedOuterTrackers_.size() > cluster.key());
217  if (!clusterWasteSolution_) collectedOuterTrackers_[cluster.key()]=true;
218 
219  } else throw cms::Exception("NOT IMPLEMENTED") << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name() << " on detid " << detid.rawId() << "\n";
220 
221 
222 }
#define LogDebug(id)
std::vector< bool > collectedPixels_
std::vector< bool > collectedOuterTrackers_
key_type key() const
Accessor for product key.
Definition: Ref.h:265
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
DetId geographicalId() const
Our base class.
Definition: SiPixelRecHit.h:23
void SeedClusterRemoverPhase2::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 225 of file SeedClusterRemoverPhase2.cc.

References cleanup(), clusterWasteSolution_, collectedOuterTrackers_, collectedPixels_, edm::ContainerMask< T >::copyMaskTo(), KineDebug3::count(), DEFINE_FWK_MODULE, doOuterTracker_, doPixel_, Exception, lumiContext::fill, edm::EventSetup::get(), edm::Event::getByToken(), hfClusterShapes_cfi::hits, edm::ProductID::id(), edm::OrphanHandleBase::id(), edm::HandleBase::id(), tablePrinter::labels, edm::EDConsumerBase::labelsForToken(), LogDebug, mergeOld_, eostools::move(), oldPh2OTMaskToken_, oldPxlMaskToken_, oldRemovalInfo_, OTs, outerTrackerSourceProdID, seedClusterRemoverPhase2_cfi::phase2OTClusters, phase2OTClusters_, HiRegitMuonDetachedTripletStep_cff::pixelClusters, pixelClusters_, pixels, pixelSourceProdID, process(), edm::ESHandle< T >::product(), edm::ProductLabels::productInstance, edm::Event::put(), SurveyInfoScenario_cff::seed, edm::ContainerMask< T >::size(), and trajectories_.

226 {
227  ProductID pixelOldProdID, stripOldProdID;
228 
230  iSetup.get<TrackerDigiGeometryRecord>().get("",tgh); //is it correct to use "" ?
231 
233  if (doPixel_) {
234  iEvent.getByToken(pixelClusters_, pixelClusters);
235  pixelSourceProdID = pixelClusters.id();
236  }
237  LogDebug("SeedClusterRemoverPhase2") << "Read pixel with id " << pixelSourceProdID << std::endl;
238 
240  if (doOuterTracker_) {
241  iEvent.getByToken(phase2OTClusters_, phase2OTClusters);
242  outerTrackerSourceProdID = phase2OTClusters.id();
243  }
244  LogDebug("SeedClusterRemoverPhase2") << "Read OT cluster with id " << outerTrackerSourceProdID << std::endl;
245 
246  std::unique_ptr<ClusterRemovalInfo> cri;
248  if (doOuterTracker_ && doPixel_) cri = std::make_unique<ClusterRemovalInfo>(pixelClusters, phase2OTClusters);
249  else if (doOuterTracker_) cri = std::make_unique<ClusterRemovalInfo>(phase2OTClusters);
250  else if (doPixel_) cri = std::make_unique<ClusterRemovalInfo>(pixelClusters);
251  }
252 
253  Handle<ClusterRemovalInfo> oldRemovalInfo;
255  iEvent.getByToken(oldRemovalInfo_, oldRemovalInfo);
256  // Check ProductIDs
257  if ( (oldRemovalInfo->stripNewRefProd().id() == phase2OTClusters.id()) &&
258  (oldRemovalInfo->pixelNewRefProd().id() == pixelClusters.id()) ) {
259 
260  cri->getOldClustersFrom(*oldRemovalInfo);
261 
262  pixelOldProdID = oldRemovalInfo->pixelRefProd().id();
263  stripOldProdID = oldRemovalInfo->stripRefProd().id();
264 
265  } else {
268  throw cms::Exception("Inconsistent Data") << "SeedClusterRemoverPhase2: " <<
269  "Input collection product IDs are [pixel: " << pixelClusters.id() << ", strip: " << phase2OTClusters.id() << "] \n" <<
270  "\t but the *old* ClusterRemovalInfo " << labels.productInstance << " refers as 'new product ids' to " <<
271  "[pixel: " << oldRemovalInfo->pixelNewRefProd().id() << ", strip: " << oldRemovalInfo->stripNewRefProd().id() << "]\n" <<
272  "NOTA BENE: when running SeedClusterRemoverPhase2 with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
273  }
274  } else { // then Old == Source
275  pixelOldProdID = pixelSourceProdID;
276  stripOldProdID = outerTrackerSourceProdID;
277  }
278 
279  if (doOuterTracker_) {
280  OTs.resize(phase2OTClusters->dataSize()); fill(OTs.begin(), OTs.end(), true);
281  }
282  if (doPixel_) {
283  pixels.resize(pixelClusters->dataSize()); fill(pixels.begin(), pixels.end(), true);
284  }
285  if(mergeOld_) {
288  iEvent.getByToken(oldPxlMaskToken_ ,oldPxlMask);
289  iEvent.getByToken(oldPh2OTMaskToken_ ,oldPh2OTMask);
290  LogDebug("SeedClusterRemoverPhase2") << "to merge in, "<<oldPh2OTMask->size()<<" strp and "<<oldPxlMask->size()<<" pxl";
291  oldPh2OTMask->copyMaskTo(collectedOuterTrackers_);
292  oldPxlMask->copyMaskTo(collectedPixels_);
293  assert(phase2OTClusters->dataSize()>=collectedOuterTrackers_.size());
294  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(),false); // for ondemand
295  }else {
296  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(), false);
297  collectedPixels_.resize(pixelClusters->dataSize(), false);
298  }
299 
300 
302  iEvent.getByToken(trajectories_,seeds);
303 
304  TrajectorySeedCollection::const_iterator seed=seeds->begin();
305 
306  for (;seed!=seeds->end();++seed){
307  TrajectorySeed::range hits=seed->recHits();
309  for (;hit!=hits.second;++hit){
310  if (!hit->isValid()) continue;
311  process( &(*hit), 0. , tgh.product());
312  }
313  }
314 
315 
318  iEvent.put(cleanup(*pixelClusters, pixels, cri->pixelIndices(), mergeOld_ ? &oldRemovalInfo->pixelIndices() : 0));
319  LogDebug("SeedClusterRemoverPhase2") << "SeedClusterRemoverPhase2: Wrote pixel " << newPixels.id() << " from " << pixelSourceProdID ;
320  cri->setNewPixelClusters(newPixels);
321  }
324  iEvent.put(cleanup(*phase2OTClusters, OTs, cri->stripIndices(), mergeOld_ ? &oldRemovalInfo->stripIndices() : 0));
325  LogDebug("SeedClusterRemoverPhase2") << "SeedClusterRemoverPhase2: Wrote strip " << newOuterTrackers.id() << " from " << outerTrackerSourceProdID;
326  cri->setNewPhase2OTClusters(newOuterTrackers);
327  }
328 
329 
330  if (clusterWasteSolution_) {
331  iEvent.put(std::move(cri));
332  }
333 
334  pixels.clear(); OTs.clear();
335 
336  if (!clusterWasteSolution_){
337 
338  LogDebug("SeedClusterRemoverPhase2")<<"total strip to skip: "<<std::count(collectedOuterTrackers_.begin(),collectedOuterTrackers_.end(),true);
339  iEvent.put(std::make_unique<Phase2OTMaskContainer>(edm::RefProd<edmNew::DetSetVector<Phase2TrackerCluster1D> >(phase2OTClusters),collectedOuterTrackers_));
340 
341  LogDebug("SeedClusterRemoverPhase2")<<"total pxl to skip: "<<std::count(collectedPixels_.begin(),collectedPixels_.end(),true);
342  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),collectedPixels_));
343 
344  }
345  collectedOuterTrackers_.clear();
346  collectedPixels_.clear();
347 
348 }
#define LogDebug(id)
std::vector< bool > collectedPixels_
std::vector< bool > collectedOuterTrackers_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_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)
ProductID id() const
Definition: HandleBase.cc:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< reco::ClusterRemovalInfo > oldRemovalInfo_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
void copyMaskTo(std::vector< bool > &) const
Definition: ContainerMask.h:90
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
ProductID id() const
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
size_t size() const
Definition: ContainerMask.h:54
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
char const * productInstance
Definition: ProductLabels.h:6
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_
ProductIndex id() const
Definition: ProductID.h:38
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

bool SeedClusterRemoverPhase2::clusterWasteSolution_
private

Definition at line 70 of file SeedClusterRemoverPhase2.cc.

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

std::vector<bool> SeedClusterRemoverPhase2::collectedOuterTrackers_
private

Definition at line 73 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

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

Definition at line 74 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

bool SeedClusterRemoverPhase2::doOuterTracker_
private

Definition at line 46 of file SeedClusterRemoverPhase2.cc.

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

bool SeedClusterRemoverPhase2::doPixel_
private

Definition at line 46 of file SeedClusterRemoverPhase2.cc.

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

bool SeedClusterRemoverPhase2::filterTracks_
private

Definition at line 71 of file SeedClusterRemoverPhase2.cc.

Referenced by SeedClusterRemoverPhase2().

bool SeedClusterRemoverPhase2::mergeOld_
private

Definition at line 47 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

edm::EDGetTokenT<Phase2OTMaskContainer> SeedClusterRemoverPhase2::oldPh2OTMaskToken_
private

Definition at line 54 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

edm::EDGetTokenT<PixelMaskContainer> SeedClusterRemoverPhase2::oldPxlMaskToken_
private

Definition at line 53 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

edm::EDGetTokenT<reco::ClusterRemovalInfo> SeedClusterRemoverPhase2::oldRemovalInfo_
private

Definition at line 52 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

std::vector<uint8_t> SeedClusterRemoverPhase2::OTs
private

Definition at line 57 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

edm::ProductID SeedClusterRemoverPhase2::outerTrackerSourceProdID
private

Definition at line 58 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > SeedClusterRemoverPhase2::phase2OTClusters_
private

Definition at line 51 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > SeedClusterRemoverPhase2::pixelClusters_
private

Definition at line 50 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

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

Definition at line 57 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

edm::ProductID SeedClusterRemoverPhase2::pixelSourceProdID
private

Definition at line 58 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

reco::TrackBase::TrackQuality SeedClusterRemoverPhase2::trackQuality_
private

Definition at line 72 of file SeedClusterRemoverPhase2.cc.

Referenced by SeedClusterRemoverPhase2().

edm::EDGetTokenT<TrajectorySeedCollection> SeedClusterRemoverPhase2::trajectories_
private

Definition at line 55 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().