CMS 3D CMS Logo

Public Member Functions | Private Attributes

TransientTrackBuilder Class Reference

#include <TransientTrackBuilder.h>

List of all members.

Public Member Functions

reco::TransientTrack build (const reco::Track *p) const
reco::TransientTrack build (const reco::GsfTrack *p) const
reco::TransientTrack build (const reco::GsfTrackRef *p) const
reco::TransientTrack build (const FreeTrajectoryState &fts) const
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &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< reco::TrackCollection > &trkColl, const reco::BeamSpot &beamSpot) const
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl) const
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl) const
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl) const
reco::TransientTrack build (const reco::GsfTrackRef &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::Track &p) 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.

                                                                     :
        theField(field) ,  theTrackingGeometry(trackingGeometry) {}

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.

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

Definition at line 117 of file TransientTrackBuilder.cc.

                                                                                  {
  return TransientTrack(new TransientTrackFromFTS(fts));
}
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.

{
  vector<TransientTrack> ttVect = build(trkColl);
  for (unsigned int i = 0; i < ttVect.size() ; i++) {
    ttVect[i].setBeamSpot(beamSpot);
  }
  return ttVect;
}
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.

{
  vector<TransientTrack> ttVect = build(trkColl);
  for (unsigned int i = 0; i < ttVect.size() ; i++) {
    ttVect[i].setBeamSpot(beamSpot);
  }
  return ttVect;
}
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.

{
  vector<TransientTrack> ttVect = build(trkColl);
  for (unsigned int i = 0; i < ttVect.size() ; i++) {
    ttVect[i].setBeamSpot(beamSpot);
  }
  return ttVect;
}
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl) const

Definition at line 67 of file TransientTrackBuilder.cc.

References i.

{
  vector<TransientTrack> ttVect;
  ttVect.reserve((*trkColl).size());
  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
    const Track * trk = &(*trkColl)[i];
    const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
    if (gsfTrack) {
      ttVect.push_back( TransientTrack(
          new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), theField, theTrackingGeometry)) );
    } else { // gsf
      ttVect.push_back(TransientTrack(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), theField, theTrackingGeometry));
    }
  }
  return ttVect;
}
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl) const

Definition at line 55 of file TransientTrackBuilder.cc.

References i.

{
  vector<TransientTrack> ttVect;
  ttVect.reserve((*trkColl).size());
  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
    ttVect.push_back( TransientTrack(
        new GsfTransientTrack(GsfTrackRef(trkColl, i), theField, theTrackingGeometry)) );
  }
  return ttVect;
}
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl) const

Definition at line 44 of file TransientTrackBuilder.cc.

References i.

{
  vector<TransientTrack> ttVect;
  ttVect.reserve((*trkColl).size());
  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
    ttVect.push_back(TransientTrack(TrackRef(trkColl, i), theField, theTrackingGeometry));
  }
  return ttVect;
}
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const

Definition at line 35 of file TransientTrackBuilder.cc.

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

Definition at line 30 of file TransientTrackBuilder.cc.

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

Definition at line 26 of file TransientTrackBuilder.cc.

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

Definition at line 18 of file TransientTrackBuilder.cc.

const MagneticField* TransientTrackBuilder::field ( ) const [inline]

Definition at line 43 of file TransientTrackBuilder.h.

References theField.

{return theField;}
const edm::ESHandle<GlobalTrackingGeometry> TransientTrackBuilder::trackingGeometry ( ) const [inline]

Definition at line 44 of file TransientTrackBuilder.h.

References theTrackingGeometry.


Member Data Documentation

Definition at line 47 of file TransientTrackBuilder.h.

Referenced by field().

Definition at line 48 of file TransientTrackBuilder.h.

Referenced by trackingGeometry().