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

References mtsTransform_.

176  :
177  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
178  cacheIDMagField_(rhs.cacheIDMagField_),
179  magField_(rhs.magField_),
180  trackerHandle_(rhs.trackerHandle_),
181  mtsMode_(rhs.mtsMode_)
182 
183 {
184  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
185  else mtsTransform_ =0;
186 
187 }
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 236 of file EgammaHLTGsfTrackVarProducer.cc.

237 {
239  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
240  GlobalVector extrapolatedMom;
241  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
242  return extrapolatedMom;
243 }
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 227 of file EgammaHLTGsfTrackVarProducer.cc.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

228 {
230  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
231  GlobalPoint extrapolatedPos;
232  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
233  return extrapolatedPos;
234 }
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 189 of file EgammaHLTGsfTrackVarProducer.cc.

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

190 {
191  if(this!=&rhs){ //just to ensure we're not copying ourselves
192  cacheIDTDGeom_ = rhs.cacheIDTDGeom_;
193  cacheIDMagField_ = rhs.cacheIDMagField_;
194  magField_ = rhs.magField_;
195  trackerHandle_ = rhs.trackerHandle_;
196  mtsMode_ = rhs.mtsMode_;
197 
198  delete mtsTransform_;
199  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
200  else mtsTransform_ =0;
201  }
202  return this;
203 }
void EgammaHLTGsfTrackVarProducer::TrackExtrapolator::setup ( const edm::EventSetup iSetup)

Definition at line 205 of file EgammaHLTGsfTrackVarProducer.cc.

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

Referenced by EgammaHLTGsfTrackVarProducer::produce().

206 {
207  bool updateField(false);
209  updateField = true;
210  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
211  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
212  }
213 
214  bool updateGeometry(false);
216  updateGeometry = true;
217  cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
219  }
220 
221  if ( updateField || updateGeometry || !mtsTransform_ ) {
222  delete mtsTransform_;
224  }
225 }
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().