CMS 3D CMS Logo

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

#include <PixelTrackProducer.h>

Inheritance diagram for PixelTrackProducer:
edm::stream::EDProducer<>

Public Member Functions

 PixelTrackProducer (const edm::ParameterSet &conf)
 
void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 ~PixelTrackProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void store (edm::Event &ev, const pixeltrackfitting::TracksWithTTRHs &selectedTracks, const TrackerTopology &ttopo)
 

Private Attributes

PixelTrackReconstruction theReconstruction
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 11 of file PixelTrackProducer.h.

Constructor & Destructor Documentation

PixelTrackProducer::PixelTrackProducer ( const edm::ParameterSet conf)
explicit

Definition at line 25 of file PixelTrackProducer.cc.

26  : theReconstruction(cfg, consumesCollector())
27 {
28  edm::LogInfo("PixelTrackProducer")<<" construction...";
29  produces<reco::TrackCollection>();
30  produces<TrackingRecHitCollection>();
31  produces<reco::TrackExtraCollection>();
32 }
PixelTrackReconstruction theReconstruction
PixelTrackProducer::~PixelTrackProducer ( )
override

Definition at line 34 of file PixelTrackProducer.cc.

34 { }

Member Function Documentation

void PixelTrackProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 36 of file PixelTrackProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), PixelTrackReconstruction::fillDescriptions(), and AlCaHLTBitMon_QueryRunRegistry::string.

36  {
38 
39  desc.add<std::string>("passLabel", "pixelTracks"); // What is this? It is not used anywhere in this code.
41 
42  descriptions.add("pixelTracks", desc);
43 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ParameterSetDescription &desc)
void PixelTrackProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

Definition at line 45 of file PixelTrackProducer.cc.

References edm::EventSetup::get(), edm::EventBase::id(), LogDebug, PixelTrackReconstruction::run(), store(), theReconstruction, and l1t::tracks.

46 {
47  LogDebug("PixelTrackProducer, produce")<<"event# :"<<ev.id();
48 
50  theReconstruction.run(tracks,ev,es);
51 
53  es.get<TrackerTopologyRcd>().get(httopo);
54 
55  // store tracks
56  store(ev, tracks, *httopo);
57 }
#define LogDebug(id)
std::vector< TrackWithTTRHs > TracksWithTTRHs
void run(pixeltrackfitting::TracksWithTTRHs &tah, edm::Event &ev, const edm::EventSetup &es)
PixelTrackReconstruction theReconstruction
edm::EventID id() const
Definition: EventBase.h:59
T get() const
Definition: EventSetup.h:71
void store(edm::Event &ev, const pixeltrackfitting::TracksWithTTRHs &selectedTracks, const TrackerTopology &ttopo)
void PixelTrackProducer::store ( edm::Event ev,
const pixeltrackfitting::TracksWithTTRHs selectedTracks,
const TrackerTopology ttopo 
)
private

Definition at line 59 of file PixelTrackProducer.cc.

References reco::TrackBase::appendHitPattern(), hfClusterShapes_cfi::hits, mps_fire::i, gen::k, LogDebug, eostools::move(), nTracks(), edm::Event::put(), SeedingHitSet::size(), HiIsolationCommonParameters_cff::track, l1t::tracks, and findQualityFiles::v.

Referenced by produce().

60 {
61  auto tracks = std::make_unique<reco::TrackCollection>();
62  auto recHits = std::make_unique<TrackingRecHitCollection>();
63  auto trackExtras = std::make_unique<reco::TrackExtraCollection>();
64 
65  int cc = 0, nTracks = tracksWithHits.size();
66 
67  for (int i = 0; i < nTracks; i++)
68  {
69  reco::Track* track = tracksWithHits.at(i).first;
70  const SeedingHitSet& hits = tracksWithHits.at(i).second;
71 
72  for (unsigned int k = 0; k < hits.size(); k++)
73  {
74  TrackingRecHit *hit = hits[k]->hit()->clone();
75 
76  track->appendHitPattern(*hit, ttopo);
77  recHits->push_back(hit);
78  }
79  tracks->push_back(*track);
80  delete track;
81 
82  }
83 
84  LogDebug("TrackProducer") << "put the collection of TrackingRecHit in the event" << "\n";
86 
88  for (int k = 0; k < nTracks; k++)
89  {
90  reco::TrackExtra theTrackExtra{};
91 
92  //fill the TrackExtra with TrackingRecHitRef
93  unsigned int nHits = tracks->at(k).numberOfValidHits();
94  theTrackExtra.setHits(hitCollProd, cc, nHits);
95  cc +=nHits;
96  AlgebraicVector5 v = AlgebraicVector5(0,0,0,0,0);
98  reco::TrackExtra::Chi2sFive chi2s(nHits,0);
99  theTrackExtra.setTrajParams(std::move(trajParams),std::move(chi2s));
100  trackExtras->push_back(theTrackExtra);
101  }
102 
103  LogDebug("TrackProducer") << "put the collection of TrackExtra in the event" << "\n";
105 
106  for (int k = 0; k < nTracks; k++)
107  {
108  const reco::TrackExtraRef theTrackExtraRef(ohTE,k);
109  (tracks->at(k)).setExtra(theTrackExtraRef);
110  }
111 
112  ev.put(std::move(tracks));
113 
114 }
#define LogDebug(id)
const unsigned int nTracks(const reco::Vertex &sv)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::vector< unsigned char > Chi2sFive
std::vector< LocalTrajectoryParameters > TrajParams
int k[5][pyjets_maxn]
ROOT::Math::SVector< double, 5 > AlgebraicVector5
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
Definition: TrackBase.h:495
unsigned int size() const
Definition: SeedingHitSet.h:46
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

PixelTrackReconstruction PixelTrackProducer::theReconstruction
private

Definition at line 24 of file PixelTrackProducer.h.

Referenced by produce().