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 Attributes
RecoTrackAccumulator Class Reference

#include <RecoTrackAccumulator.h>

Inheritance diagram for RecoTrackAccumulator:
DigiAccumulatorMixMod

Public Member Functions

virtual void accumulate (edm::Event const &e, edm::EventSetup const &c)
 
virtual void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c)
 
virtual void finalizeEvent (edm::Event &e, edm::EventSetup const &c)
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c)
 
 RecoTrackAccumulator (const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
virtual ~RecoTrackAccumulator ()
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Attributes

edm::InputTag GeneralTrackInput_
 
std::string GeneralTrackOutput_
 
std::auto_ptr
< reco::TrackCollection
NewTrackList_
 

Detailed Description

RecoTrackAccumulator accumulates generalTracks from the hard and the pileup events

Author
Andrea Giammanco
Version
Mar 11 2013

Definition at line 44 of file RecoTrackAccumulator.h.

Constructor & Destructor Documentation

RecoTrackAccumulator::RecoTrackAccumulator ( const edm::ParameterSet conf,
edm::one::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 5 of file RecoTrackAccumulator.cc.

References edm::ConsumesCollector::consumes(), GeneralTrackInput_, and GeneralTrackOutput_.

5  :
6  GeneralTrackInput_(conf.getParameter<edm::InputTag>("GeneralTrackInput")),
7  GeneralTrackOutput_(conf.getParameter<std::string>("GeneralTrackOutput"))
8 {
9 
12 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::InputTag GeneralTrackInput_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
RecoTrackAccumulator::~RecoTrackAccumulator ( )
virtual

Definition at line 14 of file RecoTrackAccumulator.cc.

14  {
15 
16 }

Member Function Documentation

void RecoTrackAccumulator::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 24 of file RecoTrackAccumulator.cc.

References GeneralTrackInput_, edm::Event::getByLabel(), edm::HandleBase::isValid(), NewTrackList_, and testEve_cfg::tracks.

24  {
25 
26 
28  e.getByLabel(GeneralTrackInput_, tracks);
29 
30  if (tracks.isValid()) {
31  for (auto const& track : *tracks) {
32  NewTrackList_->push_back(track);
33  }
34  }
35 
36 }
edm::InputTag GeneralTrackInput_
std::auto_ptr< reco::TrackCollection > NewTrackList_
bool isValid() const
Definition: HandleBase.h:76
tuple tracks
Definition: testEve_cfg.py:39
void RecoTrackAccumulator::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 38 of file RecoTrackAccumulator.cc.

References PileUpEventPrincipal::bunchCrossing(), GeneralTrackInput_, PileUpEventPrincipal::getByLabel(), edm::HandleBase::isValid(), NewTrackList_, and testEve_cfg::tracks.

38  {
39 
40  if (e.bunchCrossing()==0) {
42  e.getByLabel(GeneralTrackInput_, tracks);
43 
44  if (tracks.isValid()) {
45  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
46  NewTrackList_->push_back(*track);
47  }
48  }
49  }
50 
51 }
edm::InputTag GeneralTrackInput_
std::auto_ptr< reco::TrackCollection > NewTrackList_
bool isValid() const
Definition: HandleBase.h:76
tuple tracks
Definition: testEve_cfg.py:39
void RecoTrackAccumulator::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 53 of file RecoTrackAccumulator.cc.

References GeneralTrackOutput_, NewTrackList_, and edm::Event::put().

53  {
54 
56 
57 }
std::auto_ptr< reco::TrackCollection > NewTrackList_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void RecoTrackAccumulator::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 18 of file RecoTrackAccumulator.cc.

References NewTrackList_.

18  {
19 
20  NewTrackList_ = std::auto_ptr<reco::TrackCollection>(new reco::TrackCollection());
21 
22 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::auto_ptr< reco::TrackCollection > NewTrackList_

Member Data Documentation

edm::InputTag RecoTrackAccumulator::GeneralTrackInput_
private

Definition at line 57 of file RecoTrackAccumulator.h.

Referenced by accumulate(), and RecoTrackAccumulator().

std::string RecoTrackAccumulator::GeneralTrackOutput_
private

Definition at line 58 of file RecoTrackAccumulator.h.

Referenced by finalizeEvent(), and RecoTrackAccumulator().

std::auto_ptr<reco::TrackCollection> RecoTrackAccumulator::NewTrackList_
private

Definition at line 56 of file RecoTrackAccumulator.h.

Referenced by accumulate(), finalizeEvent(), and initializeEvent().