CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GSFTrackMaker.cc
Go to the documentation of this file.
8 
11 
13 
14  GSFTrack_ = iCollector.consumes<edm::View<reco::GsfTrack> > (iConfig.getParameter<edm::InputTag>("gsftracksInputTag"));
15 
16 }
17 
18 void GSFTrackMaker::SetVars(HWW& hww, const edm::Event& iEvent, const edm::EventSetup& iSetup)
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 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
void SetVars(HWW &, const edm::Event &, const edm::EventSetup &)
int i
Definition: DBlmapReader.cc:9
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:449
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::pair< double, double > Point
Definition: CaloEllipse.h:18
std::vector< float > & gsftrks_etaErr()
Definition: HWW.cc:721
int iEvent
Definition: GenABIO.cc:230
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
Definition: HWW.h:12
GSFTrackMaker(const edm::ParameterSet &, edm::ConsumesCollector)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
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
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void Load_gsftrks_z0()
Definition: HWW.cc:1325
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
std::vector< float > & gsftrks_z0()
Definition: HWW.cc:717
math::PtEtaPhiELorentzVectorF LorentzVector