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)
 

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 10 of file PixelTrackProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file PixelTrackProducer.cc.

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

Definition at line 27 of file PixelTrackProducer.cc.

27 { }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 34 of file PixelTrackProducer.cc.

References PixelTrackReconstruction::init(), and theReconstruction.

35 {
37 }
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 29 of file PixelTrackProducer.cc.

References PixelTrackReconstruction::halt(), and theReconstruction.

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

Implements edm::stream::EDProducerBase.

Definition at line 39 of file PixelTrackProducer.cc.

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

40 {
41  LogDebug("PixelTrackProducer, produce")<<"event# :"<<ev.id();
42 
44  theReconstruction.run(tracks,ev,es);
45 
46  // store tracks
47  store(ev, tracks);
48 }
#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
PixelTrackReconstruction theReconstruction
edm::EventID id() const
Definition: EventBase.h:60
void store(edm::Event &ev, const pixeltrackfitting::TracksWithTTRHs &selectedTracks)
void PixelTrackProducer::store ( edm::Event ev,
const pixeltrackfitting::TracksWithTTRHs selectedTracks 
)
private

Definition at line 50 of file PixelTrackProducer.cc.

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

Referenced by produce().

51 {
52  std::auto_ptr<reco::TrackCollection> tracks(new reco::TrackCollection());
53  std::auto_ptr<TrackingRecHitCollection> recHits(new TrackingRecHitCollection());
54  std::auto_ptr<reco::TrackExtraCollection> trackExtras(new reco::TrackExtraCollection());
55 
56  int cc = 0, nTracks = tracksWithHits.size();
57 
58  for (int i = 0; i < nTracks; i++)
59  {
60  reco::Track* track = tracksWithHits.at(i).first;
61  const SeedingHitSet& hits = tracksWithHits.at(i).second;
62 
63  for (unsigned int k = 0; k < hits.size(); k++)
64  {
65  TrackingRecHit *hit = hits[k]->hit()->clone();
66 
67  track->appendHitPattern(*hit);
68  recHits->push_back(hit);
69  }
70  tracks->push_back(*track);
71  delete track;
72 
73  }
74 
75  LogDebug("TrackProducer") << "put the collection of TrackingRecHit in the event" << "\n";
77 
79  for (int k = 0; k < nTracks; k++)
80  {
81  reco::TrackExtra theTrackExtra{};
82 
83  //fill the TrackExtra with TrackingRecHitRef
84  unsigned int nHits = tracks->at(k).numberOfValidHits();
85  theTrackExtra.setHits(hitCollProd, cc, nHits);
86  cc +=nHits;
87  trackExtras->push_back(theTrackExtra);
88  }
89 
90  LogDebug("TrackProducer") << "put the collection of TrackExtra in the event" << "\n";
92 
93  for (int k = 0; k < nTracks; k++)
94  {
95  const reco::TrackExtraRef theTrackExtraRef(ohTE,k);
96  (tracks->at(k)).setExtra(theTrackExtraRef);
97  }
98 
99  ev.put(tracks);
100 
101 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
bool appendHitPattern(const TrackingRecHit &hit)
append a single hit to the HitPattern
Definition: TrackBase.h:421
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
unsigned int size() const
Definition: SeedingHitSet.h:44

Member Data Documentation

PixelTrackReconstruction PixelTrackProducer::theReconstruction
private

Definition at line 23 of file PixelTrackProducer.h.

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