CMS 3D CMS Logo

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

BasicTrajectoryState Class Reference

#include <BasicTrajectoryState.h>

Inheritance diagram for BasicTrajectoryState:
ReferenceCountedPoolAllocated BlockWipedPoolAllocated GCC11_FINAL< T, TOPO > GCC11_FINAL< T, TOPO >

List of all members.

Public Types

typedef BasicTrajectoryState BTSOS
typedef ProxyBase< BTSOS,
CopyUsingClone< BTSOS > > 
Proxy
typedef
ReferenceCountingPointer
< BasicTrajectoryState
RCPtr
typedef
SurfaceSideDefinition::SurfaceSide 
SurfaceSide
typedef Surface SurfaceType

Public Member Functions

 BasicTrajectoryState ()
 BasicTrajectoryState (const SurfaceType &aSurface)
 construct invalid trajectory state (without parameters)
 BasicTrajectoryState (const FreeTrajectoryState &fts, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const SurfaceType &aSurface, double weight)
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const SurfaceType &aSurface, const MagneticField *field, double weight)
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CartesianTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
virtual bool canUpdateLocalParameters () const
const CartesianTrajectoryError cartesianError () const
TrackCharge charge () const
virtual BasicTrajectoryStateclone () const =0
virtual std::vector
< TrajectoryStateOnSurface
components () const
const CurvilinearTrajectoryErrorcurvilinearError () const
FreeTrajectoryStatefreeTrajectoryState (bool withErrors=true) const
GlobalVector globalDirection () const
GlobalVector globalMomentum () const
const GlobalTrajectoryParametersglobalParameters () const
GlobalPoint globalPosition () const
bool hasError () const
bool isValid () const
LocalVector localDirection () const
const LocalTrajectoryErrorlocalError () const
LocalVector localMomentum () const
const LocalTrajectoryParameterslocalParameters () const
LocalPoint localPosition () const
const MagneticFieldmagneticField () const
void rescaleError (double factor)
double signedInverseMomentum () const
const SurfaceTypesurface () const
SurfaceSide surfaceSide () const
 Position relative to material, defined relative to momentum vector.
double transverseCurvature () const
virtual void update (const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side, double weight)
virtual void update (const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side)
double weight () const
virtual ~BasicTrajectoryState ()

Private Member Functions

void checkCurvilinError () const
void createLocalError () const
void createLocalErrorFromCurvilinearError () const dso_internal
void createLocalParameters () const
void missingError (char const *where) const

Static Private Member Functions

static void notValid ()

Private Attributes

FreeTrajectoryState theFreeState
LocalTrajectoryError theLocalError
LocalTrajectoryParameters theLocalParameters
bool theLocalParametersValid
ConstReferenceCountingPointer
< SurfaceType
theSurfaceP
SurfaceSide theSurfaceSide
bool theValid
double theWeight

Friends

class ProxyBase< BTSOS, CopyUsingClone< BTSOS > >
class ReferenceCountingPointer< BasicTrajectoryState >

Detailed Description

No so Abstract (anyore) base class for TrajectoryState. It is ReferenceCounted.

VI 8/12/2011 content of BasicSingleTrajectoryState moved here.... fully devirtualized

Definition at line 79 of file BasicTrajectoryState.h.


Member Typedef Documentation

Definition at line 82 of file BasicTrajectoryState.h.

Definition at line 83 of file BasicTrajectoryState.h.

Definition at line 84 of file BasicTrajectoryState.h.

Definition at line 85 of file BasicTrajectoryState.h.

Definition at line 86 of file BasicTrajectoryState.h.


Constructor & Destructor Documentation

BasicTrajectoryState::BasicTrajectoryState ( ) [inline]

Definition at line 94 of file BasicTrajectoryState.h.

: theValid(false), theWeight(0){}
BasicTrajectoryState::BasicTrajectoryState ( const SurfaceType aSurface) [explicit]

construct invalid trajectory state (without parameters)

Definition at line 176 of file BasicTrajectoryState.cc.

BasicTrajectoryState::~BasicTrajectoryState ( ) [virtual]

Definition at line 40 of file BasicTrajectoryState.cc.

{}
BasicTrajectoryState::BasicTrajectoryState ( const FreeTrajectoryState fts,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

Constructor from FTS and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 55 of file BasicTrajectoryState.cc.

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

Constructor from global parameters and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 69 of file BasicTrajectoryState.cc.

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const CartesianTrajectoryError err,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

Constructor from global parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 83 of file BasicTrajectoryState.cc.

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const CurvilinearTrajectoryError err,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface,
double  weight = 1. 
)

Constructor from global parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely. For multi-states the weight should be specified explicitely.

Definition at line 98 of file BasicTrajectoryState.cc.

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const CurvilinearTrajectoryError err,
const SurfaceType aSurface,
double  weight 
)

Constructor from global parameters, errors and surface. For multi-states the weight should be specified explicitely. For backward compatibility without specification of the side of the surface.

Definition at line 114 of file BasicTrajectoryState.cc.

BasicTrajectoryState::BasicTrajectoryState ( const LocalTrajectoryParameters par,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

Constructor from local parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 129 of file BasicTrajectoryState.cc.

                                                    :
  theFreeState(makeFTS(par,aSurface,field)),
  theLocalError(InvalidError()),
  theLocalParameters(par),
  theLocalParametersValid(true),
  theValid(true),
   theSurfaceSide(side),
  theSurfaceP( &aSurface), 
  theWeight(1.)
{}
BasicTrajectoryState::BasicTrajectoryState ( const LocalTrajectoryParameters par,
const LocalTrajectoryError err,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface,
double  weight = 1. 
)

Constructor from local parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely. For multi-states the weight should be specified explicitely.

Definition at line 144 of file BasicTrajectoryState.cc.

                                           :
  theFreeState(makeFTS(par,aSurface,field)),
  theLocalError(err),
  theLocalParameters(par),
  theLocalParametersValid(true),
  theValid(true),
  theSurfaceSide(side), 
  theSurfaceP( &aSurface),
  theWeight(weight)
{}
BasicTrajectoryState::BasicTrajectoryState ( const LocalTrajectoryParameters par,
const LocalTrajectoryError err,
const SurfaceType aSurface,
const MagneticField field,
double  weight 
)

Constructor from local parameters, errors and surface. For multi-states the weight should be specified explicitely. For backward compatibility without specification of the side of the surface.

Definition at line 161 of file BasicTrajectoryState.cc.


Member Function Documentation

virtual bool BasicTrajectoryState::canUpdateLocalParameters ( ) const [inline, virtual]

Reimplemented in GCC11_FINAL< T, TOPO >.

Definition at line 268 of file BasicTrajectoryState.h.

{ return true; }
const CartesianTrajectoryError BasicTrajectoryState::cartesianError ( ) const [inline]

Definition at line 191 of file BasicTrajectoryState.h.

References FreeTrajectoryState::cartesianError(), freeTrajectoryState(), hasError(), missingError(), and unlikely.

                                                        {
    if unlikely(!hasError()) {
        missingError(" accesing cartesian error.");
        return CartesianTrajectoryError();
      }
    return freeTrajectoryState(true)->cartesianError();
  }
TrackCharge BasicTrajectoryState::charge ( void  ) const [inline]
void BasicTrajectoryState::checkCurvilinError ( ) const [private]
virtual BasicTrajectoryState* BasicTrajectoryState::clone ( ) const [pure virtual]

Implemented in GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

std::vector< TrajectoryStateOnSurface > BasicTrajectoryState::components ( ) const [virtual]
void BasicTrajectoryState::createLocalError ( ) const [private]
void BasicTrajectoryState::createLocalErrorFromCurvilinearError ( ) const [private]

Definition at line 256 of file BasicTrajectoryState.cc.

References FreeTrajectoryState::curvilinearError(), globalParameters(), JacobianCurvilinearToLocal::jacobian(), localParameters(), magneticField(), CurvilinearTrajectoryError::matrix(), surface(), theFreeState, and theLocalError.

Referenced by createLocalError().

                                                                 {
  
  JacobianCurvilinearToLocal curv2Loc(surface(), localParameters(), globalParameters(), *magneticField());
  const AlgebraicMatrix55& jac = curv2Loc.jacobian();
  
  const AlgebraicSymMatrix55 &cov = 
    ROOT::Math::Similarity(jac, theFreeState.curvilinearError().matrix());
  //    cout<<"Clocal via curvilinear error"<<endl;
  theLocalError = LocalTrajectoryError(cov);

  verifyCurvErr(theFreeState.curvilinearError());
  verifyLocalErr(theLocalError);

}
void BasicTrajectoryState::createLocalParameters ( ) const [private]
const CurvilinearTrajectoryError& BasicTrajectoryState::curvilinearError ( ) const [inline]

Definition at line 198 of file BasicTrajectoryState.h.

References FreeTrajectoryState::curvilinearError(), freeTrajectoryState(), hasError(), missingError(), and unlikely.

                                                             {
    if unlikely(!hasError()) {
        missingError(" accesing curvilinearerror.");
        static CurvilinearTrajectoryError crap;
        return crap;
      }
    return freeTrajectoryState(true)->curvilinearError();
  }
FreeTrajectoryState* BasicTrajectoryState::freeTrajectoryState ( bool  withErrors = true) const [inline]

Definition at line 209 of file BasicTrajectoryState.h.

References checkCurvilinError(), hasError(), isValid(), notValid(), theFreeState, and unlikely.

Referenced by cartesianError(), and curvilinearError().

                                                                       {
    if unlikely(!isValid()) notValid();
    if(withErrors && hasError()) { // this is the right thing
      checkCurvilinError();
    }
    return &theFreeState;
  }
GlobalVector BasicTrajectoryState::globalDirection ( ) const [inline]
GlobalVector BasicTrajectoryState::globalMomentum ( ) const [inline]

Definition at line 175 of file BasicTrajectoryState.h.

References FreeTrajectoryState::momentum(), and theFreeState.

                                      {
    return theFreeState.momentum();
  }
const GlobalTrajectoryParameters& BasicTrajectoryState::globalParameters ( void  ) const [inline]
GlobalPoint BasicTrajectoryState::globalPosition ( ) const [inline]
bool BasicTrajectoryState::hasError ( void  ) const [inline]
bool BasicTrajectoryState::isValid ( void  ) const [inline]

Reimplemented in GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 165 of file BasicTrajectoryState.h.

References theValid.

Referenced by freeTrajectoryState(), and localParameters().

{ return theValid; }
LocalVector BasicTrajectoryState::localDirection ( ) const [inline]

Reimplemented in GCC11_FINAL< T, TOPO >.

Definition at line 233 of file BasicTrajectoryState.h.

References localMomentum(), and Vector3DBase< T, FrameTag >::unit().

                                     {
    return localMomentum().unit();
  }
const LocalTrajectoryError& BasicTrajectoryState::localError ( ) const [inline]
LocalVector BasicTrajectoryState::localMomentum ( ) const [inline]

Definition at line 230 of file BasicTrajectoryState.h.

References localParameters(), and LocalTrajectoryParameters::momentum().

Referenced by localDirection().

                                    {
    return localParameters().momentum();
  }
const LocalTrajectoryParameters& BasicTrajectoryState::localParameters ( ) const [inline]
LocalPoint BasicTrajectoryState::localPosition ( ) const [inline]
const MagneticField* BasicTrajectoryState::magneticField ( ) const [inline]
void BasicTrajectoryState::missingError ( char const *  where) const [private]

Definition at line 206 of file BasicTrajectoryState.cc.

References LocalTrajectoryError::matrix(), theFreeState, theLocalError, and LocalTrajectoryError::valid().

Referenced by cartesianError(), curvilinearError(), localError(), and rescaleError().

                                                               {
  std::stringstream form;
  form<<"BasicTrajectoryState: attempt to access errors when none available "
      <<where<<".\nfreestate pointer: " <<theFreeState
      <<"\nlocal error valid/values :"<< theLocalError.valid() << "\n" 
      <<  theLocalError.matrix();

  edm::LogWarning("BasicTrajectoryState") << form.str();

  // throw TrajectoryStateException(form.str());
}
void BasicTrajectoryState::notValid ( ) [static, private]

Definition at line 188 of file BasicTrajectoryState.cc.

Referenced by freeTrajectoryState(), and localParameters().

                                    {
  throw TrajectoryStateException("TrajectoryStateOnSurface is invalid and cannot return any parameters");
}
void BasicTrajectoryState::rescaleError ( double  factor)

Reimplemented in GCC11_FINAL< T, TOPO >.

Definition at line 309 of file BasicTrajectoryState.cc.

References benchmark_cfg::errors, hasError(), i, j, magneticField(), LocalTrajectoryError::matrix(), missingError(), MagneticField::nominalValue(), FreeTrajectoryState::rescaleError(), theFreeState, theLocalError, unlikely, and LocalTrajectoryError::valid().

                                                {
  if unlikely(!hasError()) missingError(" trying to rescale");    
  theFreeState.rescaleError(factor);
  
  if (theLocalError.valid()){
    //do it by hand if the free state is not around.
    bool zeroField = (magneticField()->nominalValue()==0);
    if unlikely(zeroField){
      AlgebraicSymMatrix55 errors=theLocalError.matrix();
      //scale the 0 indexed covariance by the square root of the factor
      for (unsigned int i=1;i!=5;++i)      errors(i,0)*=factor;
      double factor_squared=factor*factor;
      //scale all others by the scaled factor
      for (unsigned int i=1;i!=5;++i)  for (unsigned int j=i;j!=5;++j) errors(i,j)*=factor_squared;
      //term 0,0 is not scaled at all
      theLocalError = LocalTrajectoryError(errors);
    }
    else theLocalError *= (factor*factor);
  }
}
double BasicTrajectoryState::signedInverseMomentum ( ) const [inline]
const SurfaceType& BasicTrajectoryState::surface ( ) const [inline]
SurfaceSide BasicTrajectoryState::surfaceSide ( ) const [inline]

Position relative to material, defined relative to momentum vector.

Definition at line 257 of file BasicTrajectoryState.h.

References theSurfaceSide.

                                  {
    return theSurfaceSide;
  }
double BasicTrajectoryState::transverseCurvature ( ) const [inline]
void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side 
) [virtual]
void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side,
double  weight 
) [virtual]
double BasicTrajectoryState::weight ( void  ) const [inline]

Definition at line 250 of file BasicTrajectoryState.h.

References theWeight.

Referenced by update().

{return theWeight;} 

Friends And Related Function Documentation

friend class ProxyBase< BTSOS, CopyUsingClone< BTSOS > > [friend]

Definition at line 89 of file BasicTrajectoryState.h.

Definition at line 90 of file BasicTrajectoryState.h.


Member Data Documentation

Definition at line 306 of file BasicTrajectoryState.h.

Referenced by createLocalParameters(), localParameters(), and update().

Reimplemented in GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 313 of file BasicTrajectoryState.h.

Referenced by surface(), and update().

Definition at line 312 of file BasicTrajectoryState.h.

Referenced by surfaceSide(), and update().

bool BasicTrajectoryState::theValid [mutable, private]

Definition at line 309 of file BasicTrajectoryState.h.

Referenced by isValid(), and update().

Definition at line 315 of file BasicTrajectoryState.h.

Referenced by update(), and weight().