CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
HLTTrackClusterRemoverNew Class Referencefinal
Inheritance diagram for HLTTrackClusterRemoverNew:
edm::stream::EDProducer<>

Classes

struct  ParamBlock
 

Public Member Functions

 HLTTrackClusterRemoverNew (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HLTTrackClusterRemoverNew () override
 
- 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< SiPixelCluster > > PixelMaskContainer
 
typedef edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMaskContainer
 

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

std::vector< bool > collectedPixels_
 
std::vector< bool > collectedRegStrips_
 
bool doPixel_
 
bool doPixelChargeCheck_
 
bool doStrip_
 
bool doStripChargeCheck_
 
bool doTracks_
 
bool makeProducts_
 
bool mergeOld_
 
edm::EDGetTokenT< PixelMaskContaineroldPxlMaskToken_
 
edm::EDGetTokenT< StripMaskContaineroldStrMaskToken_
 
ParamBlock pblocks_ [NumberOfParamBlocks]
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
 
std::vector< uint8_t > pixels
 
edm::ProductID pixelSourceProdID
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
 
std::vector< uint8_t > strips
 
edm::ProductID stripSourceProdID
 
edm::EDGetTokenT< std::vector< Trajectory > > trajectories_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
 

Static Private Attributes

static const unsigned int NumberOfParamBlocks = 6
 

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 38 of file HLTTrackClusterRemoverNew.cc.

Member Typedef Documentation

◆ PixelMaskContainer

Definition at line 69 of file HLTTrackClusterRemoverNew.cc.

◆ StripMaskContainer

Definition at line 70 of file HLTTrackClusterRemoverNew.cc.

Constructor & Destructor Documentation

◆ HLTTrackClusterRemoverNew()

HLTTrackClusterRemoverNew::HLTTrackClusterRemoverNew ( const edm::ParameterSet iConfig)

Definition at line 134 of file HLTTrackClusterRemoverNew.cc.

References doPixel_, doPixelChargeCheck_, doStrip_, doStripChargeCheck_, doTracks_, Exception, edm::ParameterSet::exists(), ntuplemaker::fill, edm::ParameterSet::getParameter(), mps_fire::i, mergeOld_, NumberOfParamBlocks, oldPxlMaskToken_, oldStrMaskToken_, pblocks_, pixelClusters_, readPSet(), stripClusters_, and trajectories_.

135  : tTrackerGeom_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
136  doTracks_(iConfig.exists("trajectories")),
137  doStrip_(iConfig.existsAs<bool>("doStrip") ? iConfig.getParameter<bool>("doStrip") : true),
138  doPixel_(iConfig.existsAs<bool>("doPixel") ? iConfig.getParameter<bool>("doPixel") : true),
139  mergeOld_(false),
140  makeProducts_(true),
142  iConfig.existsAs<bool>("doStripChargeCheck") ? iConfig.getParameter<bool>("doStripChargeCheck") : false),
144  iConfig.existsAs<bool>("doPixelChargeCheck") ? iConfig.getParameter<bool>("doPixelChargeCheck") : false)
145 
146 {
147  if (iConfig.exists("oldClusterRemovalInfo")) {
148  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
149  oldStrMaskToken_ = consumes<StripMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
150  if (not(iConfig.getParameter<InputTag>("oldClusterRemovalInfo") == edm::InputTag()))
151  mergeOld_ = true;
152  }
153 
155  throw cms::Exception("Configuration Error")
156  << "HLTTrackClusterRemoverNew: Charge check asked without cluster collection ";
158  throw cms::Exception("Configuration Error")
159  << "HLTTrackClusterRemoverNew: Pixel cluster charge check not yet implemented";
160 
161  fill(pblocks_, pblocks_ + NumberOfParamBlocks, ParamBlock());
162  readPSet(iConfig, "Common", -1);
163  if (doPixel_) {
164  readPSet(iConfig, "Pixel", 0, 1);
165  readPSet(iConfig, "PXB", 0);
166  readPSet(iConfig, "PXE", 1);
167  }
168  if (doStrip_) {
169  readPSet(iConfig, "Strip", 2, 3, 4, 5);
170  readPSet(iConfig, "StripInner", 2, 3);
171  readPSet(iConfig, "StripOuter", 4, 5);
172  readPSet(iConfig, "TIB", 2);
173  readPSet(iConfig, "TID", 3);
174  readPSet(iConfig, "TOB", 4);
175  readPSet(iConfig, "TEC", 5);
176  }
177 
178  bool usingCharge = false;
179  for (size_t i = 0; i < NumberOfParamBlocks; ++i) {
180  if (!pblocks_[i].isSet_)
181  throw cms::Exception("Configuration Error")
182  << "HLTTrackClusterRemoverNew: Missing configuration for detector with subDetID = " << (i + 1);
183  if (pblocks_[i].usesCharge_ && !usingCharge) {
184  throw cms::Exception("Configuration Error")
185  << "HLTTrackClusterRemoverNew: Configuration for subDetID = " << (i + 1)
186  << " uses cluster charge, which is not enabled.";
187  }
188  }
189 
190  // trajectories_ = consumes<vector<Trajectory> >(iConfig.getParameter<InputTag>("trajectories"));
191  if (doTracks_)
192  trajectories_ = consumes<vector<Trajectory> >(iConfig.getParameter<InputTag>("trajectories"));
193  if (doPixel_)
194  pixelClusters_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<InputTag>("pixelClusters"));
195  if (doStrip_)
196  stripClusters_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<InputTag>("stripClusters"));
197  if (mergeOld_) {
198  oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
199  oldStrMaskToken_ = consumes<StripMaskContainer>(iConfig.getParameter<InputTag>("oldClusterRemovalInfo"));
200  }
201 
202  //produces<edmNew::DetSetVector<SiPixelClusterRefNew> >();
203  //produces<edmNew::DetSetVector<SiStripRecHit1D::ClusterRegionalRef> >();
204 
205  produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
206  produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
207 }
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static const unsigned int NumberOfParamBlocks
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
bool exists(std::string const &parameterName) const
checks if a parameter exists
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
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)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
ParamBlock pblocks_[NumberOfParamBlocks]
edm::EDGetTokenT< std::vector< Trajectory > > trajectories_
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_

◆ ~HLTTrackClusterRemoverNew()

HLTTrackClusterRemoverNew::~HLTTrackClusterRemoverNew ( )
override

Definition at line 209 of file HLTTrackClusterRemoverNew.cc.

209 {}

Member Function Documentation

◆ cleanup()

template<typename T >
std::unique_ptr< edmNew::DetSetVector< T > > HLTTrackClusterRemoverNew::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 219 of file HLTTrackClusterRemoverNew.cc.

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

223  {
224  typedef typename edmNew::DetSetVector<T> DSV;
225  typedef typename edmNew::DetSetVector<T>::FastFiller DSF;
226  typedef typename edmNew::DetSet<T> DS;
227  auto output = std::make_unique<DSV>();
228  output->reserve(oldClusters.size(), oldClusters.dataSize());
229 
230  // cluster removal loop
231  const T *firstOffset = &oldClusters.data().front();
232  for (typename DSV::const_iterator itdet = oldClusters.begin(), enddet = oldClusters.end(); itdet != enddet; ++itdet) {
233  DS oldDS = *itdet;
234 
235  if (oldDS.empty())
236  continue; // skip empty detsets
237 
238  uint32_t id = oldDS.detId();
239  DSF outds(*output, id);
240 
241  for (typename DS::const_iterator it = oldDS.begin(), ed = oldDS.end(); it != ed; ++it) {
242  uint32_t index = ((&*it) - firstOffset);
243  if (isGood[index]) {
244  outds.push_back(*it);
245  refs.push_back(index);
246  //std::cout << "HLTTrackClusterRemoverNew::cleanup " << typeid(T).name() << " reference " << index << " to " << (refs.size() - 1) << std::endl;
247  }
248  }
249  if (outds.empty())
250  outds.abort(); // not write in an empty DSV
251  }
252  // std::cout<<"fraction: "<<fraction<<std::endl;
253  if (oldRefs != nullptr)
254  mergeOld(refs, *oldRefs);
255  return output;
256 }
size_type dataSize() const
data_type const * data(size_t cell) const
const_iterator end(bool update=false) const
const_iterator begin(bool update=false) const
size_type size() const
void mergeOld(reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices &oldRefs)
Definition: output.py:1
long double T

◆ mergeOld()

void HLTTrackClusterRemoverNew::mergeOld ( reco::ClusterRemovalInfo::Indices refs,
const reco::ClusterRemovalInfo::Indices oldRefs 
)
private

Definition at line 211 of file HLTTrackClusterRemoverNew.cc.

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

Referenced by cleanup().

212  {
213  for (size_t i = 0, n = refs.size(); i < n; ++i) {
214  refs[i] = oldRefs[refs[i]];
215  }
216 }

◆ process() [1/2]

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

Definition at line 272 of file HLTTrackClusterRemoverNew.cc.

References cms::cuda::assert(), nano_mu_local_reco_cff::chi2, SiPixelRecHit::cluster(), collectedPixels_, doPixel_, doStrip_, Exception, TrackerGeometry::geomDetSubDetector(), edm::Ref< C, T, F >::id(), GeomDetEnumerators::isTrackerPixel(), edm::Ref< C, T, F >::key(), HLTTrackClusterRemoverNew::ParamBlock::maxSize_, SiStripMatchedRecHit2D::monoClusterRef(), NumberOfParamBlocks, TrackerSingleRecHit::omniClusterRef(), ProjectedSiStripRecHit2D::originalHit(), pblocks_, pixelSourceProdID, DetId::rawId(), SiStripMatchedRecHit2D::stereoClusterRef(), and DetId::subdetId().

Referenced by produce().

272  {
273  DetId detid = hit->geographicalId();
274  uint32_t subdet = detid.subdetId();
275 
276  assert((subdet > 0) && (subdet <= NumberOfParamBlocks));
277 
278  // chi2 cut
279  if (chi2 > pblocks_[subdet - 1].maxChi2_)
280  return;
281 
283  // std::cout<<"process pxl hit"<<std::endl;
284  if (!doPixel_)
285  return;
286  // this is a pixel, and i *know* it is
287  const SiPixelRecHit *pixelHit = static_cast<const SiPixelRecHit *>(hit);
288 
289  SiPixelRecHit::ClusterRef cluster = pixelHit->cluster();
290  if (cluster.id() != pixelSourceProdID)
291  throw cms::Exception("Inconsistent Data")
292  << "HLTTrackClusterRemoverNew: pixel cluster ref from Product ID = " << cluster.id()
293  << " does not match with source cluster collection (ID = " << pixelSourceProdID << ")\n.";
294 
295  assert(cluster.id() == pixelSourceProdID);
296  //DBG// cout << "HIT NEW PIXEL DETID = " << detid.rawId() << ", Cluster [ " << cluster.key().first << " / " << cluster.key().second << " ] " << endl;
297 
298  // if requested, cut on cluster size
299  if (pblocks_[subdet - 1].usesSize_ && (cluster->pixels().size() > pblocks_[subdet - 1].maxSize_))
300  return;
301 
302  // mark as used
303  //pixels[cluster.key()] = false;
304  assert(collectedPixels_.size() > cluster.key());
305  collectedPixels_[cluster.key()] = true;
306  } else { // aka Strip
307  if (!doStrip_)
308  return;
309  const type_info &hitType = typeid(*hit);
310  if (hitType == typeid(SiStripRecHit2D)) {
311  const SiStripRecHit2D *stripHit = static_cast<const SiStripRecHit2D *>(hit);
312  //DBG// cout << "Plain RecHit 2D: " << endl;
313  process(stripHit->omniClusterRef(), subdet);
314  // int clusCharge=0;
315  // for ( auto cAmp : stripHit->omniClusterRef().stripCluster().amplitudes() ) clusCharge+=cAmp;
316  // std::cout << "[HLTTrackClusterRemoverNew::process (SiStripRecHit2D) chi2: " << chi2 << " [" << subdet << " --> charge: " << clusCharge << "]" << std::endl;
317  } else if (hitType == typeid(SiStripRecHit1D)) {
318  const SiStripRecHit1D *hit1D = static_cast<const SiStripRecHit1D *>(hit);
319  process(hit1D->omniClusterRef(), subdet);
320  // int clusCharge=0;
321  // for ( auto cAmp : hit1D->omniClusterRef().stripCluster().amplitudes() ) clusCharge+=cAmp;
322  // std::cout << "[HLTTrackClusterRemoverNew::process (SiStripRecHit1D) chi2: " << chi2 << " [" << subdet << " --> charge: " << clusCharge << "]" << std::endl;
323  } else if (hitType == typeid(SiStripMatchedRecHit2D)) {
324  const SiStripMatchedRecHit2D *matchHit = static_cast<const SiStripMatchedRecHit2D *>(hit);
325  //DBG// cout << "Matched RecHit 2D: " << endl;
326  process(matchHit->monoClusterRef(), subdet);
327  // int clusCharge=0;
328  // for ( auto cAmp : matchHit->monoClusterRef().stripCluster().amplitudes() ) clusCharge+=cAmp;
329  // std::cout << "[HLTTrackClusterRemoverNew::process (SiStripMatchedRecHit2D:mono) chi2: " << chi2 << " [" << subdet << " --> charge: " << clusCharge << "]" << std::endl;
330 
331  process(matchHit->stereoClusterRef(), subdet);
332  // clusCharge=0;
333  // for ( auto cAmp : matchHit->stereoClusterRef().stripCluster().amplitudes() ) clusCharge+=cAmp;
334  // std::cout << "[HLTTrackClusterRemoverNew::process (SiStripMatchedRecHit2D:stereo) chi2: " << chi2 << " [" << subdet << " --> charge: " << clusCharge << "]" << std::endl;
335 
336  } else if (hitType == typeid(ProjectedSiStripRecHit2D)) {
337  const ProjectedSiStripRecHit2D *projHit = static_cast<const ProjectedSiStripRecHit2D *>(hit);
338  //DBG// cout << "Projected RecHit 2D: " << endl;
339  process(projHit->originalHit().omniClusterRef(), subdet);
340  // int clusCharge=0;
341  // for ( auto cAmp : projHit->originalHit().omniClusterRef().stripCluster().amplitudes() ) clusCharge+=cAmp;
342  // std::cout << "[HLTTrackClusterRemoverNew::process (ProjectedSiStripRecHit2D) chi2: " << chi2 << " [" << subdet << " --> charge: " << clusCharge << "]" << std::endl;
343  } else
344  throw cms::Exception("NOT IMPLEMENTED")
345  << "Don't know how to handle " << hitType.name() << " on detid " << detid.rawId() << "\n";
346  }
347 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
static const unsigned int NumberOfParamBlocks
OmniClusterRef const & stereoClusterRef() const
OmniClusterRef const & omniClusterRef() const
assert(be >=bs)
OmniClusterRef const & monoClusterRef() const
key_type key() const
Accessor for product key.
Definition: Ref.h:250
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
ParamBlock pblocks_[NumberOfParamBlocks]
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
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
SiStripRecHit2D originalHit() const
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
Our base class.
Definition: SiPixelRecHit.h:23

◆ process() [2/2]

void HLTTrackClusterRemoverNew::process ( const OmniClusterRef cluRef,
uint32_t  subdet 
)
inlineprivate

Definition at line 258 of file HLTTrackClusterRemoverNew.cc.

References cms::cuda::assert(), collectedRegStrips_, OmniClusterRef::id(), OmniClusterRef::key(), and stripSourceProdID.

258  {
259  if (clusterReg.id() != stripSourceProdID)
260  throw cms::Exception("Inconsistent Data")
261  << "HLTTrackClusterRemoverNew: strip cluster ref from Product ID = " << clusterReg.id()
262  << " does not match with source cluster collection (ID = " << stripSourceProdID << ")\n.";
263 
264  if (collectedRegStrips_.size() <= clusterReg.key()) {
265  edm::LogError("BadCollectionSize") << collectedRegStrips_.size() << " is smaller than " << clusterReg.key();
266 
267  assert(collectedRegStrips_.size() > clusterReg.key());
268  }
269  collectedRegStrips_[clusterReg.key()] = true;
270 }
Log< level::Error, false > LogError
assert(be >=bs)

◆ produce()

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

Definition at line 359 of file HLTTrackClusterRemoverNew.cc.

References bsc_activity_cfg::clusters, collectedPixels_, collectedRegStrips_, edm::ContainerMask< T >::copyMaskTo(), submitPVResolutionJobs::count, doPixel_, doStrip_, doStripChargeCheck_, edm::EventSetup::getData(), mps_fire::i, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, B2GTnPMonitor_cfi::item, LogDebug, Trajectory::measurements(), mergeOld_, oldPxlMaskToken_, oldStrMaskToken_, pblocks_, DQMOffline_LumiMonitoring_cff::pixelClusters, pixelClusters_, pixelSourceProdID, process(), edm::ContainerMask< T >::size(), HLT_2024v13_cff::stripClusters, stripClusters_, stripSourceProdID, DetId::subdetId(), FastTrackerRecHitMaskProducer_cfi::trajectories, trajectories_, and tTrackerGeom_.

359  {
360  ProductID pixelOldProdID, stripOldProdID;
361 
362  const auto &tgh = &iSetup.getData(tTrackerGeom_);
363 
365  if (doPixel_) {
366  iEvent.getByToken(pixelClusters_, pixelClusters);
368  }
369 
371  if (doStrip_) {
372  iEvent.getByToken(stripClusters_, stripClusters);
374  }
375 
376  //Handle<TrajTrackAssociationCollection> trajectories;
378  iEvent.getByToken(trajectories_, trajectories);
379 
380  if (mergeOld_) {
383  iEvent.getByToken(oldPxlMaskToken_, oldPxlMask);
384  iEvent.getByToken(oldStrMaskToken_, oldStrMask);
385  LogDebug("TrackClusterRemover") << "to merge in, " << oldStrMask->size() << " strp and " << oldPxlMask->size()
386  << " pxl";
387  oldStrMask->copyMaskTo(collectedRegStrips_);
388  oldPxlMask->copyMaskTo(collectedPixels_);
389  collectedRegStrips_.resize(stripClusters->dataSize(), false);
390  } else {
391  collectedRegStrips_.resize(stripClusters->dataSize(), false);
392  collectedPixels_.resize(pixelClusters->dataSize(), false);
393  }
394 
395  //for (TrajTrackAssociationCollection::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
396  // const Trajectory &tj = * it->key;
397 
398  for (std::vector<Trajectory>::const_iterator it = trajectories->begin(), ed = trajectories->end(); it != ed; ++it) {
399  const Trajectory &tj = *it;
400  const std::vector<TrajectoryMeasurement> &tms = tj.measurements();
401 
402  std::vector<TrajectoryMeasurement>::const_iterator itm, endtm;
403  for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
404  const TrackingRecHit *hit = itm->recHit()->hit();
405  if (!hit->isValid())
406  continue;
407  // std::cout<<"process hit"<<std::endl;
408  process(hit, itm->estimate(), tgh);
409  }
410  }
411 
412  // std::cout << " => collectedRegStrips_: " << collectedRegStrips_.size() << std::endl;
413  // std::cout << " total strip to skip (before charge check): "<<std::count(collectedRegStrips_.begin(),collectedRegStrips_.end(),true) << std::endl;
414 
415  // checks only cluster already found! creates regression
416  if (doStripChargeCheck_) {
417  // std::cout << "[HLTTrackClusterRemoverNew::produce] doStripChargeCheck_: " << (doStripChargeCheck_ ? "true" : "false") << " stripClusters: " << stripClusters->size() << std::endl;
418 
419  auto const &clusters = stripClusters->data();
420  for (auto const &item : stripClusters->ids()) {
421  if (!item.isValid())
422  continue; // not umpacked
423 
424  DetId detid = item.id;
425  uint32_t subdet = detid.subdetId();
426  if (!pblocks_[subdet - 1].cutOnStripCharge_)
427  continue;
428 
429  // std::cout << " i: " << i << " --> detid: " << detid << " --> subdet: " << subdet << std::endl;
430 
431  for (int i = item.offset; i < item.offset + int(item.size); ++i) {
432  int clusCharge = 0;
433  for (auto cAmp : clusters[i].amplitudes())
434  clusCharge += cAmp;
435 
436  // if (clusCharge < pblocks_[subdet-1].minGoodStripCharge_) std::cout << " clusCharge: " << clusCharge << std::endl;
437  if (clusCharge < pblocks_[subdet - 1].minGoodStripCharge_)
438  collectedRegStrips_[i] = true; // (|= does not work!)
439  }
440  }
441  }
442 
443  // std::cout << " => collectedRegStrips_: " << collectedRegStrips_.size() << std::endl;
444  // std::cout << " total strip to skip: "<<std::count(collectedRegStrips_.begin(),collectedRegStrips_.end(),true) << std::endl;
445  LogDebug("TrackClusterRemover") << "total strip to skip: "
446  << std::count(collectedRegStrips_.begin(), collectedRegStrips_.end(), true);
447  // std::cout << "TrackClusterRemover" <<" total strip to skip: "<<std::count(collectedRegStrips_.begin(),collectedRegStrips_.end(),true)<<std::endl;
448  iEvent.put(std::make_unique<StripMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiStripCluster> >(stripClusters),
450 
451  LogDebug("TrackClusterRemover") << "total pxl to skip: "
452  << std::count(collectedPixels_.begin(), collectedPixels_.end(), true);
453  iEvent.put(std::make_unique<PixelMaskContainer>(edm::RefProd<edmNew::DetSetVector<SiPixelCluster> >(pixelClusters),
455 
456  collectedRegStrips_.clear();
457  collectedPixels_.clear();
458 }
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
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_
edm::EDGetTokenT< PixelMaskContainer > oldPxlMaskToken_
DataContainer const & measurements() const
Definition: Trajectory.h:178
int iEvent
Definition: GenABIO.cc:224
void process(const TrackingRecHit *hit, float chi2, const TrackerGeometry *tg)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > const tTrackerGeom_
ParamBlock pblocks_[NumberOfParamBlocks]
edm::EDGetTokenT< std::vector< Trajectory > > trajectories_
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
size_t size() const
Definition: ContainerMask.h:53
edm::EDGetTokenT< StripMaskContainer > oldStrMaskToken_
#define LogDebug(id)

◆ readPSet()

void HLTTrackClusterRemoverNew::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 112 of file HLTTrackClusterRemoverNew.cc.

References edm::ParameterSet::exists(), ntuplemaker::fill, edm::ParameterSet::getParameter(), globals_cff::id1, globals_cff::id2, and Skims_PA_cff::name.

Referenced by HLTTrackClusterRemoverNew().

113  {
114  if (iConfig.exists(name)) {
115  ParamBlock pblock(iConfig.getParameter<ParameterSet>(name));
116  if (id1 == -1) {
118  } else {
119  pblocks_[id1] = pblock;
120  if (id2 != -1)
121  pblocks_[id2] = pblock;
122  if (id3 != -1)
123  pblocks_[id3] = pblock;
124  if (id4 != -1)
125  pblocks_[id4] = pblock;
126  if (id5 != -1)
127  pblocks_[id5] = pblock;
128  if (id6 != -1)
129  pblocks_[id6] = pblock;
130  }
131  }
132 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static const unsigned int NumberOfParamBlocks
bool exists(std::string const &parameterName) const
checks if a parameter exists
ParamBlock pblocks_[NumberOfParamBlocks]

Member Data Documentation

◆ collectedPixels_

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

Definition at line 105 of file HLTTrackClusterRemoverNew.cc.

Referenced by process(), and produce().

◆ collectedRegStrips_

std::vector<bool> HLTTrackClusterRemoverNew::collectedRegStrips_
private

Definition at line 104 of file HLTTrackClusterRemoverNew.cc.

Referenced by process(), and produce().

◆ doPixel_

bool HLTTrackClusterRemoverNew::doPixel_
private

Definition at line 66 of file HLTTrackClusterRemoverNew.cc.

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

◆ doPixelChargeCheck_

bool HLTTrackClusterRemoverNew::doPixelChargeCheck_
private

Definition at line 103 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew().

◆ doStrip_

bool HLTTrackClusterRemoverNew::doStrip_
private

Definition at line 66 of file HLTTrackClusterRemoverNew.cc.

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

◆ doStripChargeCheck_

bool HLTTrackClusterRemoverNew::doStripChargeCheck_
private

Definition at line 103 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ doTracks_

bool HLTTrackClusterRemoverNew::doTracks_
private

Definition at line 65 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew().

◆ makeProducts_

bool HLTTrackClusterRemoverNew::makeProducts_
private

Definition at line 102 of file HLTTrackClusterRemoverNew.cc.

◆ mergeOld_

bool HLTTrackClusterRemoverNew::mergeOld_
private

Definition at line 67 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ NumberOfParamBlocks

const unsigned int HLTTrackClusterRemoverNew::NumberOfParamBlocks = 6
staticprivate

Definition at line 63 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and process().

◆ oldPxlMaskToken_

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

Definition at line 73 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ oldStrMaskToken_

edm::EDGetTokenT<StripMaskContainer> HLTTrackClusterRemoverNew::oldStrMaskToken_
private

Definition at line 74 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ pblocks_

ParamBlock HLTTrackClusterRemoverNew::pblocks_[NumberOfParamBlocks]
private

Definition at line 77 of file HLTTrackClusterRemoverNew.cc.

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

◆ pixelClusters_

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

Definition at line 71 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ pixels

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

Definition at line 87 of file HLTTrackClusterRemoverNew.cc.

◆ pixelSourceProdID

edm::ProductID HLTTrackClusterRemoverNew::pixelSourceProdID
private

Definition at line 88 of file HLTTrackClusterRemoverNew.cc.

Referenced by process(), and produce().

◆ stripClusters_

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > HLTTrackClusterRemoverNew::stripClusters_
private

Definition at line 72 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ strips

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

Definition at line 87 of file HLTTrackClusterRemoverNew.cc.

◆ stripSourceProdID

edm::ProductID HLTTrackClusterRemoverNew::stripSourceProdID
private

Definition at line 88 of file HLTTrackClusterRemoverNew.cc.

Referenced by process(), and produce().

◆ trajectories_

edm::EDGetTokenT<std::vector<Trajectory> > HLTTrackClusterRemoverNew::trajectories_
private

Definition at line 75 of file HLTTrackClusterRemoverNew.cc.

Referenced by HLTTrackClusterRemoverNew(), and produce().

◆ tTrackerGeom_

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

Definition at line 45 of file HLTTrackClusterRemoverNew.cc.

Referenced by produce().