CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

virtual void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &es) override
 
 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 22 of file PixelTrackProducer.cc.

24 {
25  edm::LogInfo("PixelTrackProducer")<<" construction...";
26  produces<reco::TrackCollection>();
27  produces<TrackingRecHitCollection>();
28  produces<reco::TrackExtraCollection>();
29 }
tuple cfg
Definition: looper.py:293
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
PixelTrackReconstruction theReconstruction
PixelTrackProducer::~PixelTrackProducer ( )

Definition at line 31 of file PixelTrackProducer.cc.

31 { }

Member Function Documentation

void PixelTrackProducer::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 38 of file PixelTrackProducer.cc.

References PixelTrackReconstruction::init(), and theReconstruction.

39 {
41 }
void init(const edm::EventSetup &es)
PixelTrackReconstruction theReconstruction
void PixelTrackProducer::endRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 33 of file PixelTrackProducer.cc.

References PixelTrackReconstruction::halt(), and theReconstruction.

34 {
36 }
PixelTrackReconstruction theReconstruction
void PixelTrackProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 43 of file PixelTrackProducer.cc.

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

44 {
45  LogDebug("PixelTrackProducer, produce")<<"event# :"<<ev.id();
46 
48  theReconstruction.run(tracks,ev,es);
49 
51  es.get<TrackerTopologyRcd>().get(httopo);
52 
53  // store tracks
54  store(ev, tracks, *httopo);
55 }
#define LogDebug(id)
std::vector< TrackWithTTRHs > TracksWithTTRHs
void run(pixeltrackfitting::TracksWithTTRHs &tah, edm::Event &ev, const edm::EventSetup &es)
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:56
PixelTrackReconstruction theReconstruction
edm::EventID id() const
Definition: EventBase.h:60
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 57 of file PixelTrackProducer.cc.

References reco::TrackBase::appendHitPattern(), i, relval_steps::k, LogDebug, edm::Event::put(), HLT_25ns14e33_v3_cff::recHits, reco::TrackExtraBase::setHits(), SeedingHitSet::size(), and testEve_cfg::tracks.

Referenced by produce().

58 {
59  std::auto_ptr<reco::TrackCollection> tracks(new reco::TrackCollection());
60  std::auto_ptr<TrackingRecHitCollection> recHits(new TrackingRecHitCollection());
61  std::auto_ptr<reco::TrackExtraCollection> trackExtras(new reco::TrackExtraCollection());
62 
63  int cc = 0, nTracks = tracksWithHits.size();
64 
65  for (int i = 0; i < nTracks; i++)
66  {
67  reco::Track* track = tracksWithHits.at(i).first;
68  const SeedingHitSet& hits = tracksWithHits.at(i).second;
69 
70  for (unsigned int k = 0; k < hits.size(); k++)
71  {
72  TrackingRecHit *hit = hits[k]->hit()->clone();
73 
74  track->appendHitPattern(*hit, ttopo);
75  recHits->push_back(hit);
76  }
77  tracks->push_back(*track);
78  delete track;
79 
80  }
81 
82  LogDebug("TrackProducer") << "put the collection of TrackingRecHit in the event" << "\n";
84 
86  for (int k = 0; k < nTracks; k++)
87  {
88  reco::TrackExtra theTrackExtra{};
89 
90  //fill the TrackExtra with TrackingRecHitRef
91  unsigned int nHits = tracks->at(k).numberOfValidHits();
92  theTrackExtra.setHits(hitCollProd, cc, nHits);
93  cc +=nHits;
94  trackExtras->push_back(theTrackExtra);
95  }
96 
97  LogDebug("TrackProducer") << "put the collection of TrackExtra in the event" << "\n";
99 
100  for (int k = 0; k < nTracks; k++)
101  {
102  const reco::TrackExtraRef theTrackExtraRef(ohTE,k);
103  (tracks->at(k)).setExtra(theTrackExtraRef);
104  }
105 
106  ev.put(tracks);
107 
108 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:11
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
tuple tracks
Definition: testEve_cfg.py:39
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
Definition: TrackBase.h:447
unsigned int size() const
Definition: SeedingHitSet.h:44

Member Data Documentation

PixelTrackReconstruction PixelTrackProducer::theReconstruction
private

Definition at line 24 of file PixelTrackProducer.h.

Referenced by beginRun(), endRun(), and produce().