#include <RecoVertex/KalmanVertexFit/plugins/KVFTrackUpdate.h>
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_ |
Definition at line 19 of file KVFTrackUpdate.h.
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 | ( | ) |
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] |
edm::InputTag KVFTrackUpdate::beamSpotLabel [private] |
edm::InputTag KVFTrackUpdate::trackLabel_ [private] |