CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaHLTGsfTrackVarProducer::TrackExtrapolator Class Reference

List of all members.

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 (const TrackExtrapolator &rhs)
 TrackExtrapolator ()
 ~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_.

                                                                                                                        :
  cacheIDTDGeom_(rhs.cacheIDTDGeom_),
  cacheIDMagField_(rhs.cacheIDMagField_),
  magField_(rhs.magField_),
  trackerHandle_(rhs.trackerHandle_),
  mtsMode_(rhs.mtsMode_)
 
{
  if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
  else mtsTransform_ =0;
    
}  
EgammaHLTGsfTrackVarProducer::TrackExtrapolator::~TrackExtrapolator ( ) [inline]

Definition at line 52 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

{delete mtsTransform_;}

Member Function Documentation

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

Definition at line 220 of file EgammaHLTGsfTrackVarProducer.cc.

{
  TrajectoryStateOnSurface innTSOS = mtsTransform()->innerStateOnSurface(gsfTrack);
  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
  GlobalVector  extrapolatedMom;
  mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
  return extrapolatedMom;
}
GlobalPoint EgammaHLTGsfTrackVarProducer::TrackExtrapolator::extrapolateTrackPosToPoint ( const reco::GsfTrack gsfTrack,
const GlobalPoint pointToExtrapTo 
)

Definition at line 211 of file EgammaHLTGsfTrackVarProducer.cc.

Referenced by EgammaHLTGsfTrackVarProducer::produce().

{
  TrajectoryStateOnSurface innTSOS = mtsTransform()->innerStateOnSurface(gsfTrack);
  TrajectoryStateOnSurface posTSOS = mtsTransform()->extrapolatedState(innTSOS,pointToExtrapTo);
  GlobalPoint  extrapolatedPos;
  mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
  return extrapolatedPos;
}
const MultiTrajectoryStateMode* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsMode ( ) const [inline]

Definition at line 63 of file EgammaHLTGsfTrackVarProducer.h.

References mtsMode_.

{return &mtsMode_;}
const MultiTrajectoryStateTransform* EgammaHLTGsfTrackVarProducer::TrackExtrapolator::mtsTransform ( ) const [inline]

Definition at line 62 of file EgammaHLTGsfTrackVarProducer.h.

References mtsTransform_.

{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_.

{ 
  if(this!=&rhs){ //just to ensure we're not copying ourselves
    cacheIDTDGeom_ = rhs.cacheIDTDGeom_;
    cacheIDMagField_ = rhs.cacheIDMagField_;
    magField_ = rhs.magField_;
    trackerHandle_ = rhs.trackerHandle_;
    mtsMode_ = rhs.mtsMode_;
    
    delete mtsTransform_;
    if(rhs.mtsTransform_) mtsTransform_ = new MultiTrajectoryStateTransform(*rhs.mtsTransform_);
    else mtsTransform_ =0;
  }
  return this;
}
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().

{
  bool updateField(false);
  if (cacheIDMagField_!=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier()){
    updateField = true;
    cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
    iSetup.get<IdealMagneticFieldRecord>().get(magField_);
  }
  
  bool updateGeometry(false);
  if (cacheIDTDGeom_!=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier()){
    updateGeometry = true;
    cacheIDTDGeom_=iSetup.get<TrackerDigiGeometryRecord>().cacheIdentifier();
    iSetup.get<TrackerDigiGeometryRecord>().get(trackerHandle_);
  }
  
  if ( updateField || updateGeometry || !mtsTransform_ ) {
    delete mtsTransform_;
    mtsTransform_ = new MultiTrajectoryStateTransform(trackerHandle_.product(),magField_.product());
  }
}
edm::ESHandle<TrackerGeometry> EgammaHLTGsfTrackVarProducer::TrackExtrapolator::trackerGeomHandle ( ) const [inline]

Definition at line 61 of file EgammaHLTGsfTrackVarProducer.h.

References trackerHandle_.

{return trackerHandle_;}

Member Data Documentation

Definition at line 40 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

Definition at line 39 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

Definition at line 42 of file EgammaHLTGsfTrackVarProducer.h.

Referenced by operator=().

Definition at line 45 of file EgammaHLTGsfTrackVarProducer.h.

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

Definition at line 43 of file EgammaHLTGsfTrackVarProducer.h.

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