CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static 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
 
 MultiTrajectoryStateTransform ()
 
 MultiTrajectoryStateTransform (const TrackingGeometry *geom, const MagneticField *field)
 
bool outerMomentumFromMode (const reco::GsfTrack &tk, GlobalVector &momentum) const
 
TrajectoryStateOnSurface outerStateOnSurface (const reco::GsfTrack &tk) const
 
 ~MultiTrajectoryStateTransform ()
 

Static Public Member Functions

static TrajectoryStateOnSurface innerStateOnSurface (const reco::GsfTrack &tk, const TrackingGeometry &geom, const MagneticField *field)
 
static TrajectoryStateOnSurface outerStateOnSurface (const reco::GsfTrack &tk, const TrackingGeometry &geom, const MagneticField *field)
 

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
 

Static Private Member Functions

static 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)
 

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 26 of file MultiTrajectoryStateTransform.h.

26 : geometry_(nullptr), field_(nullptr), extrapolator_(nullptr) {}
TransverseImpactPointExtrapolator * extrapolator_
MultiTrajectoryStateTransform::MultiTrajectoryStateTransform ( const TrackingGeometry geom,
const MagneticField field 
)
inline

Constructor from geometry and magnetic field

Definition at line 28 of file MultiTrajectoryStateTransform.h.

29  : geometry_(geom), field_(field), extrapolator_(nullptr) {}
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 109 of file MultiTrajectoryStateTransform.cc.

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

Referenced by extrapolatedState().

109  {
110  if (extrapolator_)
111  return true;
112 
113  if (field_ == nullptr) {
114  edm::LogError("MultiTrajectoryStateTransform") << "Missing magnetic field";
115  return false;
116  }
117 
120  return true;
121 }
Log< level::Error, false > LogError
TransverseImpactPointExtrapolator * extrapolator_
bool MultiTrajectoryStateTransform::checkGeometry ( ) const
private

Verification of the presence of geometry and field

Definition at line 96 of file MultiTrajectoryStateTransform.cc.

References field_, and geometry_.

Referenced by innerStateOnSurface(), and outerStateOnSurface().

96  {
97  if (geometry_ && field_)
98  return true;
99 
100  edm::LogError("MultiTrajectoryStateTransform") << "Missing ES components";
101  return false;
102 }
Log< level::Error, false > LogError
TrajectoryStateOnSurface MultiTrajectoryStateTransform::extrapolatedState ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint point 
) const

Extrapolation to a point using the TransverseImpactPointExtrapolator

Definition at line 104 of file MultiTrajectoryStateTransform.cc.

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

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

105  {
107 }
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 31 of file MultiTrajectoryStateTransform.cc.

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

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

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

Definition at line 49 of file MultiTrajectoryStateTransform.cc.

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

51  {
52  const Surface& surface = geom.idToDet(DetId(tk.extra()->innerDetId()))->surface();
53 
54  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
55  return stateOnSurface(extra->innerStateWeights(),
56  extra->innerStateLocalParameters(),
57  extra->innerStateCovariances(),
58  extra->innerStateLocalPzSign(),
59  surface,
60  field);
61 }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: DetId.h:17
const GsfTrackExtraRef & gsfExtra() const
reference to &quot;extra&quot; object
Definition: GsfTrack.h:31
virtual const GeomDet * idToDet(DetId) const =0
static 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)
bool MultiTrajectoryStateTransform::outerMomentumFromMode ( const reco::GsfTrack tk,
GlobalVector momentum 
) const

Momentum vector from mode corresponding to the outermost state

Definition at line 27 of file MultiTrajectoryStateTransform.cc.

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

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

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

Definition at line 35 of file MultiTrajectoryStateTransform.cc.

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

37  {
38  const Surface& surface = geom.idToDet(DetId(tk.extra()->outerDetId()))->surface();
39 
40  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
41  return stateOnSurface(extra->outerStateWeights(),
42  extra->outerStateLocalParameters(),
43  extra->outerStateCovariances(),
44  extra->outerStateLocalPzSign(),
45  surface,
46  field);
47 }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: DetId.h:17
const GsfTrackExtraRef & gsfExtra() const
reference to &quot;extra&quot; object
Definition: GsfTrack.h:31
virtual const GeomDet * idToDet(DetId) const =0
static 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)
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 
)
staticprivate

TSOS from a mixture in local parameters

Definition at line 63 of file MultiTrajectoryStateTransform.cc.

References makeMuonMisalignmentScenario::components, dimension, and mps_fire::i.

Referenced by innerStateOnSurface(), and outerStateOnSurface().

68  {
69  if (weights.empty())
70  return TrajectoryStateOnSurface();
71 
72  unsigned int nc(weights.size());
73  AlgebraicVector5 pars;
75 
76  std::vector<TrajectoryStateOnSurface> components;
77  components.reserve(nc);
78 
79  // create components TSOSs
80  for (unsigned int i = 0; i < nc; i++) {
81  // convert parameter vector and covariance matrix
82  for (unsigned int j1 = 0; j1 < dimension; j1++) {
83  pars[j1] = parameters[i](j1);
84  for (unsigned int j2 = 0; j2 <= j1; j2++)
85  cov(j1, j2) = covariances[i](j1, j2); //FIXME: SMatrix copy constructor should handle this!!
86  }
87  // create local parameters & errors
88  LocalTrajectoryParameters lp(pars, pzSign);
89  LocalTrajectoryError le(cov);
90  // create component
91  components.push_back(TrajectoryStateOnSurface(weights[i], lp, le, surface, field));
92  }
94 }
ROOT::Math::SVector< double, 5 > AlgebraicVector5
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55

Member Data Documentation

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