CMS 3D CMS Logo

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, AlgebraicMatrixDerivatives
 
typedef std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurfaceTsosContainer
 

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 12 of file TwoBodyDecayTrajectoryState.h.

Member Typedef Documentation

Definition at line 15 of file TwoBodyDecayTrajectoryState.h.

Definition at line 14 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 20 of file TwoBodyDecayTrajectoryState.cc.

References construct().

25  : theValidityFlag(false),
29  theOriginalTsos(tsos),
32  construct(magField, propagateErrors);
33 }
static const unsigned int nDecayParam
double primaryMass(void) const
Definition: TwoBodyDecay.h:49
CLHEP::HepMatrix AlgebraicMatrix
double primaryWidth(void) const
Definition: TwoBodyDecay.h:50
static const unsigned int nLocalParam
void construct(const MagneticField *magField, bool propagateErrors)
const TwoBodyDecayParameters & decayParameters(void) const
Definition: TwoBodyDecay.h:31
TwoBodyDecayTrajectoryState::~TwoBodyDecayTrajectoryState ( void  )
inline

Definition at line 26 of file TwoBodyDecayTrajectoryState.h.

26 {}

Member Function Documentation

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

Definition at line 42 of file TwoBodyDecayTrajectoryState.cc.

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

Referenced by primaryWidth(), and TwoBodyDecayTrajectoryState().

42  {
43  // construct global trajectory parameters at the starting point
45  pair<AlgebraicVector, AlgebraicVector> secondaryMomenta = tbdDecayModel.cartesianSecondaryMomenta(theParameters);
46 
50 
51  GlobalVector p1(secondaryMomenta.first[0], secondaryMomenta.first[1], secondaryMomenta.first[2]);
52 
53  GlobalVector p2(secondaryMomenta.second[0], secondaryMomenta.second[1], secondaryMomenta.second[2]);
54 
55  GlobalTrajectoryParameters gtp1(vtx, p1, theOriginalTsos.first.charge(), magField);
56  FreeTrajectoryState fts1(gtp1);
57 
58  GlobalTrajectoryParameters gtp2(vtx, p2, theOriginalTsos.second.charge(), magField);
59  FreeTrajectoryState fts2(gtp2);
60 
61  // contruct derivatives at the starting point
63  pair<AlgebraicMatrix, AlgebraicMatrix> derivatives = tbdDerivatives.derivatives(theParameters);
64 
65  AlgebraicMatrix deriv1(6, 9, 0);
66  deriv1.sub(1, 1, AlgebraicMatrix(3, 3, 1));
67  deriv1.sub(4, 4, derivatives.first);
68 
69  AlgebraicMatrix deriv2(6, 9, 0);
70  deriv2.sub(1, 1, AlgebraicMatrix(3, 3, 1));
71  deriv2.sub(4, 4, derivatives.second);
72 
73  // compute errors of initial states
74  if (propagateErrors) {
75  setError(fts1, deriv1);
76  setError(fts2, deriv2);
77  }
78 
79  // propgate states and derivatives from the starting points to the end points
80  bool valid1 = propagateSingleState(
81  fts1, gtp1, deriv1, theOriginalTsos.first.surface(), magField, theRefittedTsos.first, theDerivatives.first);
82 
83  bool valid2 = propagateSingleState(
84  fts2, gtp2, deriv2, theOriginalTsos.second.surface(), magField, theRefittedTsos.second, theDerivatives.second);
85 
86  theValidityFlag = valid1 && valid2;
87 
88  return;
89 }
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 31 of file TwoBodyDecayTrajectoryState.h.

References theParameters.

Referenced by TwoBodyDecayTrajectory::construct().

31 { return theParameters; }
const Derivatives& TwoBodyDecayTrajectoryState::derivatives ( void  ) const
inline
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 91 of file TwoBodyDecayTrajectoryState.cc.

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

Referenced by construct(), and primaryWidth().

97  {
99 
100  // propagate state
101  pair<TrajectoryStateOnSurface, double> tsosWithPath = propagator.propagateWithPath(fts, surface);
102 
103  // check if propagation was successful
104  if (!tsosWithPath.first.isValid())
105  return false;
106 
107  // jacobian for transformation from cartesian to curvilinear frame at the starting point
108  JacobianCartesianToCurvilinear cartToCurv(gtp);
109  const AlgebraicMatrix56& matCartToCurv = cartToCurv.jacobian();
110 
111  // jacobian in curvilinear frame for propagation from the starting point to the end point
113  gtp, tsosWithPath.first.globalPosition(), tsosWithPath.first.globalMomentum(), tsosWithPath.second);
114  const AlgebraicMatrix55& matCurvJac = curvJac.jacobian();
115 
116  // jacobian for transformation from curvilinear to local frame at the end point
117  JacobianCurvilinearToLocal curvToLoc(surface, tsosWithPath.first.localParameters(), *magField);
118  const AlgebraicMatrix55& matCurvToLoc = curvToLoc.jacobian();
119 
120  AlgebraicMatrix56 tmpDeriv = matCurvToLoc * matCurvJac * matCartToCurv;
121  AlgebraicMatrix hepMatDeriv(asHepMatrix(tmpDeriv));
122  //AlgebraicMatrix hepMatDeriv = asHepMatrix< 5, 6 >( tmpDeriv );
123 
124  // replace original state with new state
125  tsos = tsosWithPath.first;
126 
127  // propagate derivative matrix
128  endDeriv = hepMatDeriv * startDeriv;
129 
130  return true;
131 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:54
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 35 of file TwoBodyDecayTrajectoryState.cc.

References theOriginalTsos, and theRefittedTsos.

Referenced by derivatives().

35  {
36  theOriginalTsos.first.rescaleError(scale);
37  theOriginalTsos.second.rescaleError(scale);
38  theRefittedTsos.first.rescaleError(scale);
39  theRefittedTsos.second.rescaleError(scale);
40 }
void TwoBodyDecayTrajectoryState::setError ( FreeTrajectoryState fts,
AlgebraicMatrix derivative 
) const
private

Definition at line 133 of file TwoBodyDecayTrajectoryState.cc.

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

Referenced by construct(), and primaryWidth().

133  {
134  AlgebraicSymMatrix ftsCartesianError(theParameters.covariance().similarity(derivative));
135  fts.setCartesianError(asSMatrix<6>(ftsCartesianError));
136 }
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 68 of file TwoBodyDecayTrajectoryState.h.

const unsigned int TwoBodyDecayTrajectoryState::nLocalParam = 5
staticprivate

Definition at line 67 of file TwoBodyDecayTrajectoryState.h.

Derivatives TwoBodyDecayTrajectoryState::theDerivatives
private

Definition at line 60 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and derivatives().

TsosContainer TwoBodyDecayTrajectoryState::theOriginalTsos
private

Definition at line 61 of file TwoBodyDecayTrajectoryState.h.

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

TwoBodyDecayParameters TwoBodyDecayTrajectoryState::theParameters
private

Definition at line 59 of file TwoBodyDecayTrajectoryState.h.

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

double TwoBodyDecayTrajectoryState::theParticleMass
private

Definition at line 57 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and particleMass().

double TwoBodyDecayTrajectoryState::thePrimaryMass
private

Definition at line 64 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryMass().

double TwoBodyDecayTrajectoryState::thePrimaryWidth
private

Definition at line 65 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryWidth().

TsosContainer TwoBodyDecayTrajectoryState::theRefittedTsos
private

Definition at line 62 of file TwoBodyDecayTrajectoryState.h.

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

bool TwoBodyDecayTrajectoryState::theValidityFlag
private

Definition at line 55 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and isValid().