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

#include <GSFTrackMaker.h>

Public Member Functions

 GSFTrackMaker (const edm::ParameterSet &, edm::ConsumesCollector)
 
void SetVars (HWW &, const edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT< edm::View
< reco::GsfTrack > > 
GSFTrack_
 

Detailed Description

Definition at line 9 of file GSFTrackMaker.h.

Constructor & Destructor Documentation

GSFTrackMaker::GSFTrackMaker ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  iCollector 
)

Definition at line 12 of file GSFTrackMaker.cc.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), and GSFTrack_.

12  {
13 
14  GSFTrack_ = iCollector.consumes<edm::View<reco::GsfTrack> > (iConfig.getParameter<edm::InputTag>("gsftracksInputTag"));
15 
16 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::GsfTrack > > GSFTrack_
Definition: GSFTrackMaker.h:18

Member Function Documentation

void GSFTrackMaker::SetVars ( HWW hww,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 18 of file GSFTrackMaker.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), GSFTrack_, HWW::gsftrks_d0(), HWW::gsftrks_d0Err(), HWW::gsftrks_d0phiCov(), HWW::gsftrks_etaErr(), HWW::gsftrks_p4(), HWW::gsftrks_phiErr(), HWW::gsftrks_vertex_p4(), HWW::gsftrks_z0(), HWW::gsftrks_z0Err(), i, HWW::Load_gsftrks_d0(), HWW::Load_gsftrks_d0Err(), HWW::Load_gsftrks_d0phiCov(), HWW::Load_gsftrks_etaErr(), HWW::Load_gsftrks_p4(), HWW::Load_gsftrks_phiErr(), HWW::Load_gsftrks_vertex_p4(), HWW::Load_gsftrks_z0(), and HWW::Load_gsftrks_z0Err().

Referenced by HWWAnalyzer::analyze().

19 {
20  using namespace edm;
21  using std::vector;
22  using reco::Track;
23  using reco::TrackBase;
24 
25  hww.Load_gsftrks_p4();
27  hww.Load_gsftrks_d0();
28  hww.Load_gsftrks_z0();
29  hww.Load_gsftrks_d0Err();
30  hww.Load_gsftrks_z0Err();
31  hww.Load_gsftrks_etaErr();
32  hww.Load_gsftrks_phiErr();
34 
35  bool validToken;
36 
38  validToken = iEvent.getByToken(GSFTrack_, track_h);
39  if(!validToken) return;
40 
41  edm::ESHandle<MagneticField> theMagField;
42  iSetup.get<IdealMagneticFieldRecord>().get(theMagField);
43 
45  iSetup.get<TrackerDigiGeometryRecord>().get(theG);
46 
47  edm::View<reco::GsfTrack>::const_iterator tracks_end = track_h->end();
48 
49  for (edm::View<reco::GsfTrack>::const_iterator i = track_h->begin(); i != tracks_end; ++i) {
50 
51  hww.gsftrks_p4() .push_back( LorentzVector( i->px(), i->py(), i->pz(), i->p() ) );
52  hww.gsftrks_vertex_p4() .push_back( LorentzVector(i->vx(),i->vy(), i->vz(), 0.) );
53  hww.gsftrks_d0() .push_back( i->d0() );
54  hww.gsftrks_z0() .push_back( i->dz() );
55  hww.gsftrks_d0Err() .push_back( i->d0Error() );
56  hww.gsftrks_z0Err() .push_back( i->dzError() );
57  hww.gsftrks_etaErr() .push_back( i->etaError() );
58  hww.gsftrks_phiErr() .push_back( i->phiError() );
59  hww.gsftrks_d0phiCov() .push_back( -i->covariance(TrackBase::i_phi, TrackBase::i_dxy) );
60 
61  }
62 }
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
std::vector< float > & gsftrks_phiErr()
Definition: HWW.cc:705
void Load_gsftrks_d0()
Definition: HWW.cc:1310
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< float > & gsftrks_d0Err()
Definition: HWW.cc:701
std::vector< float > & gsftrks_z0Err()
Definition: HWW.cc:713
void Load_gsftrks_vertex_p4()
Definition: HWW.cc:1307
void Load_gsftrks_p4()
Definition: HWW.cc:1304
std::vector< float > & gsftrks_etaErr()
Definition: HWW.cc:721
std::vector< LorentzVector > & gsftrks_vertex_p4()
Definition: HWW.cc:693
void Load_gsftrks_d0phiCov()
Definition: HWW.cc:1319
void Load_gsftrks_z0Err()
Definition: HWW.cc:1322
void Load_gsftrks_etaErr()
Definition: HWW.cc:1328
std::vector< float > & gsftrks_d0phiCov()
Definition: HWW.cc:709
const T & get() const
Definition: EventSetup.h:55
std::vector< float > & gsftrks_d0()
Definition: HWW.cc:697
void Load_gsftrks_phiErr()
Definition: HWW.cc:1316
std::vector< LorentzVector > & gsftrks_p4()
Definition: HWW.cc:689
void Load_gsftrks_d0Err()
Definition: HWW.cc:1313
edm::EDGetTokenT< edm::View< reco::GsfTrack > > GSFTrack_
Definition: GSFTrackMaker.h:18
void Load_gsftrks_z0()
Definition: HWW.cc:1325
std::vector< float > & gsftrks_z0()
Definition: HWW.cc:717
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

edm::EDGetTokenT<edm::View<reco::GsfTrack> > GSFTrackMaker::GSFTrack_
private

Definition at line 18 of file GSFTrackMaker.h.

Referenced by GSFTrackMaker(), and SetVars().