CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ctfseeding::HitExtractorSTRP Class Referencefinal

#include <HitExtractorSTRP.h>

Inheritance diagram for ctfseeding::HitExtractorSTRP:
ctfseeding::HitExtractor

Public Types

typedef SiStripRecHit2D::ClusterRef SiStripClusterRef
 
- Public Types inherited from ctfseeding::HitExtractor
using HitPointer = mayown_ptr< BaseTrackerRecHit >
 
using Hits = std::vector< HitPointer >
 
using TkHit = BaseTrackerRecHit
 
using TkHitRef = BaseTrackerRecHit const &
 

Public Member Functions

void cleanedOfClusters (const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &ev, HitExtractor::Hits &hits, bool matched, unsigned int cleanFrom=0) const
 
HitExtractorSTRPclone () const override
 
std::tuple< int, int > getMinMaxRing () const
 
 HitExtractorSTRP (GeomDetEnumerators::SubDetector subdet, TrackerDetSide side, int idLayer, float iminGoodCharge)
 
HitExtractor::Hits hits (const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const override
 
void setMinAbsZ (double minZToSet)
 
void setNoProjection ()
 
std::pair< bool, ProjectedSiStripRecHit2D * > skipThis (const TkTransientTrackingRecHitBuilder &ttrhBuilder, TkHitRef matched, edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &stripClusterMask) const
 
bool skipThis (DetId id, OmniClusterRef const &clus, edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &stripClusterMask) const
 
void useMatchedHits (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
bool useRingSelector () const
 
void useRingSelector (int minRing, int maxRing)
 
void useRPhiHits (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
void useSimpleRphiHitsCleaner (bool use)
 
void useStereoHits (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
void useVectorHits (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
 ~HitExtractorSTRP () override
 
- Public Member Functions inherited from ctfseeding::HitExtractor
 HitExtractor ()
 
void useSkipClusters (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
virtual ~HitExtractor ()
 

Private Types

typedef edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > SkipClustersCollection
 
typedef edm::ContainerMask< Phase2TrackerCluster1DCollectionNewSkipPhase2ClustersCollection
 

Private Member Functions

bool ringRange (int ring) const
 
void useSkipClusters_ (const edm::InputTag &m, edm::ConsumesCollector &iC) override
 

Private Attributes

bool failProjection
 
bool hasMatchedHits
 
bool hasRingSelector
 
bool hasRPhiHits
 
bool hasSimpleRphiHitsCleaner
 
bool hasStereoHits
 
bool hasVectorHits
 
double minAbsZ
 
int theIdLayer
 
const GeomDetEnumerators::SubDetector theLayerSubDet
 
edm::EDGetTokenT< SiStripMatchedRecHit2DCollectiontheMatchedHits
 
int theMaxRing
 
int theMinRing
 
edm::EDGetTokenT< SiStripRecHit2DCollectiontheRPhiHits
 
TrackerDetSide theSide
 
edm::EDGetTokenT< SkipClustersCollectiontheSkipClusters
 
edm::EDGetTokenT< SkipPhase2ClustersCollectiontheSkipPhase2Clusters
 
edm::EDGetTokenT< SiStripRecHit2DCollectiontheStereoHits
 
edm::EDGetTokenT< VectorHitCollectiontheVectorHits
 

Additional Inherited Members

- Public Attributes inherited from ctfseeding::HitExtractor
bool filterCluster = false
 
bool maskCluster = false
 
float minGoodCharge = 0
 
bool skipClusters = false
 

Detailed Description

Definition at line 24 of file HitExtractorSTRP.h.

Member Typedef Documentation

◆ SiStripClusterRef

Definition at line 26 of file HitExtractorSTRP.h.

◆ SkipClustersCollection

Definition at line 80 of file HitExtractorSTRP.h.

◆ SkipPhase2ClustersCollection

Definition at line 81 of file HitExtractorSTRP.h.

Constructor & Destructor Documentation

◆ HitExtractorSTRP()

HitExtractorSTRP::HitExtractorSTRP ( GeomDetEnumerators::SubDetector  subdet,
TrackerDetSide  side,
int  idLayer,
float  iminGoodCharge 
)

Definition at line 29 of file HitExtractorSTRP.cc.

33  : theLayerSubDet(subdet),
34  theSide(side),
35  theIdLayer(idLayer),
36  minAbsZ(0),
37  theMinRing(1),
38  theMaxRing(0),
39  hasMatchedHits(false),
40  hasRPhiHits(false),
41  hasStereoHits(false),
42  hasVectorHits(false),
43  hasRingSelector(false),
45  minGoodCharge = iminGoodCharge;
46  if (minGoodCharge > 0)
47  skipClusters = true;
48 }

References ctfseeding::HitExtractor::minGoodCharge, and ctfseeding::HitExtractor::skipClusters.

Referenced by clone().

◆ ~HitExtractorSTRP()

ctfseeding::HitExtractorSTRP::~HitExtractorSTRP ( )
inlineoverride

Definition at line 29 of file HitExtractorSTRP.h.

29 {}

Member Function Documentation

◆ cleanedOfClusters()

void HitExtractorSTRP::cleanedOfClusters ( const TkTransientTrackingRecHitBuilder ttrhBuilder,
const edm::Event ev,
HitExtractor::Hits hits,
bool  matched,
unsigned int  cleanFrom = 0 
) const

Definition at line 116 of file HitExtractorSTRP.cc.

120  {
121  unsigned int skipped = 0;
122  unsigned int projected = 0;
124  LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " strip hit in input.";
125  edm::Handle<SkipClustersCollection> stripClusterMask;
126  if (maskCluster)
127  ev.getByToken(theSkipClusters, stripClusterMask);
128  for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) {
129  assert(hits[iH]->isValid());
130  auto id = hits[iH]->geographicalId();
131  if (matched) {
132  auto [replace, replaceMe] = skipThis(ttrhBuilder, *hits[iH], stripClusterMask);
133  if (replace) {
134  if (!replaceMe) {
135  LogTrace("HitExtractorSTRP") << "skipping a matched hit on :" << hits[iH]->geographicalId().rawId();
136  skipped++;
137  } else {
138  projected++;
139  }
140  hits[iH].reset(replaceMe);
141  if (replaceMe == nullptr)
142  assert(hits[iH].empty());
143  else
144  assert(hits[iH].isOwn());
145  }
146  } else if (skipThis(id, hits[iH]->firstClusterRef(), stripClusterMask)) {
147  LogTrace("HitExtractorSTRP") << "skipping a hit on :" << hits[iH]->geographicalId().rawId() << " key: ";
148  skipped++;
149  hits[iH].reset();
150  }
151  }
152  }
153  if (hasVectorHits) {
154  LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " vector hit in input.";
156  if (maskCluster)
157  ev.getByToken(theSkipPhase2Clusters, ph2ClusterMask);
158  for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) {
159  LogTrace("HitExtractorSTRP") << "analizing hit on :" << hits[iH]->geographicalId().rawId();
160  assert(hits[iH]->isValid());
161  const VectorHit& vhit = dynamic_cast<VectorHit const&>(*hits[iH]);
162  LogTrace("HitExtractorSTRP") << " key lower: " << vhit.lowerClusterRef().key()
163  << " and key upper: " << vhit.upperClusterRef().key();
164  LogTrace("HitExtractorSTRP") << " key lower: " << hits[iH]->firstClusterRef().key();
165 
166  //FIXME:: introduce a "projected" version later?
167  if (maskCluster &&
168  (ph2ClusterMask->mask(vhit.lowerClusterRef().key()) || ph2ClusterMask->mask(vhit.upperClusterRef().key()))) {
169  LogTrace("HitExtractorSTRP") << "skipping a vector hit on :" << hits[iH]->geographicalId().rawId()
170  << " key lower: " << vhit.lowerClusterRef().key()
171  << " and key upper: " << vhit.upperClusterRef().key();
172  skipped++;
173  hits[iH].reset();
174  }
175  }
176  }
177 
178  // remove empty elements...
179  auto last = std::remove_if(hits.begin() + cleanFrom, hits.end(), [](HitPointer const& p) { return p.empty(); });
180  hits.resize(last - hits.begin());
181 
182  LogTrace("HitExtractorSTRP") << "skipped :" << skipped << " rechits because of clusters and projected: " << projected;
183 }

References cms::cuda::assert(), relativeConstraints::empty, ev, hasMatchedHits, hasRPhiHits, hasStereoHits, hasVectorHits, hits(), OmniClusterRef::key(), dqmdumpme::last, LogTrace, VectorHit::lowerClusterRef(), edm::ContainerMask< T >::mask(), ctfseeding::HitExtractor::maskCluster, muonTagProbeFilters_cff::matched, AlCaHLTBitMon_ParallelJobs::p, python.rootplot.root2matplotlib::replace(), runEdmFileComparison::skipped, skipThis(), theSkipClusters, theSkipPhase2Clusters, and VectorHit::upperClusterRef().

Referenced by hits().

◆ clone()

HitExtractorSTRP* ctfseeding::HitExtractorSTRP::clone ( void  ) const
inlineoverridevirtual

Implements ctfseeding::HitExtractor.

Definition at line 34 of file HitExtractorSTRP.h.

34 { return new HitExtractorSTRP(*this); }

References HitExtractorSTRP().

◆ getMinMaxRing()

std::tuple<int, int> ctfseeding::HitExtractorSTRP::getMinMaxRing ( ) const
inline

Definition at line 75 of file HitExtractorSTRP.h.

75 { return std::make_tuple(theMinRing, theMaxRing); }

References theMaxRing, and theMinRing.

◆ hits()

HitExtractor::Hits HitExtractorSTRP::hits ( const TkTransientTrackingRecHitBuilder ttrhBuilder,
const edm::Event ev,
const edm::EventSetup es 
) const
overridevirtual

Implements ctfseeding::HitExtractor.

Definition at line 185 of file HitExtractorSTRP.cc.

187  {
188  LogDebug("HitExtractorSTRP") << "HitExtractorSTRP::hits";
190  unsigned int cleanFrom = 0;
191 
192  //Retrieve tracker topology from geometry
193  edm::ESHandle<TrackerTopology> tTopoHandle;
194  es.get<TrackerTopologyRcd>().get(tTopoHandle);
195  const TrackerTopology* const tTopo = tTopoHandle.product();
196 
197  //
198  // TIB
199  //
201  LogTrace("HitExtractorSTRP") << "Getting hits into the TIB";
202  if (hasMatchedHits) {
204  ev.getByToken(theMatchedHits, matchedHits);
205  if (skipClusters)
206  cleanFrom = result.size();
208  if (skipClusters)
209  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
210  }
211  if (hasRPhiHits) {
213  ev.getByToken(theRPhiHits, rphiHits);
214  if (hasMatchedHits) {
215  if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future
216  if (skipClusters)
217  cleanFrom = result.size();
219  if (skipClusters)
220  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
221  }
222  } else {
223  if (skipClusters)
224  cleanFrom = result.size();
226  if (skipClusters)
227  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
228  }
229  }
230  if (hasStereoHits) {
232  ev.getByToken(theStereoHits, stereoHits);
233  if (skipClusters)
234  cleanFrom = result.size();
236  if (skipClusters)
237  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
238  }
239  if (hasVectorHits) {
240  LogError("HitExtractorSTRP") << "TIB is not supposed to be in Phase2 TRK detector configuration. What follows "
241  "have never been checked before! ";
242  auto const& vectorHits = ev.get(theVectorHits);
243  if (skipClusters)
244  cleanFrom = result.size();
246  if (skipClusters)
247  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
248  }
249 
250  }
251 
252  //
253  // TID
254  //
256  LogTrace("HitExtractorSTRP") << "Getting hits into the TID";
257  if (hasMatchedHits) {
259  ev.getByToken(theMatchedHits, matchedHits);
260  if (skipClusters)
261  cleanFrom = result.size();
262  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
263  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
264  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
265  int ring = tTopo->tidRing(it->detId());
266  if (!ringRange(ring))
267  continue;
268  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
269  ++hit) {
270  result.emplace_back(*hit);
271  }
272  }
273  if (skipClusters)
274  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
275  }
276  if (hasRPhiHits) {
278  ev.getByToken(theRPhiHits, rphiHits);
279  if (skipClusters)
280  cleanFrom = result.size();
281  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
282  SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second);
283  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
284  int ring = tTopo->tidRing(it->detId());
285  if (!ringRange(ring))
286  continue;
287  if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner)
288  continue; // this is a brutal "cleaning". Add something smarter in the future
289  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
290  result.emplace_back(*hit);
291  }
292  }
293  if (skipClusters)
294  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
295  }
296  if (hasStereoHits) {
298  ev.getByToken(theStereoHits, stereoHits);
299  if (skipClusters)
300  cleanFrom = result.size();
301  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
302  SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second);
303  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
304  int ring = tTopo->tidRing(it->detId());
305  if (!ringRange(ring))
306  continue;
307  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
308  result.emplace_back(*hit);
309  }
310  }
311  if (skipClusters)
312  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
313  }
314  if (hasVectorHits) {
315  LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer;
316  auto const& vectorHits = ev.get(theVectorHits);
317  //FIXME: check the skipClusters with VHits
318  if (skipClusters)
319  cleanFrom = result.size();
320  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
321  VectorHitCollection::Range range = vectorHits.equal_range(getter.first, getter.second);
322  for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) {
323  int ring = tTopo->tidRing(it->detId());
324  if (!ringRange(ring))
325  continue;
326  for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
327  result.emplace_back(*hit);
328  }
329  }
330  LogTrace("HitExtractorSTRP") << "result size value:" << result.size();
331  if (skipClusters)
332  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
333  }
334  }
335  //
336  // TOB
337  //
339  LogTrace("HitExtractorSTRP") << "Getting hits into the TOB";
340  if (hasMatchedHits) {
342  ev.getByToken(theMatchedHits, matchedHits);
343  if (skipClusters)
344  cleanFrom = result.size();
345  if (minAbsZ > 0.) {
346  auto getter = tTopo->tobDetIdLayerComparator(theIdLayer);
347  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
348  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
349  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
350  ++hit) {
351  if (fabs(hit->globalPosition().z()) >= minAbsZ)
352  result.emplace_back(*hit);
353  }
354  }
355  } else {
357  }
358  if (skipClusters)
359  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
360  }
361  if (hasRPhiHits) {
363  ev.getByToken(theRPhiHits, rphiHits);
364  if (hasMatchedHits) {
365  if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future
366  if (skipClusters)
367  cleanFrom = result.size();
369  if (skipClusters)
370  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
371  }
372  } else {
373  if (skipClusters)
374  cleanFrom = result.size();
376  if (skipClusters)
377  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
378  }
379  }
380  if (hasStereoHits) {
382  ev.getByToken(theStereoHits, stereoHits);
383  if (skipClusters)
384  cleanFrom = result.size();
386  if (skipClusters)
387  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
388  }
389  if (hasVectorHits) {
390  LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer;
392  ev.getByToken(theVectorHits, vectorHits);
393  //FIXME: check the skipClusters with VHits
394  if (skipClusters)
395  cleanFrom = result.size();
397  if (skipClusters)
398  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
399  }
400 
401  }
402 
403  //
404  // TEC
405  //
407  LogTrace("HitExtractorSTRP") << "Getting hits into the TEC";
408  if (hasMatchedHits) {
410  ev.getByToken(theMatchedHits, matchedHits);
411  if (skipClusters)
412  cleanFrom = result.size();
413  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
414  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
415  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
416  int ring = tTopo->tecRing(it->detId());
417  if (!ringRange(ring))
418  continue;
419  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
420  ++hit) {
421  result.emplace_back(*hit);
422  }
423  }
424  if (skipClusters)
425  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
426  }
427  if (hasRPhiHits) {
429  ev.getByToken(theRPhiHits, rphiHits);
430  if (skipClusters)
431  cleanFrom = result.size();
432  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
433  SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second);
434  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
435  int ring = tTopo->tecRing(it->detId());
436  if (!ringRange(ring))
437  continue;
438  if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner)
439  continue; // this is a brutal "cleaning". Add something smarter in the future
440  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
441  result.emplace_back(*hit);
442  }
443  }
444  if (skipClusters)
445  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
446  }
447  if (hasStereoHits) {
449  ev.getByToken(theStereoHits, stereoHits);
450  if (skipClusters)
451  cleanFrom = result.size();
452  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
453  SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second);
454  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
455  int ring = tTopo->tecRing(it->detId());
456  if (!ringRange(ring))
457  continue;
458  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
459  result.emplace_back(*hit);
460  }
461  }
462  if (skipClusters)
463  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
464  }
465  if (hasVectorHits) {
466  LogError("HitExtractorSTRP") << "TEC is not supposed to be in Phase2 TRK detector configuration. What follows "
467  "have never been checked before! ";
469  ev.getByToken(theVectorHits, vectorHits);
470  if (skipClusters)
471  cleanFrom = result.size();
472  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
473  VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second);
474  for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) {
475  int ring = tTopo->tidRing(it->detId());
476  if (!ringRange(ring))
477  continue;
478  for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
479  result.emplace_back(*hit);
480  }
481  }
482  if (skipClusters)
483  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
484  }
485  }
486 
487  LogDebug("HitExtractorSTRP") << " giving: " << result.size() << " out for charge cut " << minGoodCharge;
488  return result;
489 }

References cleanedOfClusters(), mps_fire::end, edmNew::DetSetVector< T >::equal_range(), ev, edm::EventSetup::get(), get, hasMatchedHits, hasRPhiHits, hasSimpleRphiHitsCleaner, hasStereoHits, hasVectorHits, LogDebug, LogTrace, minAbsZ, ctfseeding::HitExtractor::minGoodCharge, edm::ESHandle< T >::product(), FastTimerService_cff::range, ctfseeding::range2SeedingHits(), mps_fire::result, relativeConstraints::ring, ringRange(), ctfseeding::HitExtractor::skipClusters, GeomDetEnumerators::TEC, TrackerTopology::tecDetIdWheelComparator(), TrackerTopology::tecRing(), theIdLayer, theLayerSubDet, theMatchedHits, theRPhiHits, theSide, theStereoHits, theVectorHits, GeomDetEnumerators::TIB, TrackerTopology::tibDetIdLayerComparator(), GeomDetEnumerators::TID, TrackerTopology::tidDetIdWheelComparator(), TrackerTopology::tidRing(), GeomDetEnumerators::TOB, TrackerTopology::tobDetIdLayerComparator(), HLT_FULL_cff::vectorHits, and hit::z.

Referenced by cleanedOfClusters().

◆ ringRange()

bool HitExtractorSTRP::ringRange ( int  ring) const
private

Definition at line 61 of file HitExtractorSTRP.cc.

61  {
62  if (!hasRingSelector)
63  return true;
64  return (ring >= theMinRing) & (ring <= theMaxRing);
65 }

References hasRingSelector, relativeConstraints::ring, theMaxRing, and theMinRing.

Referenced by hits().

◆ setMinAbsZ()

void ctfseeding::HitExtractorSTRP::setMinAbsZ ( double  minZToSet)
inline

Definition at line 72 of file HitExtractorSTRP.h.

72 { minAbsZ = minZToSet; }

References minAbsZ.

◆ setNoProjection()

void ctfseeding::HitExtractorSTRP::setNoProjection ( )
inline

Definition at line 71 of file HitExtractorSTRP.h.

71 { failProjection = true; }

References failProjection.

◆ skipThis() [1/2]

std::pair< bool, ProjectedSiStripRecHit2D * > HitExtractorSTRP::skipThis ( const TkTransientTrackingRecHitBuilder ttrhBuilder,
TkHitRef  matched,
edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &  stripClusterMask 
) const

Definition at line 79 of file HitExtractorSTRP.cc.

82  {
84 
85  assert(dynamic_cast<SiStripMatchedRecHit2D const*>(&matched));
86 
87  auto id = hit.geographicalId();
88  ProjectedSiStripRecHit2D* replaceMe = nullptr;
89  bool rejectSt = skipThis(id, hit.stereoClusterRef(), stripClusterMask);
90  bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask);
91 
92  if ((!rejectSt) & (!rejectMono)) {
93  // keepit
94  return std::make_pair(false, replaceMe);
95  }
96 
97  if (failProjection || (rejectSt & rejectMono)) {
98  //only skip if both hits are done
99  return std::make_pair(true, replaceMe);
100  }
101 
102  // replace with one
103 
104  auto cloner = ttrhBuilder.cloner();
105  replaceMe = cloner.project(hit, rejectSt, TrajectoryStateOnSurface()).release();
106  if (rejectSt)
107  LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the mono hit got projected onto: "
108  << replaceMe->geographicalId().rawId() << " key: " << hit.monoClusterRef().key();
109  else
110  LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the stereo hit got projected onto: "
111  << replaceMe->geographicalId().rawId() << " key: " << hit.stereoClusterRef().key();
112 
113  return std::make_pair(true, replaceMe);
114 }

References cms::cuda::assert(), TkTransientTrackingRecHitBuilder::cloner(), failProjection, TrackingRecHit::geographicalId(), LogDebug, muonTagProbeFilters_cff::matched, and DetId::rawId().

Referenced by cleanedOfClusters().

◆ skipThis() [2/2]

bool HitExtractorSTRP::skipThis ( DetId  id,
OmniClusterRef const &  clus,
edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &  stripClusterMask 
) const

Definition at line 67 of file HitExtractorSTRP.cc.

70  {
71  if (maskCluster && (stripClusterMask->mask(clus.key())))
72  return true;
73 
74  if UNLIKELY (minGoodCharge <= 0)
75  return false;
76  return siStripClusterTools::chargePerCM(id, *clus.cluster_strip()) <= minGoodCharge;
77 }

References siStripClusterTools::chargePerCM(), OmniClusterRef::cluster_strip(), OmniClusterRef::key(), ctfseeding::HitExtractor::maskCluster, ctfseeding::HitExtractor::minGoodCharge, and UNLIKELY.

◆ useMatchedHits()

void ctfseeding::HitExtractorSTRP::useMatchedHits ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
inline

◆ useRingSelector() [1/2]

bool ctfseeding::HitExtractorSTRP::useRingSelector ( ) const
inline

Definition at line 74 of file HitExtractorSTRP.h.

74 { return hasRingSelector; }

References hasRingSelector.

◆ useRingSelector() [2/2]

void HitExtractorSTRP::useRingSelector ( int  minRing,
int  maxRing 
)

Definition at line 55 of file HitExtractorSTRP.cc.

55  {
56  hasRingSelector = true;
59 }

References hasRingSelector, HLT_FULL_cff::maxRing, HLT_FULL_cff::minRing, theMaxRing, and theMinRing.

◆ useRPhiHits()

void ctfseeding::HitExtractorSTRP::useRPhiHits ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
inline

◆ useSimpleRphiHitsCleaner()

void ctfseeding::HitExtractorSTRP::useSimpleRphiHitsCleaner ( bool  use)
inline

Definition at line 54 of file HitExtractorSTRP.h.

54 { hasSimpleRphiHitsCleaner = use; }

References hasSimpleRphiHitsCleaner.

◆ useSkipClusters_()

void HitExtractorSTRP::useSkipClusters_ ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
overrideprivatevirtual

◆ useStereoHits()

void ctfseeding::HitExtractorSTRP::useStereoHits ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
inline

◆ useVectorHits()

void ctfseeding::HitExtractorSTRP::useVectorHits ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
inline

Member Data Documentation

◆ failProjection

bool ctfseeding::HitExtractorSTRP::failProjection
private

Definition at line 102 of file HitExtractorSTRP.h.

Referenced by setNoProjection(), and skipThis().

◆ hasMatchedHits

bool ctfseeding::HitExtractorSTRP::hasMatchedHits
private

Definition at line 96 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), hits(), and useMatchedHits().

◆ hasRingSelector

bool ctfseeding::HitExtractorSTRP::hasRingSelector
private

Definition at line 100 of file HitExtractorSTRP.h.

Referenced by ringRange(), and useRingSelector().

◆ hasRPhiHits

bool ctfseeding::HitExtractorSTRP::hasRPhiHits
private

Definition at line 97 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), hits(), and useRPhiHits().

◆ hasSimpleRphiHitsCleaner

bool ctfseeding::HitExtractorSTRP::hasSimpleRphiHitsCleaner
private

Definition at line 101 of file HitExtractorSTRP.h.

Referenced by hits(), and useSimpleRphiHitsCleaner().

◆ hasStereoHits

bool ctfseeding::HitExtractorSTRP::hasStereoHits
private

Definition at line 98 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), hits(), and useStereoHits().

◆ hasVectorHits

bool ctfseeding::HitExtractorSTRP::hasVectorHits
private

Definition at line 99 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), hits(), and useVectorHits().

◆ minAbsZ

double ctfseeding::HitExtractorSTRP::minAbsZ
private

Definition at line 88 of file HitExtractorSTRP.h.

Referenced by hits(), and setMinAbsZ().

◆ theIdLayer

int ctfseeding::HitExtractorSTRP::theIdLayer
private

Definition at line 87 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theLayerSubDet

const GeomDetEnumerators::SubDetector ctfseeding::HitExtractorSTRP::theLayerSubDet
private

Definition at line 85 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theMatchedHits

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> ctfseeding::HitExtractorSTRP::theMatchedHits
private

Definition at line 92 of file HitExtractorSTRP.h.

Referenced by hits(), and useMatchedHits().

◆ theMaxRing

int ctfseeding::HitExtractorSTRP::theMaxRing
private

Definition at line 89 of file HitExtractorSTRP.h.

Referenced by getMinMaxRing(), ringRange(), and useRingSelector().

◆ theMinRing

int ctfseeding::HitExtractorSTRP::theMinRing
private

Definition at line 89 of file HitExtractorSTRP.h.

Referenced by getMinMaxRing(), ringRange(), and useRingSelector().

◆ theRPhiHits

edm::EDGetTokenT<SiStripRecHit2DCollection> ctfseeding::HitExtractorSTRP::theRPhiHits
private

Definition at line 93 of file HitExtractorSTRP.h.

Referenced by hits(), and useRPhiHits().

◆ theSide

TrackerDetSide ctfseeding::HitExtractorSTRP::theSide
private

Definition at line 86 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theSkipClusters

edm::EDGetTokenT<SkipClustersCollection> ctfseeding::HitExtractorSTRP::theSkipClusters
private

Definition at line 90 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), and useSkipClusters_().

◆ theSkipPhase2Clusters

edm::EDGetTokenT<SkipPhase2ClustersCollection> ctfseeding::HitExtractorSTRP::theSkipPhase2Clusters
private

Definition at line 91 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), and useSkipClusters_().

◆ theStereoHits

edm::EDGetTokenT<SiStripRecHit2DCollection> ctfseeding::HitExtractorSTRP::theStereoHits
private

Definition at line 94 of file HitExtractorSTRP.h.

Referenced by hits(), and useStereoHits().

◆ theVectorHits

edm::EDGetTokenT<VectorHitCollection> ctfseeding::HitExtractorSTRP::theVectorHits
private

Definition at line 95 of file HitExtractorSTRP.h.

Referenced by hits(), and useVectorHits().

muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
HLT_FULL_cff.maxRing
maxRing
Definition: HLT_FULL_cff.py:46668
TrackerTopology::tobDetIdLayerComparator
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:552
funct::false
false
Definition: Factorize.h:29
ctfseeding::HitExtractorSTRP::hasMatchedHits
bool hasMatchedHits
Definition: HitExtractorSTRP.h:96
ctfseeding::HitExtractor::maskCluster
bool maskCluster
Definition: HitExtractor.h:46
GeomDetEnumerators::TID
Definition: GeomDetEnumerators.h:15
ctfseeding::HitExtractorSTRP::skipThis
std::pair< bool, ProjectedSiStripRecHit2D * > skipThis(const TkTransientTrackingRecHitBuilder &ttrhBuilder, TkHitRef matched, edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &stripClusterMask) const
Definition: HitExtractorSTRP.cc:79
ctfseeding::HitExtractor::skipClusters
bool skipClusters
Definition: HitExtractor.h:44
TrackerTopology::tibDetIdLayerComparator
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:544
ctfseeding::HitExtractorSTRP::hits
HitExtractor::Hits hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const override
Definition: HitExtractorSTRP.cc:185
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GeomDetEnumerators::TIB
Definition: GeomDetEnumerators.h:13
siStripClusterTools::chargePerCM
float chargePerCM(DetId detid, Iter a, Iter b)
Definition: SiStripClusterTools.h:29
ctfseeding::HitExtractorSTRP::failProjection
bool failProjection
Definition: HitExtractorSTRP.h:102
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
ctfseeding::HitExtractorSTRP::theRPhiHits
edm::EDGetTokenT< SiStripRecHit2DCollection > theRPhiHits
Definition: HitExtractorSTRP.h:93
cms::cuda::assert
assert(be >=bs)
GeomDetEnumerators::TOB
Definition: GeomDetEnumerators.h:14
ctfseeding::HitExtractorSTRP::theStereoHits
edm::EDGetTokenT< SiStripRecHit2DCollection > theStereoHits
Definition: HitExtractorSTRP.h:94
mathSSE::return
return((rh ^ lh) &mask)
ctfseeding::HitExtractorSTRP::theIdLayer
int theIdLayer
Definition: HitExtractorSTRP.h:87
TkTransientTrackingRecHitBuilder::cloner
TkClonerImpl cloner() const
Definition: TkTransientTrackingRecHitBuilder.h:37
edm::Handle
Definition: AssociativeIterator.h:50
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
ProjectedSiStripRecHit2D
Definition: ProjectedSiStripRecHit2D.h:8
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
siStripClusterTools
Definition: SiStripClusterTools.h:9
ctfseeding::HitExtractor::HitPointer
mayown_ptr< BaseTrackerRecHit > HitPointer
Definition: HitExtractor.h:27
ctfseeding::HitExtractorSTRP::hasRingSelector
bool hasRingSelector
Definition: HitExtractorSTRP.h:100
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
dqmdumpme.last
last
Definition: dqmdumpme.py:56
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
ctfseeding::HitExtractorSTRP::hasVectorHits
bool hasVectorHits
Definition: HitExtractorSTRP.h:99
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mps_fire.end
end
Definition: mps_fire.py:242
edm::ESHandle< TrackerTopology >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
ctfseeding::HitExtractorSTRP::ringRange
bool ringRange(int ring) const
Definition: HitExtractorSTRP.cc:61
ctfseeding::HitExtractorSTRP::hasSimpleRphiHitsCleaner
bool hasSimpleRphiHitsCleaner
Definition: HitExtractorSTRP.h:101
hit::z
double z
Definition: SiStripHitEffFromCalibTree.cc:91
VectorHit::upperClusterRef
const OmniClusterRef upperClusterRef() const
Definition: VectorHit.h:94
TrackerTopology::tidDetIdWheelComparator
std::pair< DetId, SameLayerComparator > tidDetIdWheelComparator(uint32_t side, uint32_t wheel) const
Definition: TrackerTopology.h:548
edmNew::DetSetVector::equal_range
Range equal_range(id_type i, CMP cmp, bool update=false) const
Definition: DetSetVectorNew.h:542
ctfseeding::range2SeedingHits
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:54
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
ctfseeding::HitExtractorSTRP::hasStereoHits
bool hasStereoHits
Definition: HitExtractorSTRP.h:98
ctfseeding::HitExtractorSTRP::HitExtractorSTRP
HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, TrackerDetSide side, int idLayer, float iminGoodCharge)
Definition: HitExtractorSTRP.cc:29
ctfseeding::HitExtractorSTRP::theMaxRing
int theMaxRing
Definition: HitExtractorSTRP.h:89
GeomDetEnumerators::TEC
Definition: GeomDetEnumerators.h:16
ctfseeding::HitExtractorSTRP::theSide
TrackerDetSide theSide
Definition: HitExtractorSTRP.h:86
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
edmNew::DetSetVector::Range
std::pair< const_iterator, const_iterator > Range
Definition: DetSetVectorNew.h:198
ctfseeding::HitExtractorSTRP::cleanedOfClusters
void cleanedOfClusters(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &ev, HitExtractor::Hits &hits, bool matched, unsigned int cleanFrom=0) const
Definition: HitExtractorSTRP.cc:116
get
#define get
ctfseeding::HitExtractorSTRP::theLayerSubDet
const GeomDetEnumerators::SubDetector theLayerSubDet
Definition: HitExtractorSTRP.h:85
VectorHit::lowerClusterRef
const OmniClusterRef lowerClusterRef() const
Definition: VectorHit.h:93
ctfseeding::HitExtractorSTRP::SkipClustersCollection
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > SkipClustersCollection
Definition: HitExtractorSTRP.h:80
ctfseeding::HitExtractor::Hits
std::vector< HitPointer > Hits
Definition: HitExtractor.h:28
HLT_FULL_cff.vectorHits
vectorHits
Definition: HLT_FULL_cff.py:9503
VectorHit
Definition: VectorHit.h:28
edmNew::DetSetVector
Definition: DetSetNew.h:13
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TrackerTopology::tecDetIdWheelComparator
std::pair< DetId, SameLayerComparator > tecDetIdWheelComparator(uint32_t side, uint32_t wheel) const
Definition: TrackerTopology.h:540
ctfseeding::HitExtractorSTRP::minAbsZ
double minAbsZ
Definition: HitExtractorSTRP.h:88
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
ctfseeding::HitExtractorSTRP::theSkipPhase2Clusters
edm::EDGetTokenT< SkipPhase2ClustersCollection > theSkipPhase2Clusters
Definition: HitExtractorSTRP.h:91
ctfseeding::HitExtractor::minGoodCharge
float minGoodCharge
Definition: HitExtractor.h:47
ctfseeding::HitExtractorSTRP::theSkipClusters
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters
Definition: HitExtractorSTRP.h:90
mps_fire.result
result
Definition: mps_fire.py:311
edm::ContainerMask::mask
bool mask(unsigned int iIndex) const
Definition: ContainerMask.h:43
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
ctfseeding::HitExtractorSTRP::theMinRing
int theMinRing
Definition: HitExtractorSTRP.h:89
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
runEdmFileComparison.skipped
skipped
Definition: runEdmFileComparison.py:225
ctfseeding::HitExtractorSTRP::theVectorHits
edm::EDGetTokenT< VectorHitCollection > theVectorHits
Definition: HitExtractorSTRP.h:95
OmniClusterRef::key
unsigned int key() const
Definition: OmniClusterRef.h:70
hit
Definition: SiStripHitEffFromCalibTree.cc:88
ctfseeding::HitExtractorSTRP::theMatchedHits
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > theMatchedHits
Definition: HitExtractorSTRP.h:92
HLT_FULL_cff.minRing
minRing
Definition: HLT_FULL_cff.py:46665
ctfseeding::HitExtractorSTRP::hasRPhiHits
bool hasRPhiHits
Definition: HitExtractorSTRP.h:97
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444
ctfseeding::HitExtractorSTRP::SkipPhase2ClustersCollection
edm::ContainerMask< Phase2TrackerCluster1DCollectionNew > SkipPhase2ClustersCollection
Definition: HitExtractorSTRP.h:81