CMS 3D CMS Logo

MultiRefittedTS Class Reference

#include <RecoVertex/GaussianSumVertexFit/interface/MultiRefittedTS.h>

Inheritance diagram for MultiRefittedTS:

RefittedTrackState< 5 > ReferenceCounted

List of all members.

Public Types

typedef
ReferenceCountingPointer
< LinearizedTrackState< 5 > > 
RefCountedLinearizedTrackState
typedef
ReferenceCountingPointer
< RefittedTrackState< 5 > > 
RefCountedRefittedTrackState

Public Member Functions

virtual std::vector
< ReferenceCountingPointer
< RefittedTrackState< 5 > > > 
components () const
virtual AlgebraicSymMatrixNN covariance () const
 The covariance matrix.
virtual FreeTrajectoryState freeTrajectoryState () const
 Returns a FreeTrajectoryState.
virtual AlgebraicVectorM momentumVector () const
 Vector containing the parameters describing the momentum as the vertex.
 MultiRefittedTS (const std::vector< RefCountedRefittedTrackState > &prtsComp, const GlobalPoint &referencePosition)
 Constructor with a reference position.
 MultiRefittedTS (const std::vector< RefCountedRefittedTrackState > &prtsComp, const Surface &referenceSurface)
 Constructor with a reference surface, to be used to assemble the TSOS components on one identical surface.
virtual AlgebraicVectorN parameters () const
 Vector containing the refitted track parameters.
virtual GlobalPoint position () const
 Position at which the momentum is defined.
virtual
ReferenceCountingPointer
< RefittedTrackState< 5 > > 
stateWithNewWeight (const double newWeight) const
 This method is meant to returns a new refitted state of the same type, but with another weight.
virtual TrajectoryStateOnSurface trajectoryStateOnSurface (const Surface &surface, const Propagator &propagator) const
 Returns a multi-state TSOS at a given surface, with a given propagator.
virtual TrajectoryStateOnSurface trajectoryStateOnSurface (const Surface &surface) const
 Returns a multi-state TSOS at a given surface.
virtual reco::TransientTrack transientTrack () const
 Returns a new reco::Track, which can then be made persistent.
virtual double weight () const
 The weight of this component in a mixture.
virtual ~MultiRefittedTS ()

Private Types

typedef std::vector
< RefCountedRefittedTrackState
RTSvector

Private Member Functions

void computeFreeTrajectoryState () const

Private Attributes

FreeTrajectoryState fts
bool ftsAvailable
const GlobalPoint refPosition
ConstReferenceCountingPointer
< Surface
refSurface
const bool surf
RTSvector theComponents
double totalWeight
bool totalWeightAvailable


Detailed Description

Definition at line 17 of file MultiRefittedTS.h.


Member Typedef Documentation

typedef ReferenceCountingPointer<LinearizedTrackState<5> > MultiRefittedTS::RefCountedLinearizedTrackState

Definition at line 22 of file MultiRefittedTS.h.

typedef ReferenceCountingPointer<RefittedTrackState<5> > MultiRefittedTS::RefCountedRefittedTrackState

Definition at line 21 of file MultiRefittedTS.h.

typedef std::vector<RefCountedRefittedTrackState > MultiRefittedTS::RTSvector [private]

Definition at line 121 of file MultiRefittedTS.h.


Constructor & Destructor Documentation

MultiRefittedTS::MultiRefittedTS ( const std::vector< RefCountedRefittedTrackState > &  prtsComp,
const Surface referenceSurface 
)

Constructor with a reference surface, to be used to assemble the TSOS components on one identical surface.

Definition at line 12 of file MultiRefittedTS.cc.

Referenced by stateWithNewWeight().

00013                                           :
00014         theComponents(prtsComp), ftsAvailable(false), refSurface(&referenceSurface),
00015         surf(true) {}

MultiRefittedTS::MultiRefittedTS ( const std::vector< RefCountedRefittedTrackState > &  prtsComp,
const GlobalPoint referencePosition 
)

Constructor with a reference position.

The surface which is going to be usedto assemble the TSOS components will be the surface perpendicular to the PCA of the state with the highest weight to the reference point.

Definition at line 18 of file MultiRefittedTS.cc.

00019                                                :
00020         theComponents(prtsComp), ftsAvailable(false), refPosition(referencePosition),
00021         surf(false) {}

virtual MultiRefittedTS::~MultiRefittedTS (  )  [inline, virtual]

Definition at line 39 of file MultiRefittedTS.h.

00039 {}


Member Function Documentation

virtual std::vector<ReferenceCountingPointer<RefittedTrackState<5> > > MultiRefittedTS::components (  )  const [inline, virtual]

Implements RefittedTrackState< 5 >.

Definition at line 99 of file MultiRefittedTS.h.

References theComponents.

00100   {
00101     return theComponents;
00102   }

void MultiRefittedTS::computeFreeTrajectoryState (  )  const [private]

Definition at line 33 of file MultiRefittedTS.cc.

References TransverseImpactPointExtrapolator::extrapolate(), TrajectoryStateOnSurface::freeTrajectoryState(), freeTrajectoryState(), fts, ftsAvailable, it, refPosition, surf, TrajectoryStateOnSurface::surface(), theComponents, and trajectoryStateOnSurface().

Referenced by freeTrajectoryState().

00034 {
00035   if (surf) {
00036     fts =  *(trajectoryStateOnSurface(*refSurface).freeTrajectoryState());
00037   } else {
00038     double maxWeight = -1.;
00039     RTSvector::const_iterator maxIt;
00040     for (RTSvector::const_iterator it = theComponents.begin(); 
00041           it != theComponents.end(); it++) {
00042       if ( (**it).weight() > maxWeight ) {
00043         maxWeight = (**it).weight();
00044         maxIt = it;
00045       }
00046     }
00047 
00048     TransverseImpactPointExtrapolator tipe(&((**maxIt).freeTrajectoryState().parameters().magneticField()));
00049     TrajectoryStateOnSurface initialTSOS = tipe.extrapolate((**maxIt).freeTrajectoryState(), refPosition);
00050 
00051     fts = *(trajectoryStateOnSurface(initialTSOS.surface()).freeTrajectoryState());
00052   }
00053   ftsAvailable = true;
00054 }

MultiRefittedTS::AlgebraicSymMatrixNN MultiRefittedTS::covariance ( void   )  const [virtual]

The covariance matrix.

Not possible yet for a multi-state, throws an exception.

Implements RefittedTrackState< 5 >.

Definition at line 72 of file MultiRefittedTS.cc.

00073 {
00074   throw VertexException
00075     ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
00076 }

FreeTrajectoryState MultiRefittedTS::freeTrajectoryState (  )  const [virtual]

Returns a FreeTrajectoryState.

Transformation into a FreeTrajectoryState.

It will be the FTS of the single, collapsed state.

Implements RefittedTrackState< 5 >.

Definition at line 27 of file MultiRefittedTS.cc.

References computeFreeTrajectoryState(), fts, and ftsAvailable.

Referenced by computeFreeTrajectoryState(), and transientTrack().

00028 {
00029   if (!ftsAvailable) computeFreeTrajectoryState();
00030   return fts;
00031 }

MultiRefittedTS::AlgebraicVectorM MultiRefittedTS::momentumVector (  )  const [virtual]

Vector containing the parameters describing the momentum as the vertex.

These are (signed transverse curvature, theta, phi). Not possible yet for a multi-state, throws an exception.

These are (signed transverse curvature, theta, phi)

Implements RefittedTrackState< 5 >.

Definition at line 93 of file MultiRefittedTS.cc.

00094 {
00095   throw VertexException
00096     ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
00097 }

MultiRefittedTS::AlgebraicVectorN MultiRefittedTS::parameters ( void   )  const [virtual]

Vector containing the refitted track parameters.

Not possible yet for a multi-state, throws an exception.


These are (signed transverse curvature, theta, phi, (signed) transverse , longitudinal impact parameter)

Implements RefittedTrackState< 5 >.

Definition at line 62 of file MultiRefittedTS.cc.

00063 {
00064   throw VertexException
00065     ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
00066 }

GlobalPoint MultiRefittedTS::position ( void   )  const [virtual]

Position at which the momentum is defined.

Not possible yet for a multi-state, throws an exception.

Implements RefittedTrackState< 5 >.

Definition at line 82 of file MultiRefittedTS.cc.

00083 {
00084   throw VertexException
00085     ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
00086 }

ReferenceCountingPointer< RefittedTrackState< 5 > > MultiRefittedTS::stateWithNewWeight ( const double  newWeight  )  const [virtual]

This method is meant to returns a new refitted state of the same type, but with another weight.

As we can have several components, each component of the new multi-state will be reweighted so that the sum of all weights is equal to the specified weight. The current state is unchanged.

Implements RefittedTrackState< 5 >.

Definition at line 117 of file MultiRefittedTS.cc.

References it, MultiRefittedTS(), refPosition, refSurface, surf, theComponents, and weight().

00118 {
00119   if (weight() < DBL_MIN) {
00120   throw VertexException
00121     ("MultiRefittedTS::stateWithNewWeight(): Can not reweight multi-state with total weight < DBL_MIN");
00122   }
00123   double factor = newWeight/weight();
00124 
00125   RTSvector reWeightedRTSC;
00126   reWeightedRTSC.reserve(theComponents.size());
00127 
00128   for (RTSvector::const_iterator it = theComponents.begin(); 
00129         it != theComponents.end(); it++) {
00130     reWeightedRTSC.push_back((**it).stateWithNewWeight((**it).weight()*factor));
00131   }
00132   if (surf) {
00133     return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, *refSurface));
00134   } else {
00135     return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, refPosition));
00136   }
00137 }

TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface ( const Surface surface,
const Propagator propagator 
) const [virtual]

Returns a multi-state TSOS at a given surface, with a given propagator.

Implements RefittedTrackState< 5 >.

Definition at line 159 of file MultiRefittedTS.cc.

References it, and theComponents.

00161 { //fixme... is the propagation done correctly? Is there a gsf propagator?
00162   vector<TrajectoryStateOnSurface> tsosComponents;
00163   tsosComponents.reserve(theComponents.size());
00164   for (RTSvector::const_iterator it = theComponents.begin(); 
00165         it != theComponents.end(); it++) {
00166     tsosComponents.push_back((**it).trajectoryStateOnSurface(surface, propagator));
00167   }
00168 // #ifndef CMS_NO_COMPLEX_RETURNS
00169   return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(tsosComponents));
00170 // #else
00171 //   TrajectoryStateOnSurface result(new BasicMultiTrajectoryState(tsosComponents));
00172 //   return result;
00173 // #endif
00174 }

TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface ( const Surface surface  )  const [virtual]

Returns a multi-state TSOS at a given surface.

Transformation into a TSOS at a given surface.

Implements RefittedTrackState< 5 >.

Definition at line 142 of file MultiRefittedTS.cc.

References it, and theComponents.

Referenced by computeFreeTrajectoryState().

00144 {
00145   vector<TrajectoryStateOnSurface> tsosComponents;
00146   tsosComponents.reserve(theComponents.size());
00147   for (RTSvector::const_iterator it = theComponents.begin(); 
00148         it != theComponents.end(); it++) {
00149     tsosComponents.push_back((**it).trajectoryStateOnSurface(surface));
00150   }
00151 // #ifndef CMS_NO_COMPLEX_RETURNS
00152   return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(tsosComponents));
00153 // #else
00154 //   TrajectoryStateOnSurface result(new BasicMultiTrajectoryState(tsosComponents));
00155 //   return result;
00156 // #endif
00157 }

reco::TransientTrack MultiRefittedTS::transientTrack (  )  const [virtual]

Returns a new reco::Track, which can then be made persistent.

The parameters are taken from FTS described above.

Implements RefittedTrackState< 5 >.

Definition at line 176 of file MultiRefittedTS.cc.

References TransientTrackFromFTSFactory::build(), and freeTrajectoryState().

00177 {
00178   TransientTrackFromFTSFactory factory;
00179   return factory.build(freeTrajectoryState());
00180 }

double MultiRefittedTS::weight (  )  const [virtual]

The weight of this component in a mixture.

Implements RefittedTrackState< 5 >.

Definition at line 99 of file MultiRefittedTS.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), it, theComponents, totalWeight, and totalWeightAvailable.

Referenced by stateWithNewWeight().

00100 {
00101   if (!totalWeightAvailable)
00102   {
00103     totalWeight = 0.;
00104     if (theComponents.empty()) {
00105       cout << "Asking for weight of empty MultiRefittedTS, returning zero!" << endl;
00106     }
00107     for (RTSvector::const_iterator it = theComponents.begin(); 
00108           it != theComponents.end(); it++) {
00109       totalWeight += (**it).weight();
00110     }
00111   }
00112   return totalWeight;
00113 }


Member Data Documentation

FreeTrajectoryState MultiRefittedTS::fts [mutable, private]

Definition at line 126 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and freeTrajectoryState().

bool MultiRefittedTS::ftsAvailable [mutable, private]

Definition at line 124 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and freeTrajectoryState().

const GlobalPoint MultiRefittedTS::refPosition [private]

Definition at line 127 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and stateWithNewWeight().

ConstReferenceCountingPointer<Surface> MultiRefittedTS::refSurface [private]

Definition at line 128 of file MultiRefittedTS.h.

Referenced by stateWithNewWeight().

const bool MultiRefittedTS::surf [private]

Definition at line 129 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and stateWithNewWeight().

RTSvector MultiRefittedTS::theComponents [mutable, private]

Definition at line 123 of file MultiRefittedTS.h.

Referenced by components(), computeFreeTrajectoryState(), stateWithNewWeight(), trajectoryStateOnSurface(), and weight().

double MultiRefittedTS::totalWeight [mutable, private]

Definition at line 125 of file MultiRefittedTS.h.

Referenced by weight().

bool MultiRefittedTS::totalWeightAvailable [mutable, private]

Definition at line 124 of file MultiRefittedTS.h.

Referenced by weight().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:31 2009 for CMSSW by  doxygen 1.5.4