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
EgammaHLTGsfTrackVarProducer::TrackExtrapolator Class Reference

Public Member Functions

GlobalVector extrapolateTrackMomToPoint (const reco::GsfTrack &gsfTrack, const GlobalPoint &pointToExtrapTo)
 
GlobalPoint extrapolateTrackPosToPoint (const reco::GsfTrack &gsfTrack, const GlobalPoint &pointToExtrapTo)
 
const MultiTrajectoryStateModemtsMode () const
 
const
MultiTrajectoryStateTransform
mtsTransform () const
 
TrackExtrapolatoroperator= (const TrackExtrapolator &rhs)
 
void setup (const edm::EventSetup &iSetup)
 
edm::ESHandle< TrackerGeometrytrackerGeomHandle () const
 
 TrackExtrapolator ()
 
 TrackExtrapolator (const TrackExtrapolator &rhs)
 
 ~TrackExtrapolator ()
 

Private Attributes

unsigned long long cacheIDMagField_
 
unsigned long long cacheIDTDGeom_
 
edm::ESHandle< MagneticFieldmagField_
 
MultiTrajectoryStateMode mtsMode_
 
const
MultiTrajectoryStateTransform
mtsTransform_
 
edm::ESHandle< TrackerGeometrytrackerHandle_
 

Detailed Description

Definition at line 43 of file EgammaHLTGsfTrackVarProducer.h.

Constructor & Destructor Documentation

EgammaHLTGsfTrackVarProducer::TrackExtrapolator::TrackExtrapolator ( )
inline
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::TrackExtrapolator ( const TrackExtrapolator rhs)

Definition at line 143 of file EgammaHLTGsfTrackVarProducer.cc.

References mtsTransform_.

143  :
144  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
145  cacheIDMagField_(rhs.cacheIDMagField_),
146  magField_(rhs.magField_),
147  trackerHandle_(rhs.trackerHandle_),
148  mtsMode_(rhs.mtsMode_)
149 
150 {
151  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
152  else mtsTransform_ =0;
153 
154 }
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::~TrackExtrapolator ( )
inline

Definition at line 56 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

56 {delete mtsTransform_;}

Member Function Documentation

GlobalVector EgammaHLTGsfTrackVarProducer::TrackExtrapolator::extrapolateTrackMomToPoint ( const reco::GsfTrack gsfTrack,
const GlobalPoint pointToExtrapTo 
)

Definition at line 203 of file EgammaHLTGsfTrackVarProducer.cc.

204 {
206  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
207  GlobalVector extrapolatedMom;
208  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
209  return extrapolatedMom;
210 }
const MultiTrajectoryStateMode * mtsMode() const
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
const MultiTrajectoryStateTransform * mtsTransform() const
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
GlobalPoint EgammaHLTGsfTrackVarProducer::TrackExtrapolator::extrapolateTrackPosToPoint ( const reco::GsfTrack gsfTrack,
const GlobalPoint pointToExtrapTo 
)

Definition at line 194 of file EgammaHLTGsfTrackVarProducer.cc.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

195 {
197  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
198  GlobalPoint extrapolatedPos;
199  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
200  return extrapolatedPos;
201 }
bool positionFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalPoint &position) const
const MultiTrajectoryStateMode * mtsMode() const
const MultiTrajectoryStateTransform * mtsTransform() const
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
const MultiTrajectoryStateMode* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsMode ( ) const
inline

Definition at line 67 of file EgammaHLTGsfTrackVarProducer.h.

References mtsMode_.

const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform ( ) const
inline

Definition at line 66 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

66 {return mtsTransform_;}
EgammaHLTGsfTrackVarProducer::TrackExtrapolator * EgammaHLTGsfTrackVarProducer::TrackExtrapolator::operator= ( const TrackExtrapolator rhs)

Definition at line 156 of file EgammaHLTGsfTrackVarProducer.cc.

References cacheIDMagField_, cacheIDTDGeom_, magField_, mtsMode_, mtsTransform_, and trackerHandle_.

157 {
158  if(this!=&rhs){ //just to ensure we're not copying ourselves
159  cacheIDTDGeom_ = rhs.cacheIDTDGeom_;
160  cacheIDMagField_ = rhs.cacheIDMagField_;
161  magField_ = rhs.magField_;
162  trackerHandle_ = rhs.trackerHandle_;
163  mtsMode_ = rhs.mtsMode_;
164 
165  delete mtsTransform_;
166  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
167  else mtsTransform_ =0;
168  }
169  return this;
170 }
void EgammaHLTGsfTrackVarProducer::TrackExtrapolator::setup ( const edm::EventSetup iSetup)

Definition at line 172 of file EgammaHLTGsfTrackVarProducer.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), and edm::EventSetup::get().

Referenced by EgammaHLTGsfTrackVarProducer::produce().

173 {
174  bool updateField(false);
176  updateField = true;
177  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
178  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
179  }
180 
181  bool updateGeometry(false);
183  updateGeometry = true;
184  cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
186  }
187 
188  if ( updateField || updateGeometry || !mtsTransform_ ) {
189  delete mtsTransform_;
191  }
192 }
unsigned long long cacheIdentifier() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::ESHandle<TrackerGeometry> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::trackerGeomHandle ( ) const
inline

Definition at line 65 of file EgammaHLTGsfTrackVarProducer.h.

References trackerHandle_.

65 {return trackerHandle_;}

Member Data Documentation

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDMagField_
private

Definition at line 45 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDTDGeom_
private

Definition at line 44 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

edm::ESHandle<MagneticField> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::magField_
private

Definition at line 47 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

MultiTrajectoryStateMode EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsMode_
private

Definition at line 50 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by mtsMode(), and operator=().

const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform_
private
edm::ESHandle<TrackerGeometry> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::trackerHandle_
private

Definition at line 48 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=(), and trackerGeomHandle().