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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PixelTrackProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 ~PixelTrackProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 11 of file PixelTrackProducer.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file PixelTrackProducer.cc.

26 {
27  edm::LogInfo("PixelTrackProducer")<<" construction...";
28  produces<reco::TrackCollection>();
29  produces<TrackingRecHitCollection>();
30  produces<reco::TrackExtraCollection>();
31 }
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
PixelTrackReconstruction theReconstruction
PixelTrackProducer::~PixelTrackProducer ( )

Definition at line 33 of file PixelTrackProducer.cc.

33 { }

Member Function Documentation

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

Definition at line 35 of file PixelTrackProducer.cc.

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

35  {
37 
38  desc.add<std::string>("passLabel", "pixelTracks"); // What is this? It is not used anywhere in this code.
40 
41  descriptions.add("pixelTracksDefault", desc);
42 }
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 
)
overridevirtual

Definition at line 44 of file PixelTrackProducer.cc.

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

45 {
46  LogDebug("PixelTrackProducer, produce")<<"event# :"<<ev.id();
47 
49  theReconstruction.run(tracks,ev,es);
50 
52  es.get<TrackerTopologyRcd>().get(httopo);
53 
54  // store tracks
55  store(ev, tracks, *httopo);
56 }
#define LogDebug(id)
std::vector< TrackWithTTRHs > TracksWithTTRHs
void run(pixeltrackfitting::TracksWithTTRHs &tah, edm::Event &ev, const edm::EventSetup &es)
const T & get() const
Definition: EventSetup.h:56
PixelTrackReconstruction theReconstruction
edm::EventID id() const
Definition: EventBase.h:58
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 58 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, and l1t::tracks.

Referenced by produce().

59 {
60  auto tracks = std::make_unique<reco::TrackCollection>();
61  auto recHits = std::make_unique<TrackingRecHitCollection>();
62  auto trackExtras = std::make_unique<reco::TrackExtraCollection>();
63 
64  int cc = 0, nTracks = tracksWithHits.size();
65 
66  for (int i = 0; i < nTracks; i++)
67  {
68  reco::Track* track = tracksWithHits.at(i).first;
69  const SeedingHitSet& hits = tracksWithHits.at(i).second;
70 
71  for (unsigned int k = 0; k < hits.size(); k++)
72  {
73  TrackingRecHit *hit = hits[k]->hit()->clone();
74 
75  track->appendHitPattern(*hit, ttopo);
76  recHits->push_back(hit);
77  }
78  tracks->push_back(*track);
79  delete track;
80 
81  }
82 
83  LogDebug("TrackProducer") << "put the collection of TrackingRecHit in the event" << "\n";
85 
87  for (int k = 0; k < nTracks; k++)
88  {
89  reco::TrackExtra theTrackExtra{};
90 
91  //fill the TrackExtra with TrackingRecHitRef
92  unsigned int nHits = tracks->at(k).numberOfValidHits();
93  theTrackExtra.setHits(hitCollProd, cc, nHits);
94  cc +=nHits;
95  trackExtras->push_back(theTrackExtra);
96  }
97 
98  LogDebug("TrackProducer") << "put the collection of TrackExtra in the event" << "\n";
100 
101  for (int k = 0; k < nTracks; k++)
102  {
103  const reco::TrackExtraRef theTrackExtraRef(ohTE,k);
104  (tracks->at(k)).setExtra(theTrackExtraRef);
105  }
106 
107  ev.put(std::move(tracks));
108 
109 }
#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:122
int k[5][pyjets_maxn]
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
Definition: TrackBase.h:455
unsigned int size() const
Definition: SeedingHitSet.h:46
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

PixelTrackReconstruction PixelTrackProducer::theReconstruction
private

Definition at line 24 of file PixelTrackProducer.h.

Referenced by produce().