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 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_
 
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 217 of file EgammaHLTGsfTrackVarProducer.cc.

References mtsTransform_.

217  :
218  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
219  cacheIDMagField_(rhs.cacheIDMagField_),
220  magField_(rhs.magField_),
221  trackerHandle_(rhs.trackerHandle_)
222 {
223  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
224  else mtsTransform_ =nullptr;
225 
226 }
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::~TrackExtrapolator ( )
inline

Definition at line 55 of file EgammaHLTGsfTrackVarProducer.h.

References GeneralSetup::setup().

55 {delete mtsTransform_;}

Member Function Documentation

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

Definition at line 274 of file EgammaHLTGsfTrackVarProducer.cc.

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

275 {
277  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
278  GlobalVector extrapolatedMom;
280  return extrapolatedMom;
281 }
const MultiTrajectoryStateTransform * mtsTransform() const
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
GlobalPoint EgammaHLTGsfTrackVarProducer::TrackExtrapolator::extrapolateTrackPosToPoint ( const reco::GsfTrack gsfTrack,
const GlobalPoint pointToExtrapTo 
)

Definition at line 265 of file EgammaHLTGsfTrackVarProducer.cc.

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

Referenced by EgammaHLTGsfTrackVarProducer::produce().

266 {
268  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
269  GlobalPoint extrapolatedPos;
271  return extrapolatedPos;
272 }
const MultiTrajectoryStateTransform * mtsTransform() const
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform ( ) const
inline

Definition at line 64 of file EgammaHLTGsfTrackVarProducer.h.

References fillDescriptions().

Referenced by extrapolateTrackMomToPoint(), and extrapolateTrackPosToPoint().

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

Definition at line 228 of file EgammaHLTGsfTrackVarProducer.cc.

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

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

Definition at line 243 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().

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

Definition at line 63 of file EgammaHLTGsfTrackVarProducer.h.

63 {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().

const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform_
private

Definition at line 50 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().