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 Types | Private Member Functions | Private Attributes
MultiTrajectoryStateTransform Class Reference

#include <MultiTrajectoryStateTransform.h>

Public Member Functions

TrajectoryStateOnSurface extrapolatedState (const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
 
bool innerMomentumFromMode (const reco::GsfTrack &tk, GlobalVector &momentum) const
 
TrajectoryStateOnSurface innerStateOnSurface (const reco::GsfTrack &tk) const
 
TrajectoryStateOnSurface innerStateOnSurface (const reco::GsfTrack &tk, const TrackingGeometry &geom, const MagneticField *field) const
 
 MultiTrajectoryStateTransform ()
 
 MultiTrajectoryStateTransform (const TrackingGeometry *geom, const MagneticField *field)
 
bool outerMomentumFromMode (const reco::GsfTrack &tk, GlobalVector &momentum) const
 
TrajectoryStateOnSurface outerStateOnSurface (const reco::GsfTrack &tk) const
 
TrajectoryStateOnSurface outerStateOnSurface (const reco::GsfTrack &tk, const TrackingGeometry &geom, const MagneticField *field) const
 
 ~MultiTrajectoryStateTransform ()
 

Private Types

enum  { dimension = reco::GsfTrackExtra::dimension }
 
typedef
reco::GsfTrackExtra::LocalCovarianceMatrix 
CovarianceMatrix
 
typedef
reco::GsfTrackExtra::LocalParameterVector 
ParameterVector
 

Private Member Functions

bool checkExtrapolator () const
 
bool checkGeometry () const
 
TrajectoryStateOnSurface stateOnSurface (const std::vector< double > &weights, const std::vector< ParameterVector > &parameters, const std::vector< CovarianceMatrix > &covariances, const double &pzSign, const Surface &surface, const MagneticField *field) const
 

Private Attributes

TransverseImpactPointExtrapolatorextrapolator_
 
const MagneticFieldfield_
 
const TrackingGeometrygeometry_
 

Detailed Description

Definition at line 18 of file MultiTrajectoryStateTransform.h.

Member Typedef Documentation

Definition at line 21 of file MultiTrajectoryStateTransform.h.

Definition at line 20 of file MultiTrajectoryStateTransform.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

MultiTrajectoryStateTransform::MultiTrajectoryStateTransform ( )
inline

Default constructor (deprecated) -> ES components have to be passed explicitely

Definition at line 27 of file MultiTrajectoryStateTransform.h.

27  :
28  geometry_(0), field_(0), extrapolator_(0) {}
TransverseImpactPointExtrapolator * extrapolator_
MultiTrajectoryStateTransform::MultiTrajectoryStateTransform ( const TrackingGeometry geom,
const MagneticField field 
)
inline

Constructor from geometry and magnetic field

Definition at line 30 of file MultiTrajectoryStateTransform.h.

30  :
31  geometry_(geom), field_(field), extrapolator_(0) {}
TransverseImpactPointExtrapolator * extrapolator_
MultiTrajectoryStateTransform::~MultiTrajectoryStateTransform ( )

Destructor

Definition at line 17 of file MultiTrajectoryStateTransform.cc.

References extrapolator_.

17 {delete extrapolator_;}
TransverseImpactPointExtrapolator * extrapolator_

Member Function Documentation

bool MultiTrajectoryStateTransform::checkExtrapolator ( ) const
private

On-demand creation of a TransverseImpactPointExtrapolator

Definition at line 127 of file MultiTrajectoryStateTransform.cc.

References AnalyticalPropagator_cfi::AnalyticalPropagator, anyDirection, extrapolator_, and field_.

Referenced by extrapolatedState().

128 {
129  if ( extrapolator_ ) return true;
130 
131  if ( field_==0 ) {
132  edm::LogError("MultiTrajectoryStateTransform") << "Missing magnetic field";
133  return false;
134  }
135 
138  return true;
139 }
TransverseImpactPointExtrapolator * extrapolator_
bool MultiTrajectoryStateTransform::checkGeometry ( ) const
private

Verification of the presence of geometry and field

Definition at line 111 of file MultiTrajectoryStateTransform.cc.

References field_, and geometry_.

Referenced by innerStateOnSurface(), and outerStateOnSurface().

112 {
113  if ( geometry_ && field_ ) return true;
114 
115  edm::LogError("MultiTrajectoryStateTransform") << "Missing ES components";
116  return false;
117 }
TrajectoryStateOnSurface MultiTrajectoryStateTransform::extrapolatedState ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint point 
) const

Extrapolation to a point using the TransverseImpactPointExtrapolator

Definition at line 120 of file MultiTrajectoryStateTransform.cc.

References checkExtrapolator(), TransverseImpactPointExtrapolator::extrapolate(), and extrapolator_.

Referenced by GsfElectronAlgo::ElectronData::calculateTSOS(), GsfElectronAlgo::ElectronData::getEleBasicCluster(), and EgammaHLTPixelMatchElectronAlgo::process().

122 {
124 }
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
TransverseImpactPointExtrapolator * extrapolator_
bool MultiTrajectoryStateTransform::innerMomentumFromMode ( const reco::GsfTrack tk,
GlobalVector momentum 
) const

Momentum vector from mode corresponding to the innermost state. Returns true for success.

Definition at line 39 of file MultiTrajectoryStateTransform.cc.

References MultiTrajectoryStateMode::momentumFromModeCartesian(), and outerStateOnSurface().

41 {
43 }
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface MultiTrajectoryStateTransform::innerStateOnSurface ( const reco::GsfTrack tk) const
TrajectoryStateOnSurface MultiTrajectoryStateTransform::innerStateOnSurface ( const reco::GsfTrack tk,
const TrackingGeometry geom,
const MagneticField field 
) const

TrajectoryStateOnSurface from the innermost state of a reco::GsfTrack passing geometry and magnetic field (deprecated: use field from constructor)

Definition at line 61 of file MultiTrajectoryStateTransform.cc.

References reco::Track::extra(), statics::field, reco::GsfTrack::gsfExtra(), TrackingGeometry::idToDet(), stateOnSurface(), and GeomDet::surface().

64 {
65  const Surface& surface = geom.idToDet( DetId( tk.extra()->innerDetId()))->surface();
66 
67  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
68  return stateOnSurface(extra->innerStateWeights(),
69  extra->innerStateLocalParameters(),
70  extra->innerStateCovariances(),
71  extra->innerStateLocalPzSign(),
72  surface,field);
73 }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:96
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
tuple field
Definition: statics.py:62
TrajectoryStateOnSurface stateOnSurface(const std::vector< double > &weights, const std::vector< ParameterVector > &parameters, const std::vector< CovarianceMatrix > &covariances, const double &pzSign, const Surface &surface, const MagneticField *field) const
Definition: DetId.h:18
const GsfTrackExtraRef & gsfExtra() const
reference to &quot;extra&quot; object
Definition: GsfTrack.h:31
virtual const GeomDet * idToDet(DetId) const =0
bool MultiTrajectoryStateTransform::outerMomentumFromMode ( const reco::GsfTrack tk,
GlobalVector momentum 
) const

Momentum vector from mode corresponding to the outermost state

Definition at line 32 of file MultiTrajectoryStateTransform.cc.

References MultiTrajectoryStateMode::momentumFromModeCartesian(), and outerStateOnSurface().

34 {
36 }
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface MultiTrajectoryStateTransform::outerStateOnSurface ( const reco::GsfTrack tk) const
TrajectoryStateOnSurface MultiTrajectoryStateTransform::outerStateOnSurface ( const reco::GsfTrack tk,
const TrackingGeometry geom,
const MagneticField field 
) const

TrajectoryStateOnSurface from the outermost state of a reco::GsfTrack passing geometry and magnetic field (deprecated: use field from constructor)

Definition at line 46 of file MultiTrajectoryStateTransform.cc.

References reco::Track::extra(), statics::field, reco::GsfTrack::gsfExtra(), TrackingGeometry::idToDet(), stateOnSurface(), and GeomDet::surface().

49 {
50  const Surface& surface = geom.idToDet( DetId( tk.extra()->outerDetId()))->surface();
51 
52  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
53  return stateOnSurface(extra->outerStateWeights(),
54  extra->outerStateLocalParameters(),
55  extra->outerStateCovariances(),
56  extra->outerStateLocalPzSign(),
57  surface,field);
58 }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:96
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
tuple field
Definition: statics.py:62
TrajectoryStateOnSurface stateOnSurface(const std::vector< double > &weights, const std::vector< ParameterVector > &parameters, const std::vector< CovarianceMatrix > &covariances, const double &pzSign, const Surface &surface, const MagneticField *field) const
Definition: DetId.h:18
const GsfTrackExtraRef & gsfExtra() const
reference to &quot;extra&quot; object
Definition: GsfTrack.h:31
virtual const GeomDet * idToDet(DetId) const =0
TrajectoryStateOnSurface MultiTrajectoryStateTransform::stateOnSurface ( const std::vector< double > &  weights,
const std::vector< ParameterVector > &  parameters,
const std::vector< CovarianceMatrix > &  covariances,
const double &  pzSign,
const Surface surface,
const MagneticField field 
) const
private

TSOS from a mixture in local parameters

Definition at line 76 of file MultiTrajectoryStateTransform.cc.

References makeMuonMisalignmentScenario::components, dimension, i, and asciidump::le.

Referenced by innerStateOnSurface(), and outerStateOnSurface().

82 {
83  if ( weights.empty() ) return TrajectoryStateOnSurface();
84 
85  unsigned int nc(weights.size());
86  AlgebraicVector5 pars;
88 
89  std::vector<TrajectoryStateOnSurface> components;
90  components.reserve(nc);
91 
92  // create components TSOSs
93  for ( unsigned int i=0; i<nc; i++ ) {
94  // convert parameter vector and covariance matrix
95  for ( unsigned int j1=0; j1<dimension; j1++ ) {
96  pars[j1] = parameters[i](j1);
97  for ( unsigned int j2=0; j2<=j1; j2++ )
98  cov(j1,j2) = covariances[i](j1,j2); //FIXME: SMatrix copy constructor should handle this!!
99  }
100  // create local parameters & errors
101  LocalTrajectoryParameters lp(pars,pzSign);
103  // create component
104  components.push_back(TrajectoryStateOnSurface(lp,le,surface,field,weights[i]));
105  }
106  return
107  TrajectoryStateOnSurface(new BasicMultiTrajectoryState(components));
108 }
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
ROOT::Math::SVector< double, 5 > AlgebraicVector5

Member Data Documentation

TransverseImpactPointExtrapolator* MultiTrajectoryStateTransform::extrapolator_
mutableprivate
const MagneticField* MultiTrajectoryStateTransform::field_
private
const TrackingGeometry* MultiTrajectoryStateTransform::geometry_
private