CMS 3D CMS Logo

KVFTrackUpdate Class Reference

This is a very simple test analyzer to test the update of a track with a vertex constraint with the Kalman filter. More...

#include <RecoVertex/KalmanVertexFit/plugins/KVFTrackUpdate.h>

Inheritance diagram for KVFTrackUpdate:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (edm::EventSetup const &)
virtual void endJob ()
 KVFTrackUpdate (const edm::ParameterSet &)
 ~KVFTrackUpdate ()

Private Attributes

edm::InputTag beamSpotLabel
edm::InputTag trackLabel_


Detailed Description

This is a very simple test analyzer to test the update of a track with a vertex constraint with the Kalman filter.

Definition at line 19 of file KVFTrackUpdate.h.


Constructor & Destructor Documentation

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

Definition at line 28 of file KVFTrackUpdate.cc.

References beamSpotLabel, edm::ParameterSet::getParameter(), and trackLabel_.

00029 {
00030   trackLabel_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
00031   beamSpotLabel = iConfig.getParameter<edm::InputTag>("beamSpotLabel");
00032 }

KVFTrackUpdate::~KVFTrackUpdate (  ) 

Definition at line 35 of file KVFTrackUpdate.cc.

00035                                 {
00036 }


Member Function Documentation

void KVFTrackUpdate::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 50 of file KVFTrackUpdate.cc.

References a, b, beamSpotLabel, SingleTrackVertexConstraint::constrain(), GenMuonPlsPt100GeV_cfg::cout, e, lat::endl(), err, exception, edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::Event::id(), edm::Handle< T >::isValid(), and trackLabel_.

00051 {
00052 
00053 
00054 
00055   try {
00056     edm::LogInfo("RecoVertex/KVFTrackUpdate") 
00057       << "Reconstructing event number: " << iEvent.id() << "\n";
00058     
00059     // get RECO tracks from the event
00060     // `tks` can be used as a ptr to a reco::TrackCollection
00061     edm::Handle<reco::TrackCollection> tks;
00062     iEvent.getByLabel(trackLabel_, tks);
00063 
00064     edm::LogInfo("RecoVertex/KVFTrackUpdate") 
00065       << "Found: " << (*tks).size() << " reconstructed tracks" << "\n";
00066     cout << "got " << (*tks).size() << " tracks " << endl;
00067 
00068     // Transform Track to TransientTrack
00069 
00070     //get the builder:
00071     edm::ESHandle<TransientTrackBuilder> theB;
00072     iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
00073     //do the conversion:
00074     vector<TransientTrack> t_tks = (*theB).build(tks);
00075 
00076     edm::LogInfo("RecoVertex/KVFTrackUpdate") 
00077       << "Found: " << t_tks.size() << " reconstructed tracks" << "\n";
00078     
00079     GlobalPoint glbPos(0.,0.,0.);
00080 
00081     AlgebraicSymMatrix mat(3,0);
00082     mat[0][0] = (20.e-04)*(20.e-04);
00083     mat[1][1] = (20.e-04)*(20.e-04);
00084     mat[2][2] = (5.3)*(5.3);
00085     GlobalError glbErrPos(mat);
00086 
00087     reco::BeamSpot vertexBeamSpot;
00088     edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
00089     iEvent.getByLabel(beamSpotLabel,recoBeamSpotHandle);
00090 
00091 
00092     SingleTrackVertexConstraint stvc;
00093     for (int i = 0; i<t_tks.size();i++) {
00094       SingleTrackVertexConstraint::TrackFloatPair a = 
00095         stvc.constrain(t_tks[i], glbPos, glbErrPos);
00096       std::cout << "Chi2: "<< a.second<<std::endl;
00097       if (recoBeamSpotHandle.isValid()){
00098         SingleTrackVertexConstraint::TrackFloatPair b =
00099           stvc.constrain(t_tks[i], *recoBeamSpotHandle);
00100         std::cout << "Chi2: "<< b.second<<std::endl;
00101       }
00102     }
00103   }
00104 
00105 
00106   catch (std::exception & err) {
00107     edm::LogInfo("RecoVertex/KVFTrackUpdate") 
00108       << "Exception during event number: " << iEvent.id() 
00109       << "\n" << err.what() << "\n";
00110   }
00111 
00112 }

void KVFTrackUpdate::beginJob ( edm::EventSetup const &  setup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file KVFTrackUpdate.cc.

00038                                                        {
00039 }

void KVFTrackUpdate::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 42 of file KVFTrackUpdate.cc.

00042                             {
00043 }


Member Data Documentation

edm::InputTag KVFTrackUpdate::beamSpotLabel [private]

Definition at line 31 of file KVFTrackUpdate.h.

Referenced by analyze(), and KVFTrackUpdate().

edm::InputTag KVFTrackUpdate::trackLabel_ [private]

Definition at line 31 of file KVFTrackUpdate.h.

Referenced by analyze(), and KVFTrackUpdate().


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