CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PixelTrackReconstruction Class Reference

#include <PixelTrackReconstruction.h>

Public Member Functions

 PixelTrackReconstruction (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
void run (pixeltrackfitting::TracksWithTTRHs &tah, edm::Event &ev, const edm::EventSetup &es)
 
 ~PixelTrackReconstruction ()
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &desc)
 

Private Attributes

edm::ESGetToken< PixelTrackCleaner, PixelTrackCleaner::RecordtheCleanerToken
 
edm::EDGetTokenT< PixelTrackFiltertheFilterToken
 
edm::EDGetTokenT< PixelFittertheFitterToken
 
edm::EDGetTokenT< RegionsSeedingHitSetstheHitSetsToken
 

Detailed Description

Definition at line 18 of file PixelTrackReconstruction.h.

Constructor & Destructor Documentation

◆ PixelTrackReconstruction()

PixelTrackReconstruction::PixelTrackReconstruction ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 21 of file PixelTrackReconstruction.cc.

References looper::cfg, edm::InputTag::label(), AlCaHLTBitMon_QueryRunRegistry::string, theCleanerToken, and theFilterToken.

22  : theHitSetsToken(iC.consumes<RegionsSeedingHitSets>(cfg.getParameter<edm::InputTag>("SeedingHitSets"))),
23  theFitterToken(iC.consumes<PixelFitter>(cfg.getParameter<edm::InputTag>("Fitter"))) {
24  edm::InputTag filterTag = cfg.getParameter<edm::InputTag>("Filter");
25  if (not filterTag.label().empty()) {
26  theFilterToken = iC.consumes<PixelTrackFilter>(filterTag);
27  }
28  std::string cleanerName = cfg.getParameter<std::string>("Cleaner");
29  if (not cleanerName.empty()) {
30  theCleanerToken = iC.esConsumes(edm::ESInputTag("", cleanerName));
31  }
32 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
std::string const & label() const
Definition: InputTag.h:36
edm::ESGetToken< PixelTrackCleaner, PixelTrackCleaner::Record > theCleanerToken
edm::EDGetTokenT< RegionsSeedingHitSets > theHitSetsToken
edm::EDGetTokenT< PixelFitter > theFitterToken

◆ ~PixelTrackReconstruction()

PixelTrackReconstruction::~PixelTrackReconstruction ( )

Definition at line 34 of file PixelTrackReconstruction.cc.

34 {}

Member Function Documentation

◆ fillDescriptions()

void PixelTrackReconstruction::fillDescriptions ( edm::ParameterSetDescription desc)
static

Definition at line 36 of file PixelTrackReconstruction.cc.

References submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PixelTrackProducer::fillDescriptions().

36  {
37  desc.add<edm::InputTag>("SeedingHitSets", edm::InputTag("pixelTracksHitTriplets"));
38  desc.add<edm::InputTag>("Fitter", edm::InputTag("pixelFitterByHelixProjections"));
39  desc.add<edm::InputTag>("Filter", edm::InputTag("pixelTrackFilterByKinematics"));
40  desc.add<std::string>("Cleaner", "pixelTrackCleanerBySharedHits");
41 }

◆ run()

void PixelTrackReconstruction::run ( pixeltrackfitting::TracksWithTTRHs tah,
edm::Event ev,
const edm::EventSetup es 
)

FIXME at some point we need to migrate the fitter...

Definition at line 43 of file PixelTrackReconstruction.cc.

References PixelTrackCleanerWrapper::clean(), makeMEIFBenchmarkPlots::ev, ALCARECOTkAlBeamHalo_cff::filter, edm::EventSetup::getData(), hfClusterShapes_cfi::hits, edm::EDGetTokenT< T >::isUninitialized(), nHits, edm::Handle< T >::product(), nano_mu_digi_cff::region, theCleanerToken, theFilterToken, theFitterToken, theHitSetsToken, HLT_2024v14_cff::track, and DiMuonV_cfg::tracks.

43  {
45  ev.getByToken(theHitSetsToken, hhitSets);
46  const auto& hitSets = *hhitSets;
47 
49  ev.getByToken(theFitterToken, hfitter);
50  const auto& fitter = *hfitter;
51 
52  const PixelTrackFilter* filter = nullptr;
55  ev.getByToken(theFilterToken, hfilter);
56  filter = hfilter.product();
57  }
58 
59  std::vector<const TrackingRecHit*> hits;
60  hits.reserve(4);
61  for (const auto& regionHitSets : hitSets) {
62  const TrackingRegion& region = regionHitSets.region();
63 
64  for (const SeedingHitSet& tuplet : regionHitSets) {
66  auto nHits = tuplet.size();
67  hits.resize(nHits);
68  for (unsigned int iHit = 0; iHit < nHits; ++iHit)
69  hits[iHit] = tuplet[iHit];
70 
71  // fitting
72  std::unique_ptr<reco::Track> track = fitter.run(hits, region);
73  if (!track)
74  continue;
75 
76  if (filter) {
77  if (!(*filter)(track.get(), hits)) {
78  continue;
79  }
80  }
81  /* roll back to verify if HLT tau is affected
82  // all legacy tracks are "highPurity"
83  // setting all others bits as well (as in ckf)
84  track->setQuality(reco::TrackBase::loose);
85  track->setQuality(reco::TrackBase::tight);
86  track->setQuality(reco::TrackBase::highPurity);
87  */
88  // add tracks
89  tracks.emplace_back(track.release(), tuplet);
90  }
91  }
92 
93  // skip ovelrapped tracks
94  if (theCleanerToken.isInitialized()) {
95  const auto& cleaner = es.getData(theCleanerToken);
96  if (cleaner.fast())
97  cleaner.cleanTracks(tracks);
98  else
100  }
101 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
T const * product() const
Definition: Handle.h:70
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
pixeltrackfitting::TracksWithTTRHs clean(const pixeltrackfitting::TracksWithTTRHs &initialT_TTRHs) const
edm::ESGetToken< PixelTrackCleaner, PixelTrackCleaner::Record > theCleanerToken
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
edm::EDGetTokenT< RegionsSeedingHitSets > theHitSetsToken
edm::EDGetTokenT< PixelFitter > theFitterToken

Member Data Documentation

◆ theCleanerToken

edm::ESGetToken<PixelTrackCleaner, PixelTrackCleaner::Record> PixelTrackReconstruction::theCleanerToken
private

Definition at line 31 of file PixelTrackReconstruction.h.

Referenced by PixelTrackReconstruction(), and run().

◆ theFilterToken

edm::EDGetTokenT<PixelTrackFilter> PixelTrackReconstruction::theFilterToken
private

Definition at line 30 of file PixelTrackReconstruction.h.

Referenced by PixelTrackReconstruction(), and run().

◆ theFitterToken

edm::EDGetTokenT<PixelFitter> PixelTrackReconstruction::theFitterToken
private

Definition at line 29 of file PixelTrackReconstruction.h.

Referenced by run().

◆ theHitSetsToken

edm::EDGetTokenT<RegionsSeedingHitSets> PixelTrackReconstruction::theHitSetsToken
private

Definition at line 28 of file PixelTrackReconstruction.h.

Referenced by run().