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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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_
 

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
 

Detailed Description

Definition at line 35 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.

64  : doOuterTracker_(iConfig.existsAs<bool>("doOuterTracker") ? iConfig.getParameter<bool>("doOuterTracker") : true),
65  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
66  mergeOld_(iConfig.exists("oldClusterRemovalInfo")) {
67  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
68  produces<edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D> > >();
69 
70  trajectories_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<InputTag>("trajectories"));
71  if (doPixel_)
72  pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
73  if (doOuterTracker_)
75  consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(iConfig.getParameter<InputTag>("phase2OTClusters"));
76  if (mergeOld_) {
77  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
78  oldPh2OTMaskToken_ = consumes<Phase2OTMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
79  }
80 }

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

Member Function Documentation

◆ process()

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

Definition at line 82 of file SeedClusterRemoverPhase2.cc.

82  {
83  DetId detid = hit->geographicalId();
84  uint32_t subdet = detid.subdetId();
85 
86  assert(subdet > 0);
87 
88  const type_info &hitType = typeid(*hit);
89  if (hitType == typeid(SiPixelRecHit)) {
90  if (!doPixel_)
91  return;
92 
93  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
94  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
95  LogDebug("SeedClusterRemoverPhase2") << "Plain Pixel RecHit in det " << detid.rawId();
96 
97  if (cluster.id() != pixelSourceProdID)
98  throw cms::Exception("Inconsistent Data")
99  << "SeedClusterRemoverPhase2: pixel cluster ref from Product ID = " << cluster.id()
100  << " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
101 
102  assert(cluster.id() == pixelSourceProdID);
103 
104  // mark as used
105  pixels[cluster.key()] = false;
106 
107  assert(collectedPixels_.size() > cluster.key());
108  collectedPixels_[cluster.key()] = true;
109 
110  } else if (hitType == typeid(Phase2TrackerRecHit1D)) {
111  if (!doOuterTracker_)
112  return;
113 
114  const Phase2TrackerRecHit1D *ph2OThit = static_cast<const Phase2TrackerRecHit1D *>(hit);
115  LogDebug("SeedClusterRemoverPhase2") << "Plain Phase2TrackerRecHit1D in det " << detid.rawId();
116 
117  Phase2TrackerRecHit1D::CluRef cluster = ph2OThit->cluster();
118  if (cluster.id() != outerTrackerSourceProdID)
119  throw cms::Exception("Inconsistent Data")
120  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
121  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
122 
123  assert(cluster.id() == outerTrackerSourceProdID);
124 
125  OTs[cluster.key()] = false;
126  assert(collectedOuterTrackers_.size() > cluster.key());
127  collectedOuterTrackers_[cluster.key()] = true;
128 
129  } else if (hitType == typeid(VectorHit)) {
130  if (!doOuterTracker_)
131  return;
132 
133  const VectorHit *vhit = static_cast<const VectorHit *>(hit);
134  LogDebug("SeedClusterRemoverPhase2") << "Plain VectorHit in det " << detid.rawId();
135 
136  //lower cluster
138  if (cluster.id() != outerTrackerSourceProdID)
139  throw cms::Exception("Inconsistent Data")
140  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
141  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
142 
143  OTs[cluster.key()] = false;
144  assert(collectedOuterTrackers_.size() > cluster.key());
145  collectedOuterTrackers_[cluster.key()] = true;
146 
147  // upper cluster
148  cluster = vhit->upperCluster();
149  if (cluster.id() != outerTrackerSourceProdID)
150  throw cms::Exception("Inconsistent Data")
151  << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id()
152  << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n.";
153 
154  OTs[cluster.key()] = false;
155  assert(collectedOuterTrackers_.size() > cluster.key());
156  collectedOuterTrackers_[cluster.key()] = true;
157  } else
158  throw cms::Exception("NOT IMPLEMENTED")
159  << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name()
160  << " on detid " << detid.rawId() << "\n";
161 }

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().

◆ produce()

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

Definition at line 163 of file SeedClusterRemoverPhase2.cc.

163  {
164  ProductID pixelOldProdID, stripOldProdID;
165 
167  iSetup.get<TrackerDigiGeometryRecord>().get("", tgh); //is it correct to use "" ?
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.product());
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 }

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

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().

VectorHit::lowerCluster
ClusterRef lowerCluster() const
"lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel
Definition: VectorHit.h:91
edm::RefProd
Definition: EDProductfwd.h:25
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SeedClusterRemoverPhase2::phase2OTClusters_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClusters_
Definition: SeedClusterRemoverPhase2.cc:46
LumiMonitor_cff.pixelClusters
pixelClusters
Definition: LumiMonitor_cff.py:10
VectorHit::upperCluster
ClusterRef upperCluster() const
Definition: VectorHit.h:92
SeedClusterRemoverPhase2::process
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
Definition: SeedClusterRemoverPhase2.cc:82
cms::cuda::assert
assert(be >=bs)
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
SeedClusterRemoverPhase2::oldPxlMaskToken_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
Definition: SeedClusterRemoverPhase2.cc:47
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit::cluster
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
HLTEgPhaseIITestSequence_cff.phase2OTClusters
phase2OTClusters
Definition: HLTEgPhaseIITestSequence_cff.py:722
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
fileCollector.seed
seed
Definition: fileCollector.py:127
DetId
Definition: DetId.h:17
Phase2TrackerRecHit1D::cluster
CluRef cluster() const
Definition: Phase2TrackerRecHit1D.h:24
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
SeedClusterRemoverPhase2::pixelSourceProdID
edm::ProductID pixelSourceProdID
Definition: SeedClusterRemoverPhase2.cc:52
SeedClusterRemoverPhase2::doOuterTracker_
bool doOuterTracker_
Definition: SeedClusterRemoverPhase2.cc:41
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:230
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
SeedClusterRemoverPhase2::trajectories_
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
Definition: SeedClusterRemoverPhase2.cc:49
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
edm::ContainerMask::size
size_t size() const
Definition: ContainerMask.h:53
SeedClusterRemoverPhase2::pixels
std::vector< uint8_t > pixels
Definition: SeedClusterRemoverPhase2.cc:51
SeedClusterRemoverPhase2::doPixel_
bool doPixel_
Definition: SeedClusterRemoverPhase2.cc:41
VectorHit
Definition: VectorHit.h:28
edmNew::DetSetVector
Definition: DetSetNew.h:13
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
SeedClusterRemoverPhase2::collectedPixels_
std::vector< bool > collectedPixels_
Definition: SeedClusterRemoverPhase2.cc:57
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
edm::ContainerMask::copyMaskTo
void copyMaskTo(std::vector< bool > &) const
Definition: ContainerMask.h:87
Exception
Definition: hltDiff.cc:246
SeedClusterRemoverPhase2::mergeOld_
bool mergeOld_
Definition: SeedClusterRemoverPhase2.cc:42
SeedClusterRemoverPhase2::OTs
std::vector< uint8_t > OTs
Definition: SeedClusterRemoverPhase2.cc:51
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SeedClusterRemoverPhase2::oldPh2OTMaskToken_
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
Definition: SeedClusterRemoverPhase2.cc:48
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
cms::Exception
Definition: Exception.h:70
SeedClusterRemoverPhase2::collectedOuterTrackers_
std::vector< bool > collectedOuterTrackers_
Definition: SeedClusterRemoverPhase2.cc:56
SeedClusterRemoverPhase2::outerTrackerSourceProdID
edm::ProductID outerTrackerSourceProdID
Definition: SeedClusterRemoverPhase2.cc:52
SeedClusterRemoverPhase2::pixelClusters_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
Definition: SeedClusterRemoverPhase2.cc:45
edm::InputTag
Definition: InputTag.h:15
edm::ProductID
Definition: ProductID.h:27
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Phase2TrackerRecHit1D
Definition: Phase2TrackerRecHit1D.h:10