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
GsfTrackProducer Class Reference

#include <GsfTrackProducer.h>

Inheritance diagram for GsfTrackProducer:
GsfTrackProducerBase edm::EDProducer TrackProducerBase< reco::GsfTrack > edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 GsfTrackProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
- Public Member Functions inherited from GsfTrackProducerBase
 GsfTrackProducerBase (bool trajectoryInEvent, bool split)
 Constructor. More...
 
virtual void putInEvt (edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, const reco::BeamSpot &)
 Put produced collections in the event. More...
 
- Public Member Functions inherited from TrackProducerBase< reco::GsfTrack >
const edm::ParameterSetgetConf () const
 
virtual void getFromES (const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
 Get needed services from the Event Setup. More...
 
virtual void getFromEvt (edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
 Get TrackCandidateCollection from the Event (needed by TrackProducer) More...
 
virtual void getFromEvt (edm::Event &, edm::Handle< TrackCollection > &, reco::BeamSpot &)
 Get TrackCollection from the Event (needed by TrackRefitter) More...
 
void setAlias (std::string alias)
 set the aliases of produced collections More...
 
void setClusterRemovalInfo (const edm::InputTag &clusterRemovalInfo)
 Sets the information on cluster removal, and turns it on. More...
 
void setConf (edm::ParameterSet conf)
 Set parameter set. More...
 
void setSecondHitPattern (Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTracker *measTk)
 
void setSrc (edm::InputTag src, edm::InputTag bsSrc)
 set label of source collection More...
 
 TrackProducerBase (bool trajectoryInEvent=false)
 Constructor. More...
 
virtual ~TrackProducerBase ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

TrackProducerAlgorithm
< reco::GsfTrack
theAlgo
 

Additional Inherited Members

- Public Types inherited from TrackProducerBase< reco::GsfTrack >
typedef std::pair< Trajectory
*, std::pair< reco::GsfTrack
*, PropagationDirection > > 
AlgoProduct
 
typedef std::vector< AlgoProductAlgoProductCollection
 
typedef std::vector
< reco::GsfTrack
TrackCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from GsfTrackProducerBase
void fillMode (reco::GsfTrack &track, const TrajectoryStateOnSurface innertsos, const Propagator &gsfProp, const TransverseImpactPointExtrapolator &tipExtrapolator, TrajectoryStateClosestToBeamLineBuilder &tscblBuilder, const reco::BeamSpot &bs) const
 
void fillStates (TrajectoryStateOnSurface tsos, std::vector< reco::GsfComponent5D > &states) const
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from TrackProducerBase< reco::GsfTrack >
std::string alias_
 
edm::InputTag bsSrc_
 
edm::InputTag clusterRemovalInfo_
 
bool rekeyClusterRefs_
 
edm::OrphanHandle
< TrackCollection
rTracks_
 
edm::ESHandle< NavigationSchooltheSchool
 
bool trajectoryInEvent_
 

Detailed Description

Definition at line 12 of file GsfTrackProducer.h.

Constructor & Destructor Documentation

GsfTrackProducer::GsfTrackProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file GsfTrackProducer.cc.

References TrackProducerBase< reco::GsfTrack >::alias_, edm::ParameterSet::getParameter(), TrackProducerBase< reco::GsfTrack >::setAlias(), TrackProducerBase< reco::GsfTrack >::setConf(), and TrackProducerBase< reco::GsfTrack >::setSrc().

18  :
19  GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),
20  iConfig.getParameter<bool>("useHitsSplitting")),
21  theAlgo(iConfig)
22 {
23  setConf(iConfig);
24  setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" ));
25  setAlias( iConfig.getParameter<std::string>( "@module_label" ) );
26 // string a = alias_;
27 // a.erase(a.size()-6,a.size());
28  //register your products
29  produces<reco::GsfTrackCollection>().setBranchAlias( alias_ + "GsfTracks" );
30  produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
31  produces<reco::GsfTrackExtraCollection>().setBranchAlias( alias_ + "GsfTrackExtras" );
32  produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
33  produces<std::vector<Trajectory> >() ;
34  produces<TrajGsfTrackAssociationCollection>();
35 
36 }
T getParameter(std::string const &) const
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
void setAlias(std::string alias)
set the aliases of produced collections
GsfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.
void setConf(edm::ParameterSet conf)
Set parameter set.
void setSrc(edm::InputTag src, edm::InputTag bsSrc)
set label of source collection

Member Function Documentation

void GsfTrackProducer::produce ( edm::Event theEvent,
const edm::EventSetup setup 
)
virtual

Implements edm::EDProducer.

Definition at line 39 of file GsfTrackProducer.cc.

References TrackProducerBase< reco::GsfTrack >::getFromES(), TrackProducerBase< reco::GsfTrack >::getFromEvt(), edm::EventBase::id(), LogDebug, edm::ESHandle< class >::product(), GsfTrackProducerBase::putInEvt(), TrackProducerAlgorithm< T >::runWithCandidate(), and theAlgo.

40 {
41  edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
42  //
43  // create empty output collections
44  //
45  std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
46  std::auto_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
47  std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
48  std::auto_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
49  std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
50 
51  //
52  //declare and get stuff to be retrieved from ES
53  //
57  edm::ESHandle<Propagator> thePropagator;
60  getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
61 
62  //
63  //declare and get TrackColection to be retrieved from the event
64  //
65  AlgoProductCollection algoResults;
66  reco::BeamSpot bs;
67  try{
69  getFromEvt(theEvent,theTCCollection,bs);
70 
71  //
72  //run the algorithm
73  //
74  LogDebug("GsfTrackProducer") << "run the algorithm" << "\n";
75  theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTCCollection,
76  theFitter.product(), thePropagator.product(), theBuilder.product(), bs, algoResults);
77  } catch (cms::Exception &e){ edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!" << "\n" << e << "\n"; throw; }
78  //
79  //put everything in the event
80  putInEvt(theEvent, thePropagator.product(), theMeasTk.product(), outputRHColl, outputTColl, outputTEColl, outputGsfTEColl,
81  outputTrajectoryColl, algoResults, bs);
82  LogDebug("GsfTrackProducer") << "end" << "\n";
83 }
#define LogDebug(id)
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, const reco::BeamSpot &)
Put produced collections in the event.
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
std::vector< AlgoProduct > AlgoProductCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
void runWithCandidate(const TrackingGeometry *, const MagneticField *, const TrackCandidateCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking TrackCandidates as input.
virtual void getFromES(const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
Get needed services from the Event Setup.

Member Data Documentation

TrackProducerAlgorithm<reco::GsfTrack> GsfTrackProducer::theAlgo
private

Definition at line 21 of file GsfTrackProducer.h.

Referenced by produce().