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
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, edm::StreamID const &) override
 
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 PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Member Functions

template<class T >
void accumulateEvent (const T &e, edm::EventSetup const &c, edm::Handle< reco::TrackCollection > t, edm::Handle< reco::TrackExtraCollection > tx, edm::Handle< TrackingRecHitCollection > h)
 

Private Attributes

std::string GeneralTrackExtraOutput_
 
std::string GeneralTrackOutput_
 
std::string HitOutput_
 
edm::InputTag InputPileup_
 
edm::InputTag InputSignal_
 
std::auto_ptr
< TrackingRecHitCollection
NewHitList_
 
std::auto_ptr
< reco::TrackExtraCollection
NewTrackExtraList_
 
std::auto_ptr
< reco::TrackCollection
NewTrackList_
 
TrackingRecHitRefProd rHits
 
reco::TrackExtraRefProd rTrackExtras
 

Detailed Description

RecoTrackAccumulator accumulates generalTracks from the hard and the pileup events

Author
Andrea Giammanco
Version
Mar 11 2013

Definition at line 37 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(), GeneralTrackExtraOutput_, GeneralTrackOutput_, HitOutput_, and InputSignal_.

5  :
6  InputSignal_(conf.getParameter<edm::InputTag>("InputSignal")),
7  InputPileup_(conf.getParameter<edm::InputTag>("InputPileup")),
8  GeneralTrackOutput_(conf.getParameter<std::string>("GeneralTrackOutput")),
9  HitOutput_(conf.getParameter<std::string>("HitOutput")),
10  GeneralTrackExtraOutput_(conf.getParameter<std::string>("GeneralTrackExtraOutput"))
11 {
12 
14  mixMod.produces<TrackingRecHitCollection>(HitOutput_);
16 
20 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
std::string GeneralTrackExtraOutput_
RecoTrackAccumulator::~RecoTrackAccumulator ( )
virtual

Definition at line 22 of file RecoTrackAccumulator.cc.

22  {
23 
24 }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 38 of file RecoTrackAccumulator.cc.

References accumulateEvent(), edm::Event::getByLabel(), InputSignal_, and testEve_cfg::tracks.

38  {
39 
40 
44  e.getByLabel(InputSignal_, tracks);
45  e.getByLabel(InputSignal_, hits);
46  e.getByLabel(InputSignal_, trackExtras);
47 
48  // Call the templated version that does the same for both signal and pileup events
49  accumulateEvent( e, iSetup, tracks, trackExtras, hits );
50 
51 }
tuple tracks
Definition: testEve_cfg.py:39
void accumulateEvent(const T &e, edm::EventSetup const &c, edm::Handle< reco::TrackCollection > t, edm::Handle< reco::TrackExtraCollection > tx, edm::Handle< TrackingRecHitCollection > h)
void RecoTrackAccumulator::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &   
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 53 of file RecoTrackAccumulator.cc.

References accumulateEvent(), PileUpEventPrincipal::bunchCrossing(), PileUpEventPrincipal::getByLabel(), InputPileup_, and testEve_cfg::tracks.

53  {
54 
55  if (e.bunchCrossing()==0) {
59  e.getByLabel(InputPileup_, tracks);
60  e.getByLabel(InputPileup_, hits);
61  e.getByLabel(InputPileup_, trackExtras);
62 
63  // Call the templated version that does the same for both signal and pileup events
64  accumulateEvent( e, iSetup, tracks, trackExtras, hits );
65 
66  }
67 }
tuple tracks
Definition: testEve_cfg.py:39
void accumulateEvent(const T &e, edm::EventSetup const &c, edm::Handle< reco::TrackCollection > t, edm::Handle< reco::TrackExtraCollection > tx, edm::Handle< TrackingRecHitCollection > h)
template<class T >
void RecoTrackAccumulator::accumulateEvent ( const T e,
edm::EventSetup const &  c,
edm::Handle< reco::TrackCollection t,
edm::Handle< reco::TrackExtraCollection tx,
edm::Handle< TrackingRecHitCollection h 
)
private

Definition at line 78 of file RecoTrackAccumulator.cc.

References edm::HandleBase::isValid(), NewHitList_, NewTrackExtraList_, NewTrackList_, rHits, and rTrackExtras.

Referenced by accumulate().

78  {
79 
80  if (tracks.isValid()) {
81  for (auto const& track : *tracks) {
82  NewTrackList_->push_back(track);
83  // track extras:
84  auto const& extra = tracksExtras->at(track.extra().key());
85  NewTrackExtraList_->emplace_back(extra.outerPosition(), extra.outerMomentum(), extra.outerOk(),
86  extra.innerPosition(),extra.innerMomentum(), extra.innerOk(),
87  extra.outerStateCovariance(), extra.outerDetId(),
88  extra.innerStateCovariance(), extra.innerDetId(),
89  extra.seedDirection(),
90  //If TrajectorySeeds are needed, then their list must be gotten from the
91  // secondary event directly and looked up similarly to TrackExtras.
92  //We can't use a default constructed RefToBase due to a bug in RefToBase
93  // which causes an seg fault when calling isAvailable on a default constructed one.
95  NewTrackList_->back().setExtra( reco::TrackExtraRef( rTrackExtras, NewTrackExtraList_->size() - 1) );
96  //reco::TrackExtra & tx = NewTrackExtraList_->back();
97  //tx.setResiduals(track.residuals());
98  // rechits:
99  auto & newExtra = NewTrackExtraList_->back();
100  for( trackingRecHit_iterator hit = extra.recHitsBegin(); hit != extra.recHitsEnd(); ++ hit ) {
101  NewHitList_->push_back( (*hits)[hit->key()] );
102  newExtra.add( TrackingRecHitRef( rHits, NewHitList_->size() - 1) );
103  }
104  }
105  }
106 
107 }
std::auto_ptr< TrackingRecHitCollection > NewHitList_
std::auto_ptr< reco::TrackCollection > NewTrackList_
TrackingRecHitRefProd rHits
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
std::auto_ptr< reco::TrackExtraCollection > NewTrackExtraList_
tuple tracks
Definition: testEve_cfg.py:39
reco::TrackExtraRefProd rTrackExtras
void RecoTrackAccumulator::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 69 of file RecoTrackAccumulator.cc.

References GeneralTrackExtraOutput_, GeneralTrackOutput_, HitOutput_, NewHitList_, NewTrackExtraList_, NewTrackList_, and edm::Event::put().

69  {
70 
74 
75 }
std::auto_ptr< TrackingRecHitCollection > NewHitList_
std::auto_ptr< reco::TrackCollection > NewTrackList_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::auto_ptr< reco::TrackExtraCollection > NewTrackExtraList_
std::string GeneralTrackExtraOutput_
void RecoTrackAccumulator::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 26 of file RecoTrackAccumulator.cc.

References alignCSCRings::e, GeneralTrackExtraOutput_, HitOutput_, NewHitList_, NewTrackExtraList_, NewTrackList_, rHits, and rTrackExtras.

26  {
27 
28  NewTrackList_ = std::auto_ptr<reco::TrackCollection>(new reco::TrackCollection());
29  NewHitList_ = std::auto_ptr<TrackingRecHitCollection>(new TrackingRecHitCollection());
30  NewTrackExtraList_ = std::auto_ptr<reco::TrackExtraCollection>(new reco::TrackExtraCollection());
31 
32  // this is needed to get the ProductId of the TrackExtra and TrackingRecHit collections
33  rTrackExtras=const_cast<edm::Event&>( e ).getRefBeforePut<reco::TrackExtraCollection>(GeneralTrackExtraOutput_);
34  rHits=const_cast<edm::Event&>( e ).getRefBeforePut<TrackingRecHitCollection>(HitOutput_);
35 
36 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::auto_ptr< TrackingRecHitCollection > NewHitList_
std::auto_ptr< reco::TrackCollection > NewTrackList_
TrackingRecHitRefProd rHits
std::auto_ptr< reco::TrackExtraCollection > NewTrackExtraList_
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
reco::TrackExtraRefProd rTrackExtras
std::string GeneralTrackExtraOutput_

Member Data Documentation

std::string RecoTrackAccumulator::GeneralTrackExtraOutput_
private

Definition at line 63 of file RecoTrackAccumulator.h.

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

std::string RecoTrackAccumulator::GeneralTrackOutput_
private

Definition at line 61 of file RecoTrackAccumulator.h.

Referenced by finalizeEvent(), and RecoTrackAccumulator().

std::string RecoTrackAccumulator::HitOutput_
private

Definition at line 62 of file RecoTrackAccumulator.h.

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

edm::InputTag RecoTrackAccumulator::InputPileup_
private

Definition at line 59 of file RecoTrackAccumulator.h.

Referenced by accumulate().

edm::InputTag RecoTrackAccumulator::InputSignal_
private

Definition at line 58 of file RecoTrackAccumulator.h.

Referenced by accumulate(), and RecoTrackAccumulator().

std::auto_ptr<TrackingRecHitCollection> RecoTrackAccumulator::NewHitList_
private

Definition at line 53 of file RecoTrackAccumulator.h.

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

std::auto_ptr<reco::TrackExtraCollection> RecoTrackAccumulator::NewTrackExtraList_
private

Definition at line 52 of file RecoTrackAccumulator.h.

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

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

Definition at line 51 of file RecoTrackAccumulator.h.

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

TrackingRecHitRefProd RecoTrackAccumulator::rHits
private

Definition at line 56 of file RecoTrackAccumulator.h.

Referenced by accumulateEvent(), and initializeEvent().

reco::TrackExtraRefProd RecoTrackAccumulator::rTrackExtras
private

Definition at line 55 of file RecoTrackAccumulator.h.

Referenced by accumulateEvent(), and initializeEvent().