CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
TwoBodyDecayTrajectoryState Class Reference

#include <TwoBodyDecayTrajectoryState.h>

Public Types

typedef std::pair
< AlgebraicMatrix,
AlgebraicMatrix
Derivatives
 
typedef std::pair
< TrajectoryStateOnSurface,
TrajectoryStateOnSurface
TsosContainer
 

Public Member Functions

const TwoBodyDecayParametersdecayParameters (void) const
 
const Derivativesderivatives (void) const
 
bool isValid (void) const
 
double particleMass (void) const
 
double primaryMass (void) const
 
double primaryWidth (void) const
 
void rescaleError (double scale)
 
const TsosContainertrajectoryStates (bool useRefittedState=true) const
 
 TwoBodyDecayTrajectoryState (const TsosContainer &tsos, const TwoBodyDecay &tbd, double particleMass, const MagneticField *magField, bool propagateErrors=false)
 
 ~TwoBodyDecayTrajectoryState (void)
 

Private Member Functions

void construct (const MagneticField *magField, bool propagateErrors)
 
bool propagateSingleState (const FreeTrajectoryState &fts, const GlobalTrajectoryParameters &gtp, const AlgebraicMatrix &startDeriv, const Surface &surface, const MagneticField *magField, TrajectoryStateOnSurface &tsos, AlgebraicMatrix &endDeriv) const
 
void setError (FreeTrajectoryState &fts, AlgebraicMatrix &derivative) const
 

Private Attributes

Derivatives theDerivatives
 
TsosContainer theOriginalTsos
 
TwoBodyDecayParameters theParameters
 
double theParticleMass
 
double thePrimaryMass
 
double thePrimaryWidth
 
TsosContainer theRefittedTsos
 
bool theValidityFlag
 

Static Private Attributes

static const unsigned int nDecayParam = TwoBodyDecayParameters::dimension
 
static const unsigned int nLocalParam = 5
 

Detailed Description

Definition at line 13 of file TwoBodyDecayTrajectoryState.h.

Member Typedef Documentation

Definition at line 19 of file TwoBodyDecayTrajectoryState.h.

Definition at line 18 of file TwoBodyDecayTrajectoryState.h.

Constructor & Destructor Documentation

TwoBodyDecayTrajectoryState::TwoBodyDecayTrajectoryState ( const TsosContainer tsos,
const TwoBodyDecay tbd,
double  particleMass,
const MagneticField magField,
bool  propagateErrors = false 
)

The constructor takes the two trajectory states that are to be updated (typically the innermost trajectory states of two tracks) and the decay parameters.

Definition at line 21 of file TwoBodyDecayTrajectoryState.cc.

References construct().

26  : theValidityFlag( false ),
30  theOriginalTsos( tsos ),
31  thePrimaryMass( tbd.primaryMass() ),
33 {
34  construct( magField, propagateErrors );
35 }
static const unsigned int nDecayParam
double primaryMass(void) const
Definition: TwoBodyDecay.h:52
CLHEP::HepMatrix AlgebraicMatrix
double primaryWidth(void) const
Definition: TwoBodyDecay.h:53
static const unsigned int nLocalParam
void construct(const MagneticField *magField, bool propagateErrors)
const TwoBodyDecayParameters & decayParameters(void) const
Definition: TwoBodyDecay.h:34
TwoBodyDecayTrajectoryState::~TwoBodyDecayTrajectoryState ( void  )
inline

Definition at line 30 of file TwoBodyDecayTrajectoryState.h.

30 {}

Member Function Documentation

void TwoBodyDecayTrajectoryState::construct ( const MagneticField magField,
bool  propagateErrors 
)
private

Definition at line 47 of file TwoBodyDecayTrajectoryState.cc.

References TwoBodyDecayModel::cartesianSecondaryMomenta(), TwoBodyDecayDerivatives::derivatives(), derivatives(), TwoBodyDecayParameters::mass, p1, p2, propagateSingleState(), setError(), theDerivatives, theOriginalTsos, theParameters, theParticleMass, theRefittedTsos, theValidityFlag, TwoBodyDecayParameters::x, TwoBodyDecayParameters::y, and TwoBodyDecayParameters::z.

Referenced by TwoBodyDecayTrajectoryState().

49 {
50  // construct global trajectory parameters at the starting point
52  pair< AlgebraicVector, AlgebraicVector > secondaryMomenta = tbdDecayModel.cartesianSecondaryMomenta( theParameters );
53 
57 
58  GlobalVector p1( secondaryMomenta.first[0],
59  secondaryMomenta.first[1],
60  secondaryMomenta.first[2] );
61 
62  GlobalVector p2( secondaryMomenta.second[0],
63  secondaryMomenta.second[1],
64  secondaryMomenta.second[2] );
65 
66  GlobalTrajectoryParameters gtp1( vtx, p1, theOriginalTsos.first.charge(), magField );
67  FreeTrajectoryState fts1( gtp1 );
68 
69  GlobalTrajectoryParameters gtp2( vtx, p2, theOriginalTsos.second.charge(), magField );
70  FreeTrajectoryState fts2( gtp2 );
71 
72  // contruct derivatives at the starting point
74  pair< AlgebraicMatrix, AlgebraicMatrix > derivatives = tbdDerivatives.derivatives( theParameters );
75 
76  AlgebraicMatrix deriv1( 6, 9, 0 );
77  deriv1.sub( 1, 1, AlgebraicMatrix( 3, 3, 1 ) );
78  deriv1.sub( 4, 4, derivatives.first );
79 
80  AlgebraicMatrix deriv2( 6, 9, 0 );
81  deriv2.sub( 1, 1, AlgebraicMatrix( 3, 3, 1 ) );
82  deriv2.sub( 4, 4, derivatives.second );
83 
84  // compute errors of initial states
85  if ( propagateErrors ) {
86  setError( fts1, deriv1 );
87  setError( fts2, deriv2 );
88  }
89 
90 
91  // propgate states and derivatives from the starting points to the end points
92  bool valid1 = propagateSingleState( fts1, gtp1, deriv1, theOriginalTsos.first.surface(),
93  magField, theRefittedTsos.first, theDerivatives.first );
94 
95  bool valid2 = propagateSingleState( fts2, gtp2, deriv2, theOriginalTsos.second.surface(),
96  magField, theRefittedTsos.second, theDerivatives.second );
97 
98  theValidityFlag = valid1 && valid2;
99 
100  return;
101 }
const Derivatives & derivatives(void) const
CLHEP::HepMatrix AlgebraicMatrix
void setError(FreeTrajectoryState &fts, AlgebraicMatrix &derivative) const
bool propagateSingleState(const FreeTrajectoryState &fts, const GlobalTrajectoryParameters &gtp, const AlgebraicMatrix &startDeriv, const Surface &surface, const MagneticField *magField, TrajectoryStateOnSurface &tsos, AlgebraicMatrix &endDeriv) const
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
const TwoBodyDecayParameters& TwoBodyDecayTrajectoryState::decayParameters ( void  ) const
inline

Definition at line 35 of file TwoBodyDecayTrajectoryState.h.

References theParameters.

Referenced by TwoBodyDecayTrajectory::construct().

35 { return theParameters; }
const Derivatives& TwoBodyDecayTrajectoryState::derivatives ( void  ) const
inline

Definition at line 37 of file TwoBodyDecayTrajectoryState.h.

References theDerivatives.

Referenced by TwoBodyDecayTrajectory::construct(), and construct().

bool TwoBodyDecayTrajectoryState::isValid ( void  ) const
inline
double TwoBodyDecayTrajectoryState::particleMass ( void  ) const
inline
double TwoBodyDecayTrajectoryState::primaryMass ( void  ) const
inline
double TwoBodyDecayTrajectoryState::primaryWidth ( void  ) const
inline
bool TwoBodyDecayTrajectoryState::propagateSingleState ( const FreeTrajectoryState fts,
const GlobalTrajectoryParameters gtp,
const AlgebraicMatrix startDeriv,
const Surface surface,
const MagneticField magField,
TrajectoryStateOnSurface tsos,
AlgebraicMatrix endDeriv 
) const
private

Definition at line 104 of file TwoBodyDecayTrajectoryState.cc.

References AnalyticalPropagator_cfi::AnalyticalPropagator, asHepMatrix(), JacobianCartesianToCurvilinear::jacobian(), JacobianCurvilinearToLocal::jacobian(), AnalyticalCurvilinearJacobian::jacobian(), and HLT_25ns10e33_v2_cff::propagator.

Referenced by construct().

111 {
112  AnalyticalPropagator propagator( magField );
113 
114  // propagate state
115  pair< TrajectoryStateOnSurface, double > tsosWithPath = propagator.propagateWithPath( fts, surface );
116 
117  // check if propagation was successful
118  if ( !tsosWithPath.first.isValid() ) return false;
119 
120  // jacobian for transformation from cartesian to curvilinear frame at the starting point
121  JacobianCartesianToCurvilinear cartToCurv( gtp );
122  const AlgebraicMatrix56& matCartToCurv = cartToCurv.jacobian();
123 
124  // jacobian in curvilinear frame for propagation from the starting point to the end point
125  AnalyticalCurvilinearJacobian curvJac( gtp, tsosWithPath.first.globalPosition(),
126  tsosWithPath.first.globalMomentum(),
127  tsosWithPath.second );
128  const AlgebraicMatrix55& matCurvJac = curvJac.jacobian();
129 
130  // jacobian for transformation from curvilinear to local frame at the end point
131  JacobianCurvilinearToLocal curvToLoc( surface, tsosWithPath.first.localParameters(), *magField );
132  const AlgebraicMatrix55& matCurvToLoc = curvToLoc.jacobian();
133 
134  AlgebraicMatrix56 tmpDeriv = matCurvToLoc*matCurvJac*matCartToCurv;
135  AlgebraicMatrix hepMatDeriv( asHepMatrix( tmpDeriv ) );
136  //AlgebraicMatrix hepMatDeriv = asHepMatrix< 5, 6 >( tmpDeriv );
137 
138  // replace original state with new state
139  tsos = tsosWithPath.first;
140 
141  // propagate derivative matrix
142  endDeriv = hepMatDeriv*startDeriv;
143 
144  return true;
145 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:49
ROOT::Math::SMatrix< double, 5, 6, ROOT::Math::MatRepStd< double, 5, 6 > > AlgebraicMatrix56
const AlgebraicMatrix55 & jacobian() const
CLHEP::HepMatrix AlgebraicMatrix
const AlgebraicMatrix55 & jacobian() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
void TwoBodyDecayTrajectoryState::rescaleError ( double  scale)

Definition at line 38 of file TwoBodyDecayTrajectoryState.cc.

References theOriginalTsos, and theRefittedTsos.

39 {
40  theOriginalTsos.first.rescaleError( scale );
41  theOriginalTsos.second.rescaleError( scale );
42  theRefittedTsos.first.rescaleError( scale );
43  theRefittedTsos.second.rescaleError( scale );
44 }
void TwoBodyDecayTrajectoryState::setError ( FreeTrajectoryState fts,
AlgebraicMatrix derivative 
) const
private

Definition at line 148 of file TwoBodyDecayTrajectoryState.cc.

References TwoBodyDecayParameters::covariance(), FreeTrajectoryState::setCartesianError(), and theParameters.

Referenced by construct().

150 {
151  AlgebraicSymMatrix ftsCartesianError( theParameters.covariance().similarity( derivative ) );
152  fts.setCartesianError( asSMatrix<6>( ftsCartesianError ) );
153 }
Derivative< X, A >::type derivative(const A &_)
Definition: Derivative.h:18
void setCartesianError(const CartesianTrajectoryError &err)
const AlgebraicSymMatrix & covariance(void) const
Get error matrix.
CLHEP::HepSymMatrix AlgebraicSymMatrix
const TsosContainer& TwoBodyDecayTrajectoryState::trajectoryStates ( bool  useRefittedState = true) const
inline

Member Data Documentation

const unsigned int TwoBodyDecayTrajectoryState::nDecayParam = TwoBodyDecayParameters::dimension
staticprivate

Definition at line 74 of file TwoBodyDecayTrajectoryState.h.

const unsigned int TwoBodyDecayTrajectoryState::nLocalParam = 5
staticprivate

Definition at line 73 of file TwoBodyDecayTrajectoryState.h.

Derivatives TwoBodyDecayTrajectoryState::theDerivatives
private

Definition at line 66 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and derivatives().

TsosContainer TwoBodyDecayTrajectoryState::theOriginalTsos
private

Definition at line 67 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), rescaleError(), and trajectoryStates().

TwoBodyDecayParameters TwoBodyDecayTrajectoryState::theParameters
private

Definition at line 65 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), decayParameters(), and setError().

double TwoBodyDecayTrajectoryState::theParticleMass
private

Definition at line 63 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and particleMass().

double TwoBodyDecayTrajectoryState::thePrimaryMass
private

Definition at line 70 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryMass().

double TwoBodyDecayTrajectoryState::thePrimaryWidth
private

Definition at line 71 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryWidth().

TsosContainer TwoBodyDecayTrajectoryState::theRefittedTsos
private

Definition at line 68 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), rescaleError(), and trajectoryStates().

bool TwoBodyDecayTrajectoryState::theValidityFlag
private

Definition at line 61 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and isValid().