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 36 of file EgammaHLTGsfTrackVarProducer.h.

Constructor & Destructor Documentation

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

Definition at line 160 of file EgammaHLTGsfTrackVarProducer.cc.

References mtsTransform_.

160  :
161  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
162  cacheIDMagField_(rhs.cacheIDMagField_),
163  magField_(rhs.magField_),
164  trackerHandle_(rhs.trackerHandle_),
165  mtsMode_(rhs.mtsMode_)
166 
167 {
168  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
169  else mtsTransform_ =0;
170 
171 }
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::~TrackExtrapolator ( )
inline

Definition at line 52 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

52 {delete mtsTransform_;}

Member Function Documentation

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

Definition at line 220 of file EgammaHLTGsfTrackVarProducer.cc.

221 {
223  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
224  GlobalVector extrapolatedMom;
225  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
226  return extrapolatedMom;
227 }
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 211 of file EgammaHLTGsfTrackVarProducer.cc.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

212 {
214  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
215  GlobalPoint extrapolatedPos;
216  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
217  return extrapolatedPos;
218 }
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 63 of file EgammaHLTGsfTrackVarProducer.h.

References mtsMode_.

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

Definition at line 62 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

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

Definition at line 173 of file EgammaHLTGsfTrackVarProducer.cc.

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

174 {
175  if(this!=&rhs){ //just to ensure we're not copying ourselves
176  cacheIDTDGeom_ = rhs.cacheIDTDGeom_;
177  cacheIDMagField_ = rhs.cacheIDMagField_;
178  magField_ = rhs.magField_;
179  trackerHandle_ = rhs.trackerHandle_;
180  mtsMode_ = rhs.mtsMode_;
181 
182  delete mtsTransform_;
183  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
184  else mtsTransform_ =0;
185  }
186  return this;
187 }
void EgammaHLTGsfTrackVarProducer::TrackExtrapolator::setup ( const edm::EventSetup iSetup)

Definition at line 189 of file EgammaHLTGsfTrackVarProducer.cc.

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

Referenced by EgammaHLTGsfTrackVarProducer::produce().

190 {
191  bool updateField(false);
193  updateField = true;
194  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
195  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
196  }
197 
198  bool updateGeometry(false);
200  updateGeometry = true;
201  cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
203  }
204 
205  if ( updateField || updateGeometry || !mtsTransform_ ) {
206  delete mtsTransform_;
208  }
209 }
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 61 of file EgammaHLTGsfTrackVarProducer.h.

References trackerHandle_.

61 {return trackerHandle_;}

Member Data Documentation

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDMagField_
private

Definition at line 40 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

unsigned long long EgammaHLTGsfTrackVarProducer::TrackExtrapolator::cacheIDTDGeom_
private

Definition at line 39 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

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

Definition at line 42 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

MultiTrajectoryStateMode EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsMode_
private

Definition at line 45 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 43 of file EgammaHLTGsfTrackVarProducer.h.

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