CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

TwoBodyDecayTrajectoryState Class Reference

#include <TwoBodyDecayTrajectoryState.h>

List of all members.

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

TwoBodyDecayTrajectoryState::~TwoBodyDecayTrajectoryState ( void  ) [inline]

Definition at line 30 of file TwoBodyDecayTrajectoryState.h.

{}

Member Function Documentation

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

Definition at line 47 of file TwoBodyDecayTrajectoryState.cc.

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

Referenced by TwoBodyDecayTrajectoryState().

{
  // construct global trajectory parameters at the starting point
  TwoBodyDecayModel tbdDecayModel( theParameters[TwoBodyDecayParameters::mass], theParticleMass );
  pair< AlgebraicVector, AlgebraicVector > secondaryMomenta = tbdDecayModel.cartesianSecondaryMomenta( theParameters );

  GlobalPoint vtx( theParameters[TwoBodyDecayParameters::x],
                   theParameters[TwoBodyDecayParameters::y],
                   theParameters[TwoBodyDecayParameters::z] );

  GlobalVector p1( secondaryMomenta.first[0],
                   secondaryMomenta.first[1],
                   secondaryMomenta.first[2] );

  GlobalVector p2( secondaryMomenta.second[0],
                   secondaryMomenta.second[1],
                   secondaryMomenta.second[2] );

  GlobalTrajectoryParameters gtp1( vtx, p1, theOriginalTsos.first.charge(), magField );
  FreeTrajectoryState fts1( gtp1 );

  GlobalTrajectoryParameters gtp2( vtx, p2, theOriginalTsos.second.charge(), magField );
  FreeTrajectoryState fts2( gtp2 );

  // contruct derivatives at the starting point
  TwoBodyDecayDerivatives tbdDerivatives( theParameters[TwoBodyDecayParameters::mass], theParticleMass );
  pair< AlgebraicMatrix, AlgebraicMatrix > derivatives = tbdDerivatives.derivatives( theParameters );

  AlgebraicMatrix deriv1( 6, 9, 0 );
  deriv1.sub( 1, 1, AlgebraicMatrix( 3, 3, 1 ) );
  deriv1.sub( 4, 4, derivatives.first );

  AlgebraicMatrix deriv2( 6, 9, 0 );
  deriv2.sub( 1, 1, AlgebraicMatrix( 3, 3, 1 ) );
  deriv2.sub( 4, 4, derivatives.second );

  // compute errors of initial states
  if ( propagateErrors ) {
    setError( fts1, deriv1 );
    setError( fts2, deriv2 );
  }


  // propgate states and derivatives from the starting points to the end points
  bool valid1 = propagateSingleState( fts1, gtp1, deriv1, theOriginalTsos.first.surface(),
                                      magField, theRefittedTsos.first, theDerivatives.first );

  bool valid2 = propagateSingleState( fts2, gtp2, deriv2, theOriginalTsos.second.surface(),
                                      magField, theRefittedTsos.second, theDerivatives.second );

  theValidityFlag = valid1 && valid2;

  return;
}
const TwoBodyDecayParameters& TwoBodyDecayTrajectoryState::decayParameters ( void  ) const [inline]

Definition at line 35 of file TwoBodyDecayTrajectoryState.h.

References theParameters.

Referenced by TwoBodyDecayTrajectory::construct().

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

Definition at line 37 of file TwoBodyDecayTrajectoryState.h.

References theDerivatives.

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

{ return theDerivatives; }
bool TwoBodyDecayTrajectoryState::isValid ( void  ) const [inline]
double TwoBodyDecayTrajectoryState::particleMass ( void  ) const [inline]

Definition at line 34 of file TwoBodyDecayTrajectoryState.h.

References theParticleMass.

Referenced by TwoBodyDecayTrajectory::construct().

{ return theParticleMass; }
double TwoBodyDecayTrajectoryState::primaryMass ( void  ) const [inline]

Definition at line 41 of file TwoBodyDecayTrajectoryState.h.

References thePrimaryMass.

Referenced by TwoBodyDecayTrajectory::construct().

{ return thePrimaryMass; }
double TwoBodyDecayTrajectoryState::primaryWidth ( void  ) const [inline]

Definition at line 42 of file TwoBodyDecayTrajectoryState.h.

References thePrimaryWidth.

Referenced by TwoBodyDecayTrajectory::construct().

{ return thePrimaryWidth; }
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 asHepMatrix(), AnalyticalCurvilinearJacobian::jacobian(), JacobianCurvilinearToLocal::jacobian(), JacobianCartesianToCurvilinear::jacobian(), AnalyticalPropagator::propagateWithPath(), and LargeD0_PixelPairStep_cff::propagator.

Referenced by construct().

{
  AnalyticalPropagator propagator( magField );

  // propagate state
  pair< TrajectoryStateOnSurface, double > tsosWithPath = propagator.propagateWithPath( fts, surface );

  // check if propagation was successful
  if ( !tsosWithPath.first.isValid() ) return false;

  // jacobian for transformation from cartesian to curvilinear frame at the starting point
  JacobianCartesianToCurvilinear cartToCurv( gtp );
  const AlgebraicMatrix56& matCartToCurv = cartToCurv.jacobian();

  // jacobian in curvilinear frame for propagation from the starting point to the end point
  AnalyticalCurvilinearJacobian curvJac( gtp, tsosWithPath.first.globalPosition(),
                                         tsosWithPath.first.globalMomentum(),
                                         tsosWithPath.second );
  const AlgebraicMatrix55& matCurvJac = curvJac.jacobian();

  // jacobian for transformation from curvilinear to local frame at the end point
  JacobianCurvilinearToLocal curvToLoc( surface, tsosWithPath.first.localParameters(), *magField );
  const AlgebraicMatrix55& matCurvToLoc = curvToLoc.jacobian();

  AlgebraicMatrix56 tmpDeriv = matCurvToLoc*matCurvJac*matCartToCurv;
  AlgebraicMatrix hepMatDeriv( asHepMatrix( tmpDeriv ) );
  //AlgebraicMatrix hepMatDeriv = asHepMatrix< 5, 6 >( tmpDeriv );

  // replace original state with new state
  tsos = tsosWithPath.first;

  // propagate derivative matrix
  endDeriv = hepMatDeriv*startDeriv;

  return true;
}
void TwoBodyDecayTrajectoryState::rescaleError ( double  scale)

Definition at line 38 of file TwoBodyDecayTrajectoryState.cc.

References theOriginalTsos, and theRefittedTsos.

{
  theOriginalTsos.first.rescaleError( scale );
  theOriginalTsos.second.rescaleError( scale );
  theRefittedTsos.first.rescaleError( scale );
  theRefittedTsos.second.rescaleError( scale );
}
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().

{
  AlgebraicSymMatrix ftsCartesianError( theParameters.covariance().similarity( derivative ) );
  fts.setCartesianError( asSMatrix<6>( ftsCartesianError ) );
}
const TsosContainer& TwoBodyDecayTrajectoryState::trajectoryStates ( bool  useRefittedState = true) const [inline]

Member Data Documentation

const unsigned int TwoBodyDecayTrajectoryState::nDecayParam = TwoBodyDecayParameters::dimension [static, private]

Definition at line 74 of file TwoBodyDecayTrajectoryState.h.

const unsigned int TwoBodyDecayTrajectoryState::nLocalParam = 5 [static, private]

Definition at line 73 of file TwoBodyDecayTrajectoryState.h.

Definition at line 66 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and derivatives().

Definition at line 67 of file TwoBodyDecayTrajectoryState.h.

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

Definition at line 65 of file TwoBodyDecayTrajectoryState.h.

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

Definition at line 63 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and particleMass().

Definition at line 70 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryMass().

Definition at line 71 of file TwoBodyDecayTrajectoryState.h.

Referenced by primaryWidth().

Definition at line 68 of file TwoBodyDecayTrajectoryState.h.

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

Definition at line 61 of file TwoBodyDecayTrajectoryState.h.

Referenced by construct(), and isValid().