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

References mtsTransform_.

165  :
166  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
167  cacheIDMagField_(rhs.cacheIDMagField_),
168  magField_(rhs.magField_),
169  trackerHandle_(rhs.trackerHandle_),
170  mtsMode_(rhs.mtsMode_)
171 
172 {
173  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
174  else mtsTransform_ =0;
175 
176 }
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 225 of file EgammaHLTGsfTrackVarProducer.cc.

226 {
228  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
229  GlobalVector extrapolatedMom;
230  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
231  return extrapolatedMom;
232 }
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 216 of file EgammaHLTGsfTrackVarProducer.cc.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

217 {
219  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
220  GlobalPoint extrapolatedPos;
221  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
222  return extrapolatedPos;
223 }
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 178 of file EgammaHLTGsfTrackVarProducer.cc.

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

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

Definition at line 194 of file EgammaHLTGsfTrackVarProducer.cc.

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

Referenced by EgammaHLTGsfTrackVarProducer::produce().

195 {
196  bool updateField(false);
198  updateField = true;
199  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
200  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
201  }
202 
203  bool updateGeometry(false);
205  updateGeometry = true;
206  cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
208  }
209 
210  if ( updateField || updateGeometry || !mtsTransform_ ) {
211  delete mtsTransform_;
213  }
214 }
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().