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

◆ Derivatives

Definition at line 15 of file TwoBodyDecayTrajectoryState.h.

◆ TsosContainer

Definition at line 14 of file TwoBodyDecayTrajectoryState.h.

Constructor & Destructor Documentation

◆ TwoBodyDecayTrajectoryState()

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().

◆ ~TwoBodyDecayTrajectoryState()

TwoBodyDecayTrajectoryState::~TwoBodyDecayTrajectoryState ( void  )
inline

Definition at line 26 of file TwoBodyDecayTrajectoryState.h.

26 {}

Member Function Documentation

◆ construct()

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

Definition at line 42 of file TwoBodyDecayTrajectoryState.cc.

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 }

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

Referenced by TwoBodyDecayTrajectoryState().

◆ decayParameters()

const TwoBodyDecayParameters& TwoBodyDecayTrajectoryState::decayParameters ( void  ) const
inline

Definition at line 31 of file TwoBodyDecayTrajectoryState.h.

31 { return theParameters; }

References theParameters.

Referenced by TwoBodyDecayTrajectory::construct().

◆ derivatives()

const Derivatives& TwoBodyDecayTrajectoryState::derivatives ( void  ) const
inline

Definition at line 35 of file TwoBodyDecayTrajectoryState.h.

35 { return theDerivatives; }

References theDerivatives.

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

◆ isValid()

bool TwoBodyDecayTrajectoryState::isValid ( void  ) const
inline

◆ particleMass()

double TwoBodyDecayTrajectoryState::particleMass ( void  ) const
inline

Definition at line 30 of file TwoBodyDecayTrajectoryState.h.

30 { return theParticleMass; }

References theParticleMass.

Referenced by TwoBodyDecayTrajectory::construct().

◆ primaryMass()

double TwoBodyDecayTrajectoryState::primaryMass ( void  ) const
inline

Definition at line 39 of file TwoBodyDecayTrajectoryState.h.

39 { return thePrimaryMass; }

References thePrimaryMass.

Referenced by TwoBodyDecayTrajectory::construct().

◆ primaryWidth()

double TwoBodyDecayTrajectoryState::primaryWidth ( void  ) const
inline

Definition at line 40 of file TwoBodyDecayTrajectoryState.h.

40 { return thePrimaryWidth; }

References thePrimaryWidth.

Referenced by TwoBodyDecayTrajectory::construct().

◆ propagateSingleState()

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.

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 }

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

Referenced by construct().

◆ rescaleError()

void TwoBodyDecayTrajectoryState::rescaleError ( double  scale)

Definition at line 35 of file TwoBodyDecayTrajectoryState.cc.

35  {
36  theOriginalTsos.first.rescaleError(scale);
37  theOriginalTsos.second.rescaleError(scale);
38  theRefittedTsos.first.rescaleError(scale);
39  theRefittedTsos.second.rescaleError(scale);
40 }

References Scenarios_cff::scale, theOriginalTsos, and theRefittedTsos.

◆ setError()

void TwoBodyDecayTrajectoryState::setError ( FreeTrajectoryState fts,
AlgebraicMatrix derivative 
) const
private

Definition at line 133 of file TwoBodyDecayTrajectoryState.cc.

133  {
134  AlgebraicSymMatrix ftsCartesianError(theParameters.covariance().similarity(derivative));
135  fts.setCartesianError(asSMatrix<6>(ftsCartesianError));
136 }

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

Referenced by construct().

◆ trajectoryStates()

const TsosContainer& TwoBodyDecayTrajectoryState::trajectoryStates ( bool  useRefittedState = true) const
inline

Member Data Documentation

◆ nDecayParam

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

Definition at line 68 of file TwoBodyDecayTrajectoryState.h.

◆ nLocalParam

const unsigned int TwoBodyDecayTrajectoryState::nLocalParam = 5
staticprivate

Definition at line 67 of file TwoBodyDecayTrajectoryState.h.

◆ theDerivatives

Derivatives TwoBodyDecayTrajectoryState::theDerivatives
private

Definition at line 60 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and derivatives().

◆ theOriginalTsos

TsosContainer TwoBodyDecayTrajectoryState::theOriginalTsos
private

Definition at line 61 of file TwoBodyDecayTrajectoryState.h.

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

◆ theParameters

TwoBodyDecayParameters TwoBodyDecayTrajectoryState::theParameters
private

Definition at line 59 of file TwoBodyDecayTrajectoryState.h.

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

◆ theParticleMass

double TwoBodyDecayTrajectoryState::theParticleMass
private

Definition at line 57 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and particleMass().

◆ thePrimaryMass

double TwoBodyDecayTrajectoryState::thePrimaryMass
private

Definition at line 64 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryMass().

◆ thePrimaryWidth

double TwoBodyDecayTrajectoryState::thePrimaryWidth
private

Definition at line 65 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryWidth().

◆ theRefittedTsos

TsosContainer TwoBodyDecayTrajectoryState::theRefittedTsos
private

Definition at line 62 of file TwoBodyDecayTrajectoryState.h.

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

◆ theValidityFlag

bool TwoBodyDecayTrajectoryState::theValidityFlag
private

Definition at line 55 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and isValid().

Vector3DBase
Definition: Vector3DBase.h:8
TwoBodyDecayTrajectoryState::propagateSingleState
bool propagateSingleState(const FreeTrajectoryState &fts, const GlobalTrajectoryParameters &gtp, const AlgebraicMatrix &startDeriv, const Surface &surface, const MagneticField *magField, TrajectoryStateOnSurface &tsos, AlgebraicMatrix &endDeriv) const
Definition: TwoBodyDecayTrajectoryState.cc:91
TwoBodyDecayTrajectoryState::nLocalParam
static const unsigned int nLocalParam
Definition: TwoBodyDecayTrajectoryState.h:67
TwoBodyDecayTrajectoryState::theParticleMass
double theParticleMass
Definition: TwoBodyDecayTrajectoryState.h:57
AnalyticalCurvilinearJacobian::jacobian
const AlgebraicMatrix55 & jacobian() const
Definition: AnalyticalCurvilinearJacobian.h:51
AnalyticalCurvilinearJacobian
Definition: AnalyticalCurvilinearJacobian.h:21
TwoBodyDecayTrajectoryState::theValidityFlag
bool theValidityFlag
Definition: TwoBodyDecayTrajectoryState.h:55
TwoBodyDecayTrajectoryState::theOriginalTsos
TsosContainer theOriginalTsos
Definition: TwoBodyDecayTrajectoryState.h:61
TwoBodyDecayParameters::mass
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecay::primaryMass
double primaryMass(void) const
Definition: TwoBodyDecay.h:49
TwoBodyDecayTrajectoryState::theDerivatives
Derivatives theDerivatives
Definition: TwoBodyDecayTrajectoryState.h:60
funct::derivative
Derivative< X, A >::type derivative(const A &_)
Definition: Derivative.h:18
AlgebraicMatrix56
ROOT::Math::SMatrix< double, 5, 6, ROOT::Math::MatRepStd< double, 5, 6 > > AlgebraicMatrix56
Definition: AlgebraicROOTObjects.h:56
TwoBodyDecayTrajectoryState::theRefittedTsos
TsosContainer theRefittedTsos
Definition: TwoBodyDecayTrajectoryState.h:62
TwoBodyDecayTrajectoryState::construct
void construct(const MagneticField *magField, bool propagateErrors)
Definition: TwoBodyDecayTrajectoryState.cc:42
TwoBodyDecay::decayParameters
const TwoBodyDecayParameters & decayParameters(void) const
Definition: TwoBodyDecay.h:31
JacobianCurvilinearToLocal
Definition: JacobianCurvilinearToLocal.h:19
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
TwoBodyDecay::primaryWidth
double primaryWidth(void) const
Definition: TwoBodyDecay.h:50
p2
double p2[4]
Definition: TauolaWrapper.h:90
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
TwoBodyDecayTrajectoryState::nDecayParam
static const unsigned int nDecayParam
Definition: TwoBodyDecayTrajectoryState.h:68
TwoBodyDecayTrajectoryState::particleMass
double particleMass(void) const
Definition: TwoBodyDecayTrajectoryState.h:30
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
TwoBodyDecayDerivatives
Definition: TwoBodyDecayDerivatives.h:14
TwoBodyDecayTrajectoryState::derivatives
const Derivatives & derivatives(void) const
Definition: TwoBodyDecayTrajectoryState.h:35
TwoBodyDecayModel
Definition: TwoBodyDecayModel.h:15
TwoBodyDecayTrajectoryState::thePrimaryWidth
double thePrimaryWidth
Definition: TwoBodyDecayTrajectoryState.h:65
TwoBodyDecayParameters::z
Definition: TwoBodyDecayParameters.h:17
p1
double p1[4]
Definition: TauolaWrapper.h:89
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
JacobianCurvilinearToLocal::jacobian
const AlgebraicMatrix55 & jacobian() const
Definition: JacobianCurvilinearToLocal.h:37
TwoBodyDecayParameters::y
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecayTrajectoryState::theParameters
TwoBodyDecayParameters theParameters
Definition: TwoBodyDecayTrajectoryState.h:59
TwoBodyDecayTrajectoryState::setError
void setError(FreeTrajectoryState &fts, AlgebraicMatrix &derivative) const
Definition: TwoBodyDecayTrajectoryState.cc:133
TwoBodyDecayParameters::x
Definition: TwoBodyDecayParameters.h:17
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TwoBodyDecayParameters::covariance
const AlgebraicSymMatrix & covariance(void) const
Get error matrix.
Definition: TwoBodyDecayParameters.h:37
TwoBodyDecayTrajectoryState::thePrimaryMass
double thePrimaryMass
Definition: TwoBodyDecayTrajectoryState.h:64
asHepMatrix
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:59
FreeTrajectoryState::setCartesianError
void setCartesianError(const CartesianTrajectoryError &err)
Definition: FreeTrajectoryState.h:97
JacobianCartesianToCurvilinear
Definition: JacobianCartesianToCurvilinear.h:14