CMS 3D CMS Logo

GsfTrackProducer Class Reference

#include <RecoTracker/TrackProducer/plugins/GsfTrackProducer.h>

Inheritance diagram for GsfTrackProducer:

GsfTrackProducerBase edm::EDProducer TrackProducerBase< reco::GsfTrack > edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 GsfTrackProducer (const edm::ParameterSet &iConfig)
virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

TrackProducerAlgorithm
< reco::GsfTrack
theAlgo


Detailed Description

Definition at line 12 of file GsfTrackProducer.h.


Constructor & Destructor Documentation

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

Definition at line 16 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().

00016                                                                 :
00017   GsfTrackProducerBase(iConfig.getParameter<bool>("TrajectoryInEvent"),
00018                        iConfig.getParameter<bool>("useHitsSplitting")),
00019   theAlgo(iConfig)
00020 {
00021   setConf(iConfig);
00022   setSrc( iConfig.getParameter<edm::InputTag>( "src" ), iConfig.getParameter<edm::InputTag>( "beamSpot" ));
00023   setAlias( iConfig.getParameter<std::string>( "@module_label" ) );
00024 //   string a = alias_;
00025 //   a.erase(a.size()-6,a.size());
00026   //register your products
00027   produces<reco::GsfTrackCollection>().setBranchAlias( alias_ + "GsfTracks" );
00028   produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
00029   produces<reco::GsfTrackExtraCollection>().setBranchAlias( alias_ + "GsfTrackExtras" );
00030   produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
00031   produces<std::vector<Trajectory> >() ;
00032 
00033 }


Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 36 of file GsfTrackProducer.cc.

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

00037 {
00038   edm::LogInfo("GsfTrackProducer") << "Analyzing event number: " << theEvent.id() << "\n";
00039   //
00040   // create empty output collections
00041   //
00042   std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
00043   std::auto_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
00044   std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
00045   std::auto_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
00046   std::auto_ptr<std::vector<Trajectory> >    outputTrajectoryColl(new std::vector<Trajectory>);
00047   //
00048   //declare and get stuff to be retrieved from ES
00049   //
00050   edm::ESHandle<TrackerGeometry> theG;
00051   edm::ESHandle<MagneticField> theMF;
00052   edm::ESHandle<TrajectoryFitter> theFitter;
00053   edm::ESHandle<Propagator> thePropagator;
00054   edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder;
00055   getFromES(setup,theG,theMF,theFitter,thePropagator,theBuilder);
00056 
00057   //
00058   //declare and get TrackColection to be retrieved from the event
00059   //
00060   AlgoProductCollection algoResults;
00061   reco::BeamSpot bs;
00062   try{  
00063     edm::Handle<TrackCandidateCollection> theTCCollection;
00064     getFromEvt(theEvent,theTCCollection,bs);
00065     
00066     //
00067     //run the algorithm  
00068     //
00069     LogDebug("GsfTrackProducer") << "run the algorithm" << "\n";
00070     theAlgo.runWithCandidate(theG.product(), theMF.product(), *theTCCollection, 
00071                              theFitter.product(), thePropagator.product(), theBuilder.product(), bs, algoResults);
00072   } catch (cms::Exception &e){ edm::LogInfo("GsfTrackProducer") << "cms::Exception caught!!!" << "\n" << e << "\n"; throw; }
00073   //
00074   //put everything in the event
00075   putInEvt(theEvent, outputRHColl, outputTColl, outputTEColl, outputGsfTEColl,
00076            outputTrajectoryColl, algoResults, bs);
00077   LogDebug("GsfTrackProducer") << "end" << "\n";
00078 }


Member Data Documentation

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

Definition at line 33 of file GsfTrackProducer.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:18 2009 for CMSSW by  doxygen 1.5.4