CMS 3D CMS Logo

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

◆ CovarianceMatrix

Definition at line 21 of file MultiTrajectoryStateTransform.h.

◆ ParameterVector

Definition at line 20 of file MultiTrajectoryStateTransform.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ MultiTrajectoryStateTransform() [1/2]

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() [2/2]

MultiTrajectoryStateTransform::MultiTrajectoryStateTransform ( const TrackingGeometry geom,
const MagneticField field 
)
inline

Constructor from geometry and magnetic field

Definition at line 28 of file MultiTrajectoryStateTransform.h.

◆ ~MultiTrajectoryStateTransform()

MultiTrajectoryStateTransform::~MultiTrajectoryStateTransform ( )

Destructor

Definition at line 17 of file MultiTrajectoryStateTransform.cc.

References extrapolator_.

17 { delete extrapolator_; }
TransverseImpactPointExtrapolator * extrapolator_

Member Function Documentation

◆ checkExtrapolator()

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_

◆ checkGeometry()

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

◆ extrapolatedState()

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(), extrapolator_, and point.

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
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
TransverseImpactPointExtrapolator * extrapolator_

◆ innerMomentumFromMode()

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)

◆ innerStateOnSurface() [1/2]

TrajectoryStateOnSurface MultiTrajectoryStateTransform::innerStateOnSurface ( const reco::GsfTrack tk) const

◆ innerStateOnSurface() [2/2]

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(), relativeConstraints::geom, reco::GsfTrack::gsfExtra(), and stateOnSurface().

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 }
Definition: DetId.h:17
const GsfTrackExtraRef & gsfExtra() const
reference to "extra" object
Definition: GsfTrack.h:31
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)
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ outerMomentumFromMode()

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)

◆ outerStateOnSurface() [1/2]

TrajectoryStateOnSurface MultiTrajectoryStateTransform::outerStateOnSurface ( const reco::GsfTrack tk) const

◆ outerStateOnSurface() [2/2]

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(), relativeConstraints::geom, reco::GsfTrack::gsfExtra(), and stateOnSurface().

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 }
Definition: DetId.h:17
const GsfTrackExtraRef & gsfExtra() const
reference to "extra" object
Definition: GsfTrack.h:31
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)
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ stateOnSurface()

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, mps_fire::i, and hltDeepSecondaryVertexTagInfosPFPuppi_cfi::weights.

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

◆ extrapolator_

TransverseImpactPointExtrapolator* MultiTrajectoryStateTransform::extrapolator_
mutableprivate

◆ field_

const MagneticField* MultiTrajectoryStateTransform::field_
private

◆ geometry_

const TrackingGeometry* MultiTrajectoryStateTransform::geometry_
private