CMS 3D CMS Logo

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

BasicMultiTrajectoryState Class Reference

#include <BasicMultiTrajectoryState.h>

Inheritance diagram for BasicMultiTrajectoryState:
BasicTrajectoryState ReferenceCountedPoolAllocated BlockWipedPoolAllocated

List of all members.

Public Member Functions

 BasicMultiTrajectoryState (const std::vector< TSOS > &tsvec)
 BasicMultiTrajectoryState ()
virtual bool canUpdateLocalParameters () const
const CartesianTrajectoryErrorcartesianError () const
TrackCharge charge () const
virtual BasicMultiTrajectoryStateclone () const
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 Surfacesurface () const
virtual SurfaceSide surfaceSide () const
 Position relative to material, defined relative to momentum vector.
double transverseCurvature () const
virtual void update (const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
virtual void update (const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, const SurfaceSide side, double weight)
double weight () const

Private Types

typedef TrajectoryStateOnSurface TSOS

Private Member Functions

void checkCombinedState () const

Private Attributes

TSOS theCombinedState
bool theCombinedStateUp2Date
MultiTrajectoryStateCombiner theCombiner
std::vector< TSOStheStates

Detailed Description

Definition at line 10 of file BasicMultiTrajectoryState.h.


Member Typedef Documentation

Definition at line 12 of file BasicMultiTrajectoryState.h.


Constructor & Destructor Documentation

BasicMultiTrajectoryState::BasicMultiTrajectoryState ( const std::vector< TSOS > &  tsvec)

Definition at line 8 of file BasicMultiTrajectoryState.cc.

References Exception, i, and theStates.

                                                                                  :
  theCombinedStateUp2Date( false)
{
  theStates.reserve(tsvec.size());
  for (std::vector<TSOS>::const_iterator i=tsvec.begin(); i!=tsvec.end(); i++) {
    if (!i->isValid()) {
      throw cms::Exception("LogicError") << "MultiTrajectoryState constructed with invalid state";
    }
    if (i->hasError() != tsvec.front().hasError()) {
      throw cms::Exception("LogicError") << "MultiTrajectoryState mixes states with and without errors";
    }
    if ( &i->surface() != &tsvec.front().surface()) {
      throw cms::Exception("LogicError") << "MultiTrajectoryState mixes states with different surfaces";
    }
    if ( i->surfaceSide() != tsvec.front().surfaceSide()) {
      throw cms::Exception("LogicError") 
        << "MultiTrajectoryState mixes states defined before and after material";
    }
    if ( i->localParameters().pzSign()*tsvec.front().localParameters().pzSign()<0. ) {
      throw cms::Exception("LogicError") 
        << "MultiTrajectoryState mixes states with different signs of local p_z";
    }
    if ( i==tsvec.begin() ) {
      // only accept planes!!
      const BoundPlane* bp = dynamic_cast<const BoundPlane*>(&i->surface());
      if ( bp==0 )
        throw cms::Exception("LogicError") << "MultiTrajectoryState constructed on cylinder";
    }
    theStates.push_back( *i);
  }
}
BasicMultiTrajectoryState::BasicMultiTrajectoryState ( ) [inline]

Definition at line 18 of file BasicMultiTrajectoryState.h.

Referenced by clone().

{}

Member Function Documentation

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

Implements BasicTrajectoryState.

Definition at line 132 of file BasicMultiTrajectoryState.h.

{ return false; }
const CartesianTrajectoryError& BasicMultiTrajectoryState::cartesianError ( ) const [inline, virtual]
TrackCharge BasicMultiTrajectoryState::charge ( void  ) const [inline, virtual]
void BasicMultiTrajectoryState::checkCombinedState ( ) const [private]
virtual BasicMultiTrajectoryState* BasicMultiTrajectoryState::clone ( void  ) const [inline, virtual]

Implements BasicTrajectoryState.

Definition at line 121 of file BasicMultiTrajectoryState.h.

References BasicMultiTrajectoryState().

                                                   {
    return new BasicMultiTrajectoryState(*this);
  }
virtual std::vector<TrajectoryStateOnSurface> BasicMultiTrajectoryState::components ( ) const [inline, virtual]

Reimplemented from BasicTrajectoryState.

Definition at line 125 of file BasicMultiTrajectoryState.h.

References theStates.

                                                                 {
    return theStates;
  }
const CurvilinearTrajectoryError& BasicMultiTrajectoryState::curvilinearError ( ) const [inline, virtual]
FreeTrajectoryState* BasicMultiTrajectoryState::freeTrajectoryState ( bool  withErrors = true) const [inline, virtual]
GlobalVector BasicMultiTrajectoryState::globalDirection ( ) const [inline, virtual]
GlobalVector BasicMultiTrajectoryState::globalMomentum ( ) const [inline, virtual]
const GlobalTrajectoryParameters& BasicMultiTrajectoryState::globalParameters ( void  ) const [inline, virtual]
GlobalPoint BasicMultiTrajectoryState::globalPosition ( ) const [inline, virtual]
bool BasicMultiTrajectoryState::hasError ( void  ) const [inline, virtual]

Implements BasicTrajectoryState.

Definition at line 22 of file BasicMultiTrajectoryState.h.

References isValid(), and theStates.

                        {
    if (isValid()) return theStates.front().hasError();
    return false;
  }
bool BasicMultiTrajectoryState::isValid ( void  ) const [inline, virtual]

Implements BasicTrajectoryState.

Definition at line 20 of file BasicMultiTrajectoryState.h.

References theStates.

Referenced by hasError(), and surface().

{ return !theStates.empty() && theStates.front().isValid();}
LocalVector BasicMultiTrajectoryState::localDirection ( ) const [inline, virtual]
const LocalTrajectoryError& BasicMultiTrajectoryState::localError ( ) const [inline, virtual]
LocalVector BasicMultiTrajectoryState::localMomentum ( ) const [inline, virtual]
const LocalTrajectoryParameters& BasicMultiTrajectoryState::localParameters ( ) const [inline, virtual]
LocalPoint BasicMultiTrajectoryState::localPosition ( ) const [inline, virtual]
const MagneticField * BasicMultiTrajectoryState::magneticField ( ) const [virtual]

Implements BasicTrajectoryState.

Definition at line 79 of file BasicMultiTrajectoryState.cc.

References theStates.

{
  //
  // Magnetic field should be identical in all components:
  // avoid forcing the combination of states and take value from 1st component!
  //
  if (theStates.empty()) {
    edm::LogError("BasicMultiTrajectoryState") 
      << "Asking for magneticField of empty MultiTrajectoryState, returning null pointer!";
    return 0;
  }
  return theStates.front().magneticField();
}
void BasicMultiTrajectoryState::rescaleError ( double  factor) [virtual]

Rescaling the error of the mixture with a given factor. Please note that this rescaling is imposed on each of the components of the mixture and does therefore not exactly correspond to rescaling theCombinedState with the same factor.

Implements BasicTrajectoryState.

Definition at line 65 of file BasicMultiTrajectoryState.cc.

References theCombinedStateUp2Date, and theStates.

                                                          {

  if (theStates.empty()) {
    edm::LogError("BasicMultiTrajectoryState") << "Trying to rescale errors of empty MultiTrajectoryState!";
    return;
  }
  
  for (std::vector<TSOS>::iterator it = theStates.begin(); it != theStates.end(); it++) {
    it->rescaleError(factor);
  }
  theCombinedStateUp2Date = false;
}
double BasicMultiTrajectoryState::signedInverseMomentum ( ) const [inline, virtual]
const Surface& BasicMultiTrajectoryState::surface ( ) const [inline, virtual]

Implements BasicTrajectoryState.

Definition at line 104 of file BasicMultiTrajectoryState.h.

References Exception, isValid(), and theStates.

                                 {
    if (!isValid()) 
      throw cms::Exception("LogicError") 
        << "surface() called for invalid MultiTrajectoryState";
    return theStates.front().surface();
  }
SurfaceSide BasicMultiTrajectoryState::surfaceSide ( ) const [virtual]

Position relative to material, defined relative to momentum vector.

Implements BasicTrajectoryState.

Definition at line 94 of file BasicMultiTrajectoryState.cc.

References SurfaceSideDefinition::atCenterOfSurface, and theStates.

{
  //
  // SurfaceSide should be identical in all components:
  // avoid forcing the combination of states and take value from 1st component!
  //
  if (theStates.empty()) {
    edm::LogError("BasicMultiTrajectoryState") 
      << "Asking for magneticField of empty MultiTrajectoryState, returning atCenterOfSurface!";
    return atCenterOfSurface;
  }
  return theStates.front().surfaceSide();
}
double BasicMultiTrajectoryState::transverseCurvature ( ) const [inline, virtual]
void BasicMultiTrajectoryState::update ( const LocalTrajectoryParameters p,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side 
) [virtual]

Implements BasicTrajectoryState.

Definition at line 110 of file BasicMultiTrajectoryState.cc.

References Exception.

{
  throw cms::Exception("LogicError", 
                       "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, Surface, ...) called even if canUpdateLocalParameters() is false");
}
void BasicMultiTrajectoryState::update ( const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side,
double  weight 
) [virtual]

Implements BasicTrajectoryState.

Definition at line 121 of file BasicMultiTrajectoryState.cc.

References Exception.

{
  throw cms::Exception("LogicError", 
                       "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, LocalTrajectoryError, ...) called even if canUpdateLocalParameters() is false");
}
double BasicMultiTrajectoryState::weight ( ) const [virtual]

Reimplemented from BasicTrajectoryState.

Definition at line 49 of file BasicMultiTrajectoryState.cc.

References theStates.

                                               {

  if (theStates.empty()) {
    edm::LogError("BasicMultiTrajectoryState") 
      << "Asking for weight of empty MultiTrajectoryState, returning zero!";
    return 0.;
  }

  double sumw = 0.;
  for (std::vector<TSOS>::const_iterator it = theStates.begin(); it != theStates.end(); it++) {
    sumw += it->weight();
  }
  return sumw;
}

Member Data Documentation

Definition at line 148 of file BasicMultiTrajectoryState.h.

Referenced by checkCombinedState(), and rescaleError().

Definition at line 149 of file BasicMultiTrajectoryState.h.

Referenced by checkCombinedState().