#include <KVFTrackUpdate.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | endJob () |
KVFTrackUpdate (const edm::ParameterSet &) | |
~KVFTrackUpdate () | |
Private Attributes | |
edm::InputTag | beamSpotLabel |
edm::InputTag | trackLabel_ |
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.
KVFTrackUpdate::KVFTrackUpdate | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 26 of file KVFTrackUpdate.cc.
References edm::ParameterSet::getParameter().
{ trackLabel_ = iConfig.getParameter<edm::InputTag>("TrackLabel"); beamSpotLabel = iConfig.getParameter<edm::InputTag>("beamSpotLabel"); }
KVFTrackUpdate::~KVFTrackUpdate | ( | ) |
Definition at line 33 of file KVFTrackUpdate.cc.
{ }
void KVFTrackUpdate::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 48 of file KVFTrackUpdate.cc.
References a, b, SingleTrackVertexConstraint::constrain(), gather_cfg::cout, alignCSCRings::e, exception, edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::EventBase::id(), and edm::HandleBase::isValid().
{ try { edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Reconstructing event number: " << iEvent.id() << "\n"; // get RECO tracks from the event // `tks` can be used as a ptr to a reco::TrackCollection edm::Handle<reco::TrackCollection> tks; iEvent.getByLabel(trackLabel_, tks); edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Found: " << (*tks).size() << " reconstructed tracks" << "\n"; std::cout << "got " << (*tks).size() << " tracks " << std::endl; // Transform Track to TransientTrack //get the builder: edm::ESHandle<TransientTrackBuilder> theB; iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB); //do the conversion: std::vector<TransientTrack> t_tks = (*theB).build(tks); edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Found: " << t_tks.size() << " reconstructed tracks" << "\n"; GlobalPoint glbPos(0.,0.,0.); AlgebraicSymMatrix33 mat; mat[0][0] = (20.e-04)*(20.e-04); mat[1][1] = (20.e-04)*(20.e-04); mat[2][2] = (5.3)*(5.3); GlobalError glbErrPos(mat); reco::BeamSpot vertexBeamSpot; edm::Handle<reco::BeamSpot> recoBeamSpotHandle; iEvent.getByLabel(beamSpotLabel,recoBeamSpotHandle); SingleTrackVertexConstraint stvc; for (unsigned int i = 0; i<t_tks.size();i++) { SingleTrackVertexConstraint::BTFtuple a = stvc.constrain(t_tks[i], glbPos, glbErrPos); std::cout << "Chi2: "<< a.get<2>()<<std::endl; if (recoBeamSpotHandle.isValid()){ SingleTrackVertexConstraint::BTFtuple b = stvc.constrain(t_tks[i], *recoBeamSpotHandle); std::cout << "Chi2: "<< b.get<2>()<<std::endl; } } } catch (std::exception & err) { edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Exception during event number: " << iEvent.id() << "\n" << err.what() << "\n"; } }
void KVFTrackUpdate::beginJob | ( | void | ) | [virtual] |
void KVFTrackUpdate::endJob | ( | void | ) | [virtual] |
edm::InputTag KVFTrackUpdate::beamSpotLabel [private] |
Definition at line 31 of file KVFTrackUpdate.h.
edm::InputTag KVFTrackUpdate::trackLabel_ [private] |
Definition at line 31 of file KVFTrackUpdate.h.