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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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 34 of file SeedClusterRemoverPhase2.cc.

Member Typedef Documentation

◆ Phase2OTMaskContainer

Definition at line 43 of file SeedClusterRemoverPhase2.cc.

◆ PixelMaskContainer

Definition at line 42 of file SeedClusterRemoverPhase2.cc.

Constructor & Destructor Documentation

◆ SeedClusterRemoverPhase2()

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

Definition at line 62 of file SeedClusterRemoverPhase2.cc.

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

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 81 of file SeedClusterRemoverPhase2.cc.

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

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, OTs, outerTrackerSourceProdID, pixels, pixelSourceProdID, DetId::rawId(), and DetId::subdetId().

Referenced by produce().

◆ produce()

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

Definition at line 134 of file SeedClusterRemoverPhase2.cc.

134  {
135  ProductID pixelOldProdID, stripOldProdID;
136 
138  iSetup.get<TrackerDigiGeometryRecord>().get("", tgh); //is it correct to use "" ?
139 
141  if (doPixel_) {
142  iEvent.getByToken(pixelClusters_, pixelClusters);
144  }
145  LogDebug("SeedClusterRemoverPhase2") << "Read pixel with id " << pixelSourceProdID << std::endl;
146 
148  if (doOuterTracker_) {
151  }
152  LogDebug("SeedClusterRemoverPhase2") << "Read OT cluster with id " << outerTrackerSourceProdID << std::endl;
153 
154  if (doOuterTracker_) {
155  OTs.resize(phase2OTClusters->dataSize());
156  fill(OTs.begin(), OTs.end(), true);
157  }
158  if (doPixel_) {
159  pixels.resize(pixelClusters->dataSize());
160  fill(pixels.begin(), pixels.end(), true);
161  }
162  if (mergeOld_) {
165  iEvent.getByToken(oldPxlMaskToken_, oldPxlMask);
166  iEvent.getByToken(oldPh2OTMaskToken_, oldPh2OTMask);
167  LogDebug("SeedClusterRemoverPhase2") << "to merge in, " << oldPh2OTMask->size() << " strp and "
168  << oldPxlMask->size() << " pxl";
169  oldPh2OTMask->copyMaskTo(collectedOuterTrackers_);
170  oldPxlMask->copyMaskTo(collectedPixels_);
171  assert(phase2OTClusters->dataSize() >= collectedOuterTrackers_.size());
172  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(), false); // for ondemand
173  } else {
174  collectedOuterTrackers_.resize(phase2OTClusters->dataSize(), false);
175  collectedPixels_.resize(pixelClusters->dataSize(), false);
176  }
177 
179  iEvent.getByToken(trajectories_, seeds);
180 
181  for (auto const &seed : (*seeds)) {
182  auto hits = seed.recHits();
183  auto hit = hits.first;
184  for (; hit != hits.second; ++hit) {
185  if (!hit->isValid())
186  continue;
187  process(&(*hit), 0., tgh.product());
188  }
189  }
190 
191  pixels.clear();
192  OTs.clear();
193 
194  LogDebug("SeedClusterRemoverPhase2") << "total strip to skip: "
195  << std::count(
196  collectedOuterTrackers_.begin(), collectedOuterTrackers_.end(), true);
197  iEvent.put(std::make_unique<Phase2OTMaskContainer>(
199 
200  LogDebug("SeedClusterRemoverPhase2") << "total pxl to skip: "
201  << std::count(collectedPixels_.begin(), collectedPixels_.end(), true);
202  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),
204 
205  collectedOuterTrackers_.clear();
206  collectedPixels_.clear();
207 }

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

Member Data Documentation

◆ collectedOuterTrackers_

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

Definition at line 55 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ collectedPixels_

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

Definition at line 56 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ doOuterTracker_

bool SeedClusterRemoverPhase2::doOuterTracker_
private

Definition at line 40 of file SeedClusterRemoverPhase2.cc.

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

◆ doPixel_

bool SeedClusterRemoverPhase2::doPixel_
private

Definition at line 40 of file SeedClusterRemoverPhase2.cc.

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

◆ mergeOld_

bool SeedClusterRemoverPhase2::mergeOld_
private

Definition at line 41 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ oldPh2OTMaskToken_

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

Definition at line 47 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ oldPxlMaskToken_

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

Definition at line 46 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ OTs

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

Definition at line 50 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ outerTrackerSourceProdID

edm::ProductID SeedClusterRemoverPhase2::outerTrackerSourceProdID
private

Definition at line 51 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ phase2OTClusters_

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

Definition at line 45 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ pixelClusters_

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

Definition at line 44 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

◆ pixels

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

Definition at line 50 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ pixelSourceProdID

edm::ProductID SeedClusterRemoverPhase2::pixelSourceProdID
private

Definition at line 51 of file SeedClusterRemoverPhase2.cc.

Referenced by process(), and produce().

◆ trajectories_

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

Definition at line 48 of file SeedClusterRemoverPhase2.cc.

Referenced by produce(), and SeedClusterRemoverPhase2().

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:45
LumiMonitor_cff.pixelClusters
pixelClusters
Definition: LumiMonitor_cff.py:10
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
SeedClusterRemoverPhase2::process
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
Definition: SeedClusterRemoverPhase2.cc:81
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:160
SeedClusterRemoverPhase2::oldPxlMaskToken_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
Definition: SeedClusterRemoverPhase2.cc:46
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit::cluster
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
DetId
Definition: DetId.h:17
Phase2TrackerRecHit1D::cluster
CluRef cluster() const
Definition: Phase2TrackerRecHit1D.h:24
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SeedClusterRemoverPhase2::pixelSourceProdID
edm::ProductID pixelSourceProdID
Definition: SeedClusterRemoverPhase2.cc:51
SeedClusterRemoverPhase2::doOuterTracker_
bool doOuterTracker_
Definition: SeedClusterRemoverPhase2.cc:40
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
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:232
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
SeedClusterRemoverPhase2::trajectories_
edm::EDGetTokenT< TrajectorySeedCollection > trajectories_
Definition: SeedClusterRemoverPhase2.cc:48
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
edm::ContainerMask::size
size_t size() const
Definition: ContainerMask.h:53
seedClusterRemoverPhase2_cfi.phase2OTClusters
phase2OTClusters
Definition: seedClusterRemoverPhase2_cfi.py:5
SeedClusterRemoverPhase2::pixels
std::vector< uint8_t > pixels
Definition: SeedClusterRemoverPhase2.cc:50
SeedClusterRemoverPhase2::doPixel_
bool doPixel_
Definition: SeedClusterRemoverPhase2.cc:40
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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:56
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:41
SeedClusterRemoverPhase2::OTs
std::vector< uint8_t > OTs
Definition: SeedClusterRemoverPhase2.cc:50
SeedClusterRemoverPhase2::oldPh2OTMaskToken_
edm::EDGetTokenT< Phase2OTMaskContainer > oldPh2OTMaskToken_
Definition: SeedClusterRemoverPhase2.cc:47
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:55
SeedClusterRemoverPhase2::outerTrackerSourceProdID
edm::ProductID outerTrackerSourceProdID
Definition: SeedClusterRemoverPhase2.cc:51
SeedClusterRemoverPhase2::pixelClusters_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
Definition: SeedClusterRemoverPhase2.cc:44
edm::InputTag
Definition: InputTag.h:15
edm::ProductID
Definition: ProductID.h:27
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Phase2TrackerRecHit1D
Definition: Phase2TrackerRecHit1D.h:10