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

#include <TransientTrackBuilder.h>

Public Member Functions

reco::TransientTrack build (const reco::Track *p) const
 
reco::TransientTrack build (const reco::Track &p) const
 
reco::TransientTrack build (const reco::GsfTrack *p) const
 
reco::TransientTrack build (const reco::GsfTrack &p) const
 
reco::TransientTrack build (const reco::TrackRef *p) const
 
reco::TransientTrack build (const reco::TrackRef &p) const
 
reco::TransientTrack build (const reco::GsfTrackRef *p) const
 
reco::TransientTrack build (const reco::GsfTrackRef &p) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl, const reco::BeamSpot &beamSpot) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl, const reco::BeamSpot &beamSpot) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl, const reco::BeamSpot &beamSpot) const
 
reco::TransientTrack build (const FreeTrajectoryState &fts) const
 
const MagneticFieldfield () const
 
const edm::ESHandle
< GlobalTrackingGeometry
trackingGeometry () const
 
 TransientTrackBuilder (const MagneticField *field, const edm::ESHandle< GlobalTrackingGeometry > &trackingGeometry)
 

Private Attributes

const MagneticFieldtheField
 
edm::ESHandle
< GlobalTrackingGeometry
theTrackingGeometry
 

Detailed Description

Helper class to build TransientTrack from the persistent Track. This is obtained from the eventSetup, as given in the example in the test directory.

Definition at line 14 of file TransientTrackBuilder.h.

Constructor & Destructor Documentation

TransientTrackBuilder::TransientTrackBuilder ( const MagneticField field,
const edm::ESHandle< GlobalTrackingGeometry > &  trackingGeometry 
)
inline

Definition at line 16 of file TransientTrackBuilder.h.

17  :
18  theField(field) , theTrackingGeometry(trackingGeometry) {}
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry

Member Function Documentation

TransientTrack TransientTrackBuilder::build ( const reco::Track p) const
TransientTrack TransientTrackBuilder::build ( const reco::Track p) const

Definition at line 14 of file TransientTrackBuilder.cc.

14  {
16 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrack p) const

Definition at line 18 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::GsfTrack p) const

Definition at line 22 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::TrackRef p) const

Definition at line 26 of file TransientTrackBuilder.cc.

26  {
28 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::TrackRef p) const

Definition at line 30 of file TransientTrackBuilder.cc.

30  {
32 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const

Definition at line 35 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const

Definition at line 39 of file TransientTrackBuilder.cc.

vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl) const

Definition at line 44 of file TransientTrackBuilder.cc.

References i.

45 {
46  vector<TransientTrack> ttVect;
47  ttVect.reserve((*trkColl).size());
48  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
49  ttVect.push_back(TransientTrack(TrackRef(trkColl, i), theField, theTrackingGeometry));
50  }
51  return ttVect;
52 }
int i
Definition: DBlmapReader.cc:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl) const

Definition at line 55 of file TransientTrackBuilder.cc.

References i.

56 {
57  vector<TransientTrack> ttVect;
58  ttVect.reserve((*trkColl).size());
59  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
60  ttVect.push_back( TransientTrack(
62  }
63  return ttVect;
64 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
int i
Definition: DBlmapReader.cc:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl) const

Definition at line 67 of file TransientTrackBuilder.cc.

References i.

68 {
69  vector<TransientTrack> ttVect;
70  ttVect.reserve((*trkColl).size());
71  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
72  const Track * trk = &(*trkColl)[i];
73  const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
74  if (gsfTrack) {
75  ttVect.push_back( TransientTrack(
76  new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), theField, theTrackingGeometry)) );
77  } else { // gsf
78  ttVect.push_back(TransientTrack(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), theField, theTrackingGeometry));
79  }
80  }
81  return ttVect;
82 }
int i
Definition: DBlmapReader.cc:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 85 of file TransientTrackBuilder.cc.

References newFWLiteAna::build, and i.

87 {
88  vector<TransientTrack> ttVect = build(trkColl);
89  for (unsigned int i = 0; i < ttVect.size() ; i++) {
90  ttVect[i].setBeamSpot(beamSpot);
91  }
92  return ttVect;
93 }
int i
Definition: DBlmapReader.cc:9
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 96 of file TransientTrackBuilder.cc.

References newFWLiteAna::build, and i.

98 {
99  vector<TransientTrack> ttVect = build(trkColl);
100  for (unsigned int i = 0; i < ttVect.size() ; i++) {
101  ttVect[i].setBeamSpot(beamSpot);
102  }
103  return ttVect;
104 }
int i
Definition: DBlmapReader.cc:9
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 107 of file TransientTrackBuilder.cc.

References newFWLiteAna::build, and i.

109 {
110  vector<TransientTrack> ttVect = build(trkColl);
111  for (unsigned int i = 0; i < ttVect.size() ; i++) {
112  ttVect[i].setBeamSpot(beamSpot);
113  }
114  return ttVect;
115 }
int i
Definition: DBlmapReader.cc:9
reco::TransientTrack build(const reco::Track *p) const
TransientTrack TransientTrackBuilder::build ( const FreeTrajectoryState fts) const
const MagneticField* TransientTrackBuilder::field ( ) const
inline

Definition at line 43 of file TransientTrackBuilder.h.

References theField.

43 {return theField;}
const MagneticField * theField
const edm::ESHandle<GlobalTrackingGeometry> TransientTrackBuilder::trackingGeometry ( ) const
inline

Definition at line 44 of file TransientTrackBuilder.h.

References theTrackingGeometry.

44 {return theTrackingGeometry;}
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry

Member Data Documentation

const MagneticField* TransientTrackBuilder::theField
private

Definition at line 47 of file TransientTrackBuilder.h.

Referenced by field().

edm::ESHandle<GlobalTrackingGeometry> TransientTrackBuilder::theTrackingGeometry
private

Definition at line 48 of file TransientTrackBuilder.h.

Referenced by trackingGeometry().