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<>

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SeedClusterRemoverPhase2 (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

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

Private Member Functions

void process (const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
 

Private Attributes

std::vector< bool > collectedOuterTrackers_
 
std::vector< bool > collectedPixels_
 
bool doOuterTracker_
 
bool doPixel_
 
bool mergeOld_
 
edm::EDGetTokenT< Phase2OTMaskContaineroldPh2OTMaskToken_
 
edm::EDGetTokenT< PixelMaskContaineroldPxlMaskToken_
 
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
 
edm::EDGetTokenT< TrajectorySeedCollectiontrajectories_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 34 of file SeedClusterRemoverPhase2.cc.

Member Typedef Documentation

◆ Phase2OTMaskContainer

Definition at line 44 of file SeedClusterRemoverPhase2.cc.

◆ PixelMaskContainer

Definition at line 43 of file SeedClusterRemoverPhase2.cc.

Constructor & Destructor Documentation

◆ SeedClusterRemoverPhase2()

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

Definition at line 63 of file SeedClusterRemoverPhase2.cc.

References doOuterTracker_, doPixel_, edm::ParameterSet::getParameter(), mergeOld_, oldPh2OTMaskToken_, oldPxlMaskToken_, phase2OTClusters_, pixelClusters_, and trajectories_.

64  : tTrackerGeom_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
65  doOuterTracker_(iConfig.existsAs<bool>("doOuterTracker") ? iConfig.getParameter<bool>("doOuterTracker") : true),
66  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
67  mergeOld_(iConfig.exists("oldClusterRemovalInfo")) {
68  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
69  produces<edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D> > >();
70 
71  trajectories_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<InputTag>("trajectories"));
72  if (doPixel_)
73  pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
74  if (doOuterTracker_)
76  consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(iConfig.getParameter<InputTag>("phase2OTClusters"));
77  if (mergeOld_) {
78  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
79  oldPh2OTMaskToken_ = consumes<Phase2OTMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
80  }
81 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_

Member Function Documentation

◆ process()

void SeedClusterRemoverPhase2::process ( const TrackingRecHit hit,
float  chi2,
const TrackerGeometry tg 
)
inlineprivate

Definition at line 83 of file SeedClusterRemoverPhase2.cc.

References cms::cuda::assert(), Phase2TrackerRecHit1D::cluster(), SiPixelRecHit::cluster(), collectedOuterTrackers_, collectedPixels_, doOuterTracker_, doPixel_, Exception, edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::key(), LogDebug, VectorHit::lowerCluster(), OTs, outerTrackerSourceProdID, pixels, pixelSourceProdID, DetId::rawId(), DetId::subdetId(), and VectorHit::upperCluster().

Referenced by produce().

83  {
84  DetId detid = hit->geographicalId();
85  uint32_t subdet = detid.subdetId();
86 
87  assert(subdet > 0);
88 
89  const type_info &hitType = typeid(*hit);
90  if (hitType == typeid(SiPixelRecHit)) {
91  if (!doPixel_)
92  return;
93 
94  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
95  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
96  LogDebug("SeedClusterRemoverPhase2") << "Plain Pixel RecHit in det " << detid.rawId();
97 
98  if (cluster.id() != pixelSourceProdID)
99  throw cms::Exception("Inconsistent Data")
100  << "SeedClusterRemoverPhase2: pixel cluster ref from Product ID = " << cluster.id()
101  << " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
102 
103  assert(cluster.id() == pixelSourceProdID);
104 
105  // mark as used
106  pixels[cluster.key()] = false;
107 
108  assert(collectedPixels_.size() > cluster.key());
109  collectedPixels_[cluster.key()] = true;
110 
111  } else if (hitType == typeid(Phase2TrackerRecHit1D)) {
112  if (!doOuterTracker_)
113  return;
114 
115  const Phase2TrackerRecHit1D *ph2OThit = static_cast<const Phase2TrackerRecHit1D *>(hit);
116  LogDebug("SeedClusterRemoverPhase2") << "Plain Phase2TrackerRecHit1D in det " << detid.rawId();
117 
118  Phase2TrackerRecHit1D::ClusterRef cluster = ph2OThit->cluster();
119  if (cluster.id() != outerTrackerSourceProdID)
120  throw cms::Exception("Inconsistent Data")
121  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
122  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
123 
124  assert(cluster.id() == outerTrackerSourceProdID);
125 
126  OTs[cluster.key()] = false;
127  assert(collectedOuterTrackers_.size() > cluster.key());
128  collectedOuterTrackers_[cluster.key()] = true;
129 
130  } else if (hitType == typeid(VectorHit)) {
131  if (!doOuterTracker_)
132  return;
133 
134  const VectorHit *vhit = static_cast<const VectorHit *>(hit);
135  LogDebug("SeedClusterRemoverPhase2") << "Plain VectorHit in det " << detid.rawId();
136 
137  //lower cluster
139  if (cluster.id() != outerTrackerSourceProdID)
140  throw cms::Exception("Inconsistent Data")
141  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
142  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
143 
144  OTs[cluster.key()] = false;
145  assert(collectedOuterTrackers_.size() > cluster.key());
146  collectedOuterTrackers_[cluster.key()] = true;
147 
148  // upper cluster
149  cluster = vhit->upperCluster();
150  if (cluster.id() != outerTrackerSourceProdID)
151  throw cms::Exception("Inconsistent Data")
152  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
153  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
154 
155  OTs[cluster.key()] = false;
156  assert(collectedOuterTrackers_.size() > cluster.key());
157  collectedOuterTrackers_[cluster.key()] = true;
158  } else
159  throw cms::Exception("NOT IMPLEMENTED")
160  << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name()
161  << " on detid " << detid.rawId() << "\n";
162 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
std::vector< bool > collectedPixels_
std::vector< bool > collectedOuterTrackers_
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
ClusterRef cluster() const
assert(be >=bs)
ClusterRef lowerCluster() const
"lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel ...
Definition: VectorHit.h:91
key_type key() const
Accessor for product key.
Definition: Ref.h:250
ClusterRef upperCluster() const
Definition: VectorHit.h:92
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Our base class.
Definition: SiPixelRecHit.h:23
#define LogDebug(id)

◆ produce()

void SeedClusterRemoverPhase2::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 164 of file SeedClusterRemoverPhase2.cc.

References cms::cuda::assert(), collectedOuterTrackers_, collectedPixels_, edm::ContainerMask< T >::copyMaskTo(), submitPVResolutionJobs::count, doOuterTracker_, doPixel_, ntuplemaker::fill, edm::EventSetup::getData(), iEvent, LogDebug, mergeOld_, oldPh2OTMaskToken_, oldPxlMaskToken_, OTs, outerTrackerSourceProdID, highPtTripletStepClusters_cfi::phase2OTClusters, phase2OTClusters_, DQMOffline_LumiMonitoring_cff::pixelClusters, pixelClusters_, pixels, pixelSourceProdID, process(), fileCollector::seed, DetachedQuadStep_cff::seeds, edm::ContainerMask< T >::size(), trajectories_, and tTrackerGeom_.

164  {
165  ProductID pixelOldProdID, stripOldProdID;
166 
167  const auto &tgh = &iSetup.getData(tTrackerGeom_);
168 
170  if (doPixel_) {
171  iEvent.getByToken(pixelClusters_, pixelClusters);
173  }
174  LogDebug("SeedClusterRemoverPhase2") << "Read pixel with id " << pixelSourceProdID << std::endl;
175 
177  if (doOuterTracker_) {
180  }
181  LogDebug("SeedClusterRemoverPhase2") << "Read OT cluster with id " << outerTrackerSourceProdID << std::endl;
182 
183  if (doOuterTracker_) {
184  OTs.resize(phase2OTClusters->dataSize());
185  fill(OTs.begin(), OTs.end(), true);
186  }
187  if (doPixel_) {
188  pixels.resize(pixelClusters->dataSize());
189  fill(pixels.begin(), pixels.end(), true);
190  }
191  if (mergeOld_) {
194  iEvent.getByToken(oldPxlMaskToken_, oldPxlMask);
195  iEvent.getByToken(oldPh2OTMaskToken_, oldPh2OTMask);
196  LogDebug("SeedClusterRemoverPhase2") << "to merge in, " << oldPh2OTMask->size() << " strp and "
197  << oldPxlMask->size() << " pxl";
198  oldPh2OTMask->copyMaskTo(collectedOuterTrackers_);
199  oldPxlMask->copyMaskTo(collectedPixels_);
200  assert(phase2OTClusters->dataSize() >= collectedOuterTrackers_.size());
201  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(), false); // for ondemand
202  } else {
203  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(), false);
204  collectedPixels_.resize(pixelClusters->dataSize(), false);
205  }
206 
208  iEvent.getByToken(trajectories_, seeds);
209 
210  for (auto const &seed : (*seeds)) {
211  for (auto const &hit : seed.recHits()) {
212  if (!hit.isValid())
213  continue;
214  process(&hit, 0., tgh);
215  }
216  }
217 
218  pixels.clear();
219  OTs.clear();
220 
221  LogDebug("SeedClusterRemoverPhase2") << "total strip to skip: "
222  << std::count(
223  collectedOuterTrackers_.begin(), collectedOuterTrackers_.end(), true);
224  iEvent.put(std::make_unique<Phase2OTMaskContainer>(
226 
227  LogDebug("SeedClusterRemoverPhase2") << "total pxl to skip: "
228  << std::count(collectedPixels_.begin(), collectedPixels_.end(), true);
229  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),
231 
232  collectedOuterTrackers_.clear();
233  collectedPixels_.clear();
234 }
std::vector< bool > collectedPixels_
std::vector< bool > collectedOuterTrackers_
void copyMaskTo(std::vector< bool > &) const
Definition: ContainerMask.h:87
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
assert(be >=bs)
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_
size_t size() const
Definition: ContainerMask.h:53
#define LogDebug(id)

Member Data Documentation

◆ collectedOuterTrackers_

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

Definition at line 56 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ collectedPixels_

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

Definition at line 57 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ doOuterTracker_

bool SeedClusterRemoverPhase2::doOuterTracker_
private

Definition at line 41 of file SeedClusterRemoverPhase2.cc.

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

◆ doPixel_

bool SeedClusterRemoverPhase2::doPixel_
private

Definition at line 41 of file SeedClusterRemoverPhase2.cc.

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

◆ mergeOld_

bool SeedClusterRemoverPhase2::mergeOld_
private

Definition at line 42 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ oldPh2OTMaskToken_

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

Definition at line 48 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ oldPxlMaskToken_

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

Definition at line 47 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ OTs

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

Definition at line 51 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ outerTrackerSourceProdID

edm::ProductID SeedClusterRemoverPhase2::outerTrackerSourceProdID
private

Definition at line 52 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ phase2OTClusters_

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

Definition at line 46 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ pixelClusters_

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

Definition at line 45 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ pixels

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

Definition at line 51 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ pixelSourceProdID

edm::ProductID SeedClusterRemoverPhase2::pixelSourceProdID
private

Definition at line 52 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ trajectories_

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

Definition at line 49 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ tTrackerGeom_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> const SeedClusterRemoverPhase2::tTrackerGeom_
private

Definition at line 40 of file SeedClusterRemoverPhase2.cc.

Referenced by produce().