CMS 3D CMS Logo

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 MultiTrajectoryStateTransformmtsTransform () 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 MultiTrajectoryStateTransformmtsTransform_
 
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 211 of file EgammaHLTGsfTrackVarProducer.cc.

References mtsTransform_.

211  :
212  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
213  cacheIDMagField_(rhs.cacheIDMagField_),
214  magField_(rhs.magField_),
215  trackerHandle_(rhs.trackerHandle_),
216  mtsMode_(rhs.mtsMode_)
217 
218 {
219  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
220  else mtsTransform_ =0;
221 
222 }
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::~TrackExtrapolator ( )
inline

Definition at line 56 of file EgammaHLTGsfTrackVarProducer.h.

References GeneralSetup::setup().

56 {delete mtsTransform_;}

Member Function Documentation

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

Definition at line 271 of file EgammaHLTGsfTrackVarProducer.cc.

References MultiTrajectoryStateTransform::extrapolatedState(), MultiTrajectoryStateTransform::innerStateOnSurface(), MultiTrajectoryStateMode::momentumFromModeCartesian(), mtsMode(), and mtsTransform().

272 {
274  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
275  GlobalVector extrapolatedMom;
276  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
277  return extrapolatedMom;
278 }
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 262 of file EgammaHLTGsfTrackVarProducer.cc.

References MultiTrajectoryStateTransform::extrapolatedState(), MultiTrajectoryStateTransform::innerStateOnSurface(), mtsMode(), mtsTransform(), and MultiTrajectoryStateMode::positionFromModeCartesian().

Referenced by EgammaHLTGsfTrackVarProducer::produce().

263 {
265  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
266  GlobalPoint extrapolatedPos;
267  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
268  return extrapolatedPos;
269 }
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
const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform ( ) const
inline

Definition at line 65 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by extrapolateTrackMomToPoint(), and extrapolateTrackPosToPoint().

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

Definition at line 224 of file EgammaHLTGsfTrackVarProducer.cc.

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

225 {
226  if(this!=&rhs){ //just to ensure we're not copying ourselves
227  cacheIDTDGeom_ = rhs.cacheIDTDGeom_;
228  cacheIDMagField_ = rhs.cacheIDMagField_;
229  magField_ = rhs.magField_;
230  trackerHandle_ = rhs.trackerHandle_;
231  mtsMode_ = rhs.mtsMode_;
232 
233  delete mtsTransform_;
234  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
235  else mtsTransform_ =0;
236  }
237  return this;
238 }
void EgammaHLTGsfTrackVarProducer::TrackExtrapolator::setup ( const edm::EventSetup iSetup)

Definition at line 240 of file EgammaHLTGsfTrackVarProducer.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), cacheIDMagField_, cacheIDTDGeom_, edm::EventSetup::get(), magField_, mtsTransform_, edm::ESHandle< T >::product(), and trackerHandle_.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

241 {
242  bool updateField(false);
244  updateField = true;
245  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
246  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
247  }
248 
249  bool updateGeometry(false);
251  updateGeometry = true;
252  cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
254  }
255 
256  if ( updateField || updateGeometry || !mtsTransform_ ) {
257  delete mtsTransform_;
259  }
260 }
unsigned long long cacheIdentifier() const
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle<TrackerGeometry> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::trackerGeomHandle ( ) const
inline

Definition at line 64 of file EgammaHLTGsfTrackVarProducer.h.

64 {return trackerHandle_;}

Member Data Documentation

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDMagField_
private

Definition at line 45 of file EgammaHLTGsfTrackVarProducer.h.

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

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDTDGeom_
private

Definition at line 44 of file EgammaHLTGsfTrackVarProducer.h.

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

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

Definition at line 47 of file EgammaHLTGsfTrackVarProducer.h.

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

MultiTrajectoryStateMode EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsMode_
private

Definition at line 50 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform_
private

Definition at line 51 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=(), setup(), and TrackExtrapolator().

edm::ESHandle<TrackerGeometry> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::trackerHandle_
private

Definition at line 48 of file EgammaHLTGsfTrackVarProducer.h.

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