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, edm::ConsumesCollector &iC)
 
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)
 
void useRingSelector (int minRing, int maxRing)
 
bool useRingSelector () const
 
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::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTtopo
 
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 26 of file HitExtractorSTRP.h.

Member Typedef Documentation

◆ SiStripClusterRef

Definition at line 28 of file HitExtractorSTRP.h.

◆ SkipClustersCollection

Definition at line 86 of file HitExtractorSTRP.h.

◆ SkipPhase2ClustersCollection

Definition at line 87 of file HitExtractorSTRP.h.

Constructor & Destructor Documentation

◆ HitExtractorSTRP()

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

Definition at line 23 of file HitExtractorSTRP.cc.

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

Referenced by clone().

28  : theLayerSubDet(subdet),
29  theSide(side),
30  theIdLayer(idLayer),
31  minAbsZ(0),
32  theMinRing(1),
33  theMaxRing(0),
34  theTtopo(iC.esConsumes()),
35  hasMatchedHits(false),
36  hasRPhiHits(false),
37  hasStereoHits(false),
38  hasVectorHits(false),
39  hasRingSelector(false),
41  minGoodCharge = iminGoodCharge;
42  if (minGoodCharge > 0)
43  skipClusters = true;
44 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopo
const GeomDetEnumerators::SubDetector theLayerSubDet

◆ ~HitExtractorSTRP()

ctfseeding::HitExtractorSTRP::~HitExtractorSTRP ( )
inlineoverride

Definition at line 35 of file HitExtractorSTRP.h.

35 {}

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 112 of file HitExtractorSTRP.cc.

References cms::cuda::assert(), runTheMatrix::const, relativeConstraints::empty, makeMEIFBenchmarkPlots::ev, hasMatchedHits, hasRPhiHits, hasStereoHits, hasVectorHits, hits(), sistrip::SpyUtilities::isValid(), 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().

116  {
117  unsigned int skipped = 0;
118  unsigned int projected = 0;
120  LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " strip hit in input.";
121  edm::Handle<SkipClustersCollection> stripClusterMask;
122  if (maskCluster)
123  ev.getByToken(theSkipClusters, stripClusterMask);
124  for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) {
125  assert(hits[iH]->isValid());
126  auto id = hits[iH]->geographicalId();
127  if (matched) {
128  auto [replace, replaceMe] = skipThis(ttrhBuilder, *hits[iH], stripClusterMask);
129  if (replace) {
130  if (!replaceMe) {
131  LogTrace("HitExtractorSTRP") << "skipping a matched hit on :" << hits[iH]->geographicalId().rawId();
132  skipped++;
133  } else {
134  projected++;
135  }
136  hits[iH].reset(replaceMe);
137  if (replaceMe == nullptr)
138  assert(hits[iH].empty());
139  else
140  assert(hits[iH].isOwn());
141  }
142  } else if (skipThis(id, hits[iH]->firstClusterRef(), stripClusterMask)) {
143  LogTrace("HitExtractorSTRP") << "skipping a hit on :" << hits[iH]->geographicalId().rawId() << " key: ";
144  skipped++;
145  hits[iH].reset();
146  }
147  }
148  }
149  if (hasVectorHits) {
150  LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " vector hit in input.";
152  if (maskCluster)
153  ev.getByToken(theSkipPhase2Clusters, ph2ClusterMask);
154  for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) {
155  LogTrace("HitExtractorSTRP") << "analizing hit on :" << hits[iH]->geographicalId().rawId();
156  assert(hits[iH]->isValid());
157  const VectorHit& vhit = dynamic_cast<VectorHit const&>(*hits[iH]);
158  LogTrace("HitExtractorSTRP") << " key lower: " << vhit.lowerClusterRef().key()
159  << " and key upper: " << vhit.upperClusterRef().key();
160  LogTrace("HitExtractorSTRP") << " key lower: " << hits[iH]->firstClusterRef().key();
161 
162  //FIXME:: introduce a "projected" version later?
163  if (maskCluster &&
164  (ph2ClusterMask->mask(vhit.lowerClusterRef().key()) || ph2ClusterMask->mask(vhit.upperClusterRef().key()))) {
165  LogTrace("HitExtractorSTRP") << "skipping a vector hit on :" << hits[iH]->geographicalId().rawId()
166  << " key lower: " << vhit.lowerClusterRef().key()
167  << " and key upper: " << vhit.upperClusterRef().key();
168  skipped++;
169  hits[iH].reset();
170  }
171  }
172  }
173 
174  // remove empty elements...
175  auto last = std::remove_if(hits.begin() + cleanFrom, hits.end(), [](HitPointer const& p) { return p.empty(); });
176  hits.resize(last - hits.begin());
177 
178  LogTrace("HitExtractorSTRP") << "skipped :" << skipped << " rechits because of clusters and projected: " << projected;
179 }
edm::EDGetTokenT< SkipPhase2ClustersCollection > theSkipPhase2Clusters
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
OmniClusterRef const upperClusterRef() const
Definition: VectorHit.h:94
def replace(string, replacements)
assert(be >=bs)
std::pair< bool, ProjectedSiStripRecHit2D * > skipThis(const TkTransientTrackingRecHitBuilder &ttrhBuilder, TkHitRef matched, edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &stripClusterMask) const
#define LogTrace(id)
mayown_ptr< BaseTrackerRecHit > HitPointer
Definition: HitExtractor.h:27
HitExtractor::Hits hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const override
OmniClusterRef const lowerClusterRef() const
Definition: VectorHit.h:93
bool mask(unsigned int iIndex) const
Definition: ContainerMask.h:43
unsigned int key() const
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters

◆ clone()

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

Implements ctfseeding::HitExtractor.

Definition at line 40 of file HitExtractorSTRP.h.

References HitExtractorSTRP().

40 { return new HitExtractorSTRP(*this); }
HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, TrackerDetSide side, int idLayer, float iminGoodCharge, edm::ConsumesCollector &iC)

◆ getMinMaxRing()

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

Definition at line 81 of file HitExtractorSTRP.h.

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 181 of file HitExtractorSTRP.cc.

References cleanedOfClusters(), edmNew::DetSetVector< T >::equal_range(), makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), hasMatchedHits, hasRPhiHits, hasSimpleRphiHitsCleaner, hasStereoHits, hasVectorHits, LogDebug, LogTrace, minAbsZ, ctfseeding::HitExtractor::minGoodCharge, 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, theTtopo, theVectorHits, GeomDetEnumerators::TIB, TrackerTopology::tibDetIdLayerComparator(), GeomDetEnumerators::TID, TrackerTopology::tidDetIdWheelComparator(), TrackerTopology::tidRing(), GeomDetEnumerators::TOB, TrackerTopology::tobDetIdLayerComparator(), HLT_2022v15_cff::vectorHits, and hit::z.

Referenced by cleanedOfClusters().

183  {
184  LogDebug("HitExtractorSTRP") << "HitExtractorSTRP::hits";
186  unsigned int cleanFrom = 0;
187 
188  //Retrieve tracker topology from geometry
189  const TrackerTopology* const tTopo = &es.getData(theTtopo);
190 
191  //
192  // TIB
193  //
195  LogTrace("HitExtractorSTRP") << "Getting hits into the TIB";
196  if (hasMatchedHits) {
198  ev.getByToken(theMatchedHits, matchedHits);
199  if (skipClusters)
200  cleanFrom = result.size();
202  if (skipClusters)
203  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
204  }
205  if (hasRPhiHits) {
207  ev.getByToken(theRPhiHits, rphiHits);
208  if (hasMatchedHits) {
209  if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future
210  if (skipClusters)
211  cleanFrom = result.size();
213  if (skipClusters)
214  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
215  }
216  } else {
217  if (skipClusters)
218  cleanFrom = result.size();
220  if (skipClusters)
221  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
222  }
223  }
224  if (hasStereoHits) {
226  ev.getByToken(theStereoHits, stereoHits);
227  if (skipClusters)
228  cleanFrom = result.size();
230  if (skipClusters)
231  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
232  }
233  if (hasVectorHits) {
234  LogError("HitExtractorSTRP") << "TIB is not supposed to be in Phase2 TRK detector configuration. What follows "
235  "have never been checked before! ";
236  auto const& vectorHits = ev.get(theVectorHits);
237  if (skipClusters)
238  cleanFrom = result.size();
240  if (skipClusters)
241  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
242  }
243 
244  }
245 
246  //
247  // TID
248  //
250  LogTrace("HitExtractorSTRP") << "Getting hits into the TID";
251  if (hasMatchedHits) {
253  ev.getByToken(theMatchedHits, matchedHits);
254  if (skipClusters)
255  cleanFrom = result.size();
256  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
257  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
258  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
259  int ring = tTopo->tidRing(it->detId());
260  if (!ringRange(ring))
261  continue;
262  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
263  ++hit) {
264  result.emplace_back(*hit);
265  }
266  }
267  if (skipClusters)
268  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
269  }
270  if (hasRPhiHits) {
272  ev.getByToken(theRPhiHits, rphiHits);
273  if (skipClusters)
274  cleanFrom = result.size();
275  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
276  SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second);
277  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
278  int ring = tTopo->tidRing(it->detId());
279  if (!ringRange(ring))
280  continue;
281  if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner)
282  continue; // this is a brutal "cleaning". Add something smarter in the future
283  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
284  result.emplace_back(*hit);
285  }
286  }
287  if (skipClusters)
288  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
289  }
290  if (hasStereoHits) {
292  ev.getByToken(theStereoHits, stereoHits);
293  if (skipClusters)
294  cleanFrom = result.size();
295  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
296  SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second);
297  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
298  int ring = tTopo->tidRing(it->detId());
299  if (!ringRange(ring))
300  continue;
301  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
302  result.emplace_back(*hit);
303  }
304  }
305  if (skipClusters)
306  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
307  }
308  if (hasVectorHits) {
309  LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer;
310  auto const& vectorHits = ev.get(theVectorHits);
311  //FIXME: check the skipClusters with VHits
312  if (skipClusters)
313  cleanFrom = result.size();
314  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
315  VectorHitCollection::Range range = vectorHits.equal_range(getter.first, getter.second);
316  for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) {
317  int ring = tTopo->tidRing(it->detId());
318  if (!ringRange(ring))
319  continue;
320  for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
321  result.emplace_back(*hit);
322  }
323  }
324  LogTrace("HitExtractorSTRP") << "result size value:" << result.size();
325  if (skipClusters)
326  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
327  }
328  }
329  //
330  // TOB
331  //
333  LogTrace("HitExtractorSTRP") << "Getting hits into the TOB";
334  if (hasMatchedHits) {
336  ev.getByToken(theMatchedHits, matchedHits);
337  if (skipClusters)
338  cleanFrom = result.size();
339  if (minAbsZ > 0.) {
340  auto getter = tTopo->tobDetIdLayerComparator(theIdLayer);
341  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
342  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
343  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
344  ++hit) {
345  if (fabs(hit->globalPosition().z()) >= minAbsZ)
346  result.emplace_back(*hit);
347  }
348  }
349  } else {
351  }
352  if (skipClusters)
353  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
354  }
355  if (hasRPhiHits) {
357  ev.getByToken(theRPhiHits, rphiHits);
358  if (hasMatchedHits) {
359  if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future
360  if (skipClusters)
361  cleanFrom = result.size();
363  if (skipClusters)
364  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
365  }
366  } else {
367  if (skipClusters)
368  cleanFrom = result.size();
370  if (skipClusters)
371  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
372  }
373  }
374  if (hasStereoHits) {
376  ev.getByToken(theStereoHits, stereoHits);
377  if (skipClusters)
378  cleanFrom = result.size();
380  if (skipClusters)
381  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
382  }
383  if (hasVectorHits) {
384  LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer;
386  ev.getByToken(theVectorHits, vectorHits);
387  //FIXME: check the skipClusters with VHits
388  if (skipClusters)
389  cleanFrom = result.size();
391  if (skipClusters)
392  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
393  }
394 
395  }
396 
397  //
398  // TEC
399  //
401  LogTrace("HitExtractorSTRP") << "Getting hits into the TEC";
402  if (hasMatchedHits) {
404  ev.getByToken(theMatchedHits, matchedHits);
405  if (skipClusters)
406  cleanFrom = result.size();
407  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
408  SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second);
409  for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
410  int ring = tTopo->tecRing(it->detId());
411  if (!ringRange(ring))
412  continue;
413  for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end;
414  ++hit) {
415  result.emplace_back(*hit);
416  }
417  }
418  if (skipClusters)
419  cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom);
420  }
421  if (hasRPhiHits) {
423  ev.getByToken(theRPhiHits, rphiHits);
424  if (skipClusters)
425  cleanFrom = result.size();
426  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
427  SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second);
428  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
429  int ring = tTopo->tecRing(it->detId());
430  if (!ringRange(ring))
431  continue;
432  if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner)
433  continue; // this is a brutal "cleaning". Add something smarter in the future
434  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
435  result.emplace_back(*hit);
436  }
437  }
438  if (skipClusters)
439  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
440  }
441  if (hasStereoHits) {
443  ev.getByToken(theStereoHits, stereoHits);
444  if (skipClusters)
445  cleanFrom = result.size();
446  auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
447  SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second);
448  for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) {
449  int ring = tTopo->tecRing(it->detId());
450  if (!ringRange(ring))
451  continue;
452  for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
453  result.emplace_back(*hit);
454  }
455  }
456  if (skipClusters)
457  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
458  }
459  if (hasVectorHits) {
460  LogError("HitExtractorSTRP") << "TEC is not supposed to be in Phase2 TRK detector configuration. What follows "
461  "have never been checked before! ";
463  ev.getByToken(theVectorHits, vectorHits);
464  if (skipClusters)
465  cleanFrom = result.size();
466  auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer);
467  VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second);
468  for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) {
469  int ring = tTopo->tidRing(it->detId());
470  if (!ringRange(ring))
471  continue;
472  for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) {
473  result.emplace_back(*hit);
474  }
475  }
476  if (skipClusters)
477  cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom);
478  }
479  }
480 
481  LogDebug("HitExtractorSTRP") << " giving: " << result.size() << " out for charge cut " << minGoodCharge;
482  return result;
483 }
std::pair< DetId, SameLayerComparator > tecDetIdWheelComparator(uint32_t side, uint32_t wheel) const
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:54
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::vector< HitPointer > Hits
Definition: HitExtractor.h:28
std::pair< const_iterator, const_iterator > Range
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopo
Log< level::Error, false > LogError
unsigned int tecRing(const DetId &id) const
ring id
#define LogTrace(id)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > theMatchedHits
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
const GeomDetEnumerators::SubDetector theLayerSubDet
edm::EDGetTokenT< SiStripRecHit2DCollection > theStereoHits
edm::EDGetTokenT< VectorHitCollection > theVectorHits
bool ringRange(int ring) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< SiStripRecHit2DCollection > theRPhiHits
std::pair< DetId, SameLayerComparator > tidDetIdWheelComparator(uint32_t side, uint32_t wheel) const
void cleanedOfClusters(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &ev, HitExtractor::Hits &hits, bool matched, unsigned int cleanFrom=0) const
unsigned int tidRing(const DetId &id) const
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
Range equal_range(id_type i, CMP cmp, bool update=false) const
#define LogDebug(id)

◆ ringRange()

bool HitExtractorSTRP::ringRange ( int  ring) const
private

◆ setMinAbsZ()

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

Definition at line 78 of file HitExtractorSTRP.h.

References minAbsZ.

78 { minAbsZ = minZToSet; }

◆ setNoProjection()

void ctfseeding::HitExtractorSTRP::setNoProjection ( )
inline

Definition at line 77 of file HitExtractorSTRP.h.

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 75 of file HitExtractorSTRP.cc.

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

Referenced by cleanedOfClusters().

78  {
80 
81  assert(dynamic_cast<SiStripMatchedRecHit2D const*>(&matched));
82 
83  auto id = hit.geographicalId();
84  ProjectedSiStripRecHit2D* replaceMe = nullptr;
85  bool rejectSt = skipThis(id, hit.stereoClusterRef(), stripClusterMask);
86  bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask);
87 
88  if ((!rejectSt) & (!rejectMono)) {
89  // keepit
90  return std::make_pair(false, replaceMe);
91  }
92 
93  if (failProjection || (rejectSt & rejectMono)) {
94  //only skip if both hits are done
95  return std::make_pair(true, replaceMe);
96  }
97 
98  // replace with one
99 
100  auto cloner = ttrhBuilder.cloner();
101  replaceMe = cloner.project(hit, rejectSt, TrajectoryStateOnSurface()).release();
102  if (rejectSt)
103  LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the mono hit got projected onto: "
104  << replaceMe->geographicalId().rawId() << " key: " << hit.monoClusterRef().key();
105  else
106  LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the stereo hit got projected onto: "
107  << replaceMe->geographicalId().rawId() << " key: " << hit.stereoClusterRef().key();
108 
109  return std::make_pair(true, replaceMe);
110 }
assert(be >=bs)
std::pair< bool, ProjectedSiStripRecHit2D * > skipThis(const TkTransientTrackingRecHitBuilder &ttrhBuilder, TkHitRef matched, edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > &stripClusterMask) const
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define LogDebug(id)

◆ skipThis() [2/2]

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

Definition at line 63 of file HitExtractorSTRP.cc.

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

66  {
67  if (maskCluster && (stripClusterMask->mask(clus.key())))
68  return true;
69 
70  if UNLIKELY (minGoodCharge <= 0)
71  return false;
72  return siStripClusterTools::chargePerCM(id, *clus.cluster_strip()) <= minGoodCharge;
73 }
return((rh ^ lh) &mask)
float chargePerCM(DetId detid, Iter a, Iter b)
#define UNLIKELY(x)
Definition: Likely.h:21

◆ useMatchedHits()

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

◆ useRingSelector() [1/2]

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

◆ useRingSelector() [2/2]

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

Definition at line 80 of file HitExtractorSTRP.h.

References hasRingSelector.

◆ useRPhiHits()

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

◆ useSimpleRphiHitsCleaner()

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

Definition at line 60 of file HitExtractorSTRP.h.

References hasSimpleRphiHitsCleaner.

◆ useSkipClusters_()

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

Implements ctfseeding::HitExtractor.

Definition at line 46 of file HitExtractorSTRP.cc.

References edm::ConsumesCollector::consumes(), visualization-live-secondInstance_cfg::m, theSkipClusters, and theSkipPhase2Clusters.

46  {
49 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< SkipPhase2ClustersCollection > theSkipPhase2Clusters
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > SkipClustersCollection
edm::ContainerMask< Phase2TrackerCluster1DCollectionNew > SkipPhase2ClustersCollection
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters

◆ 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 109 of file HitExtractorSTRP.h.

Referenced by setNoProjection(), and skipThis().

◆ hasMatchedHits

bool ctfseeding::HitExtractorSTRP::hasMatchedHits
private

Definition at line 103 of file HitExtractorSTRP.h.

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

◆ hasRingSelector

bool ctfseeding::HitExtractorSTRP::hasRingSelector
private

Definition at line 107 of file HitExtractorSTRP.h.

Referenced by ringRange(), and useRingSelector().

◆ hasRPhiHits

bool ctfseeding::HitExtractorSTRP::hasRPhiHits
private

Definition at line 104 of file HitExtractorSTRP.h.

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

◆ hasSimpleRphiHitsCleaner

bool ctfseeding::HitExtractorSTRP::hasSimpleRphiHitsCleaner
private

Definition at line 108 of file HitExtractorSTRP.h.

Referenced by hits(), and useSimpleRphiHitsCleaner().

◆ hasStereoHits

bool ctfseeding::HitExtractorSTRP::hasStereoHits
private

Definition at line 105 of file HitExtractorSTRP.h.

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

◆ hasVectorHits

bool ctfseeding::HitExtractorSTRP::hasVectorHits
private

Definition at line 106 of file HitExtractorSTRP.h.

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

◆ minAbsZ

double ctfseeding::HitExtractorSTRP::minAbsZ
private

Definition at line 94 of file HitExtractorSTRP.h.

Referenced by hits(), and setMinAbsZ().

◆ theIdLayer

int ctfseeding::HitExtractorSTRP::theIdLayer
private

Definition at line 93 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theLayerSubDet

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

Definition at line 91 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theMatchedHits

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

Definition at line 98 of file HitExtractorSTRP.h.

Referenced by hits(), and useMatchedHits().

◆ theMaxRing

int ctfseeding::HitExtractorSTRP::theMaxRing
private

Definition at line 95 of file HitExtractorSTRP.h.

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

◆ theMinRing

int ctfseeding::HitExtractorSTRP::theMinRing
private

Definition at line 95 of file HitExtractorSTRP.h.

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

◆ theRPhiHits

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

Definition at line 99 of file HitExtractorSTRP.h.

Referenced by hits(), and useRPhiHits().

◆ theSide

TrackerDetSide ctfseeding::HitExtractorSTRP::theSide
private

Definition at line 92 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theSkipClusters

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

Definition at line 96 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), and useSkipClusters_().

◆ theSkipPhase2Clusters

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

Definition at line 97 of file HitExtractorSTRP.h.

Referenced by cleanedOfClusters(), and useSkipClusters_().

◆ theStereoHits

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

Definition at line 100 of file HitExtractorSTRP.h.

Referenced by hits(), and useStereoHits().

◆ theTtopo

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> ctfseeding::HitExtractorSTRP::theTtopo
private

Definition at line 102 of file HitExtractorSTRP.h.

Referenced by hits().

◆ theVectorHits

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

Definition at line 101 of file HitExtractorSTRP.h.

Referenced by hits(), and useVectorHits().