CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
MultiRefittedTS Class Reference

#include <MultiRefittedTS.h>

Inheritance diagram for MultiRefittedTS:
RefittedTrackState< 5 > ReferenceCounted

Public Types

typedef ReferenceCountingPointer< LinearizedTrackState< 5 > > RefCountedLinearizedTrackState
 
typedef ReferenceCountingPointer< RefittedTrackState< 5 > > RefCountedRefittedTrackState
 
- Public Types inherited from RefittedTrackState< 5 >
typedef ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > AlgebraicSymMatrixNN
 
typedef ROOT::Math::SVector< double, N-2 > AlgebraicVectorM
 
typedef ROOT::Math::SVector< double, NAlgebraicVectorN
 

Public Member Functions

std::vector< ReferenceCountingPointer< RefittedTrackState< 5 > > > components () const override
 
AlgebraicSymMatrixNN covariance () const override
 
FreeTrajectoryState freeTrajectoryState () const override
 
AlgebraicVectorM momentumVector () const override
 
 MultiRefittedTS (const std::vector< RefCountedRefittedTrackState > &prtsComp, const Surface &referenceSurface)
 
 MultiRefittedTS (const std::vector< RefCountedRefittedTrackState > &prtsComp, const GlobalPoint &referencePosition)
 
AlgebraicVectorN parameters () const override
 
GlobalPoint position () const override
 
ReferenceCountingPointer< RefittedTrackState< 5 > > stateWithNewWeight (const double newWeight) const override
 
TrajectoryStateOnSurface trajectoryStateOnSurface (const Surface &surface) const override
 
TrajectoryStateOnSurface trajectoryStateOnSurface (const Surface &surface, const Propagator &propagator) const override
 
reco::TransientTrack transientTrack () const override
 
double weight () const override
 
 ~MultiRefittedTS () override
 
- Public Member Functions inherited from RefittedTrackState< 5 >
 ~RefittedTrackState () override
 

Private Types

typedef std::vector< RefCountedRefittedTrackStateRTSvector
 

Private Member Functions

void computeFreeTrajectoryState () const
 

Private Attributes

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

Detailed Description

Definition at line 17 of file MultiRefittedTS.h.

Member Typedef Documentation

Definition at line 22 of file MultiRefittedTS.h.

Definition at line 21 of file MultiRefittedTS.h.

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

13  :
14  theComponents(prtsComp), ftsAvailable(false), refSurface(&referenceSurface),
15  surf(true) {}
RTSvector theComponents
ConstReferenceCountingPointer< Surface > refSurface
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.

19  :
20  theComponents(prtsComp), ftsAvailable(false), refPosition(referencePosition),
21  surf(false) {}
const GlobalPoint refPosition
RTSvector theComponents
MultiRefittedTS::~MultiRefittedTS ( )
inlineoverride

Member Function Documentation

std::vector<ReferenceCountingPointer<RefittedTrackState<5> > > MultiRefittedTS::components ( ) const
inlineoverridevirtual

Implements RefittedTrackState< 5 >.

Definition at line 99 of file MultiRefittedTS.h.

References computeFreeTrajectoryState(), stateWithNewWeight(), and theComponents.

100  {
101  return theComponents;
102  }
RTSvector theComponents
void MultiRefittedTS::computeFreeTrajectoryState ( ) const
private

Definition at line 33 of file MultiRefittedTS.cc.

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

Referenced by components(), and freeTrajectoryState().

34 {
35  if (surf) {
37  } else {
38  double maxWeight = -1.;
39  RTSvector::const_iterator maxIt;
40  for (RTSvector::const_iterator it = theComponents.begin();
41  it != theComponents.end(); it++) {
42  if ( (**it).weight() > maxWeight ) {
43  maxWeight = (**it).weight();
44  maxIt = it;
45  }
46  }
47 
48  TransverseImpactPointExtrapolator tipe(&((**maxIt).freeTrajectoryState().parameters().magneticField()));
49  TrajectoryStateOnSurface initialTSOS = tipe.extrapolate((**maxIt).freeTrajectoryState(), refPosition);
50 
52  }
53  ftsAvailable = true;
54 }
FreeTrajectoryState fts
FreeTrajectoryState freeTrajectoryState() const override
TrajectoryStateOnSurface trajectoryStateOnSurface(const Surface &surface) const override
const GlobalPoint refPosition
const SurfaceType & surface() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
RTSvector theComponents
MultiRefittedTS::AlgebraicSymMatrixNN MultiRefittedTS::covariance ( void  ) const
overridevirtual

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

The covariance matrix

Implements RefittedTrackState< 5 >.

Definition at line 72 of file MultiRefittedTS.cc.

Referenced by ~MultiRefittedTS().

73 {
74  throw VertexException
75  ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
76 }
Common base class.
FreeTrajectoryState MultiRefittedTS::freeTrajectoryState ( ) const
overridevirtual

Returns a FreeTrajectoryState. It will be the FTS of the single, collapsed state.

Transformation into a FreeTrajectoryState

Implements RefittedTrackState< 5 >.

Definition at line 27 of file MultiRefittedTS.cc.

References computeFreeTrajectoryState(), fts, and ftsAvailable.

Referenced by computeFreeTrajectoryState(), transientTrack(), and ~MultiRefittedTS().

28 {
30  return fts;
31 }
void computeFreeTrajectoryState() const
FreeTrajectoryState fts
MultiRefittedTS::AlgebraicVectorM MultiRefittedTS::momentumVector ( ) const
overridevirtual

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.

Vector containing the parameters describing the momentum as the vertex. These are (signed transverse curvature, theta, phi)

Implements RefittedTrackState< 5 >.

Definition at line 93 of file MultiRefittedTS.cc.

Referenced by ~MultiRefittedTS().

94 {
95  throw VertexException
96  ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
97 }
Common base class.
MultiRefittedTS::AlgebraicVectorN MultiRefittedTS::parameters ( void  ) const
overridevirtual

Vector containing the refitted track parameters. Not possible yet for a multi-state, throws an exception.

Vector containing the refitted track parameters.
These are (signed transverse curvature, theta, phi, (signed) transverse , longitudinal impact parameter)

Implements RefittedTrackState< 5 >.

Definition at line 62 of file MultiRefittedTS.cc.

Referenced by ~MultiRefittedTS().

63 {
64  throw VertexException
65  ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
66 }
Common base class.
GlobalPoint MultiRefittedTS::position ( ) const
overridevirtual

Position at which the momentum is defined. Not possible yet for a multi-state, throws an exception.

Position at which the momentum is defined.

Implements RefittedTrackState< 5 >.

Definition at line 82 of file MultiRefittedTS.cc.

Referenced by ~MultiRefittedTS().

83 {
84  throw VertexException
85  ("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
86 }
Common base class.
ReferenceCountingPointer< RefittedTrackState< 5 > > MultiRefittedTS::stateWithNewWeight ( const double  newWeight) const
overridevirtual

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 MultiRefittedTS(), refPosition, refSurface, surf, theComponents, and weight().

Referenced by components().

118 {
119  if (weight() < DBL_MIN) {
120  throw VertexException
121  ("MultiRefittedTS::stateWithNewWeight(): Can not reweight multi-state with total weight < DBL_MIN");
122  }
123  double factor = newWeight/weight();
124 
125  RTSvector reWeightedRTSC;
126  reWeightedRTSC.reserve(theComponents.size());
127 
128  for (RTSvector::const_iterator it = theComponents.begin();
129  it != theComponents.end(); it++) {
130  reWeightedRTSC.push_back((**it).stateWithNewWeight((**it).weight()*factor));
131  }
132  if (surf) {
133  return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, *refSurface));
134  } else {
135  return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, refPosition));
136  }
137 }
MultiRefittedTS(const std::vector< RefCountedRefittedTrackState > &prtsComp, const Surface &referenceSurface)
Common base class.
double weight() const override
ReferenceCountingPointer< RefittedTrackState< 5 > > RefCountedRefittedTrackState
const GlobalPoint refPosition
std::vector< RefCountedRefittedTrackState > RTSvector
RTSvector theComponents
ConstReferenceCountingPointer< Surface > refSurface
TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface ( const Surface surface) const
overridevirtual

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 theComponents.

Referenced by computeFreeTrajectoryState(), and ~MultiRefittedTS().

144 {
145  vector<TrajectoryStateOnSurface> tsosComponents;
146  tsosComponents.reserve(theComponents.size());
147  for (RTSvector::const_iterator it = theComponents.begin();
148  it != theComponents.end(); it++) {
149  tsosComponents.push_back((**it).trajectoryStateOnSurface(surface));
150  }
152 }
RTSvector theComponents
TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface ( const Surface surface,
const Propagator propagator 
) const
overridevirtual

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

Implements RefittedTrackState< 5 >.

Definition at line 154 of file MultiRefittedTS.cc.

References theComponents.

156 { //fixme... is the propagation done correctly? Is there a gsf propagator?
157  vector<TrajectoryStateOnSurface> tsosComponents;
158  tsosComponents.reserve(theComponents.size());
159  for (RTSvector::const_iterator it = theComponents.begin();
160  it != theComponents.end(); it++) {
161  tsosComponents.push_back((**it).trajectoryStateOnSurface(surface, propagator));
162  }
164 }
RTSvector theComponents
reco::TransientTrack MultiRefittedTS::transientTrack ( ) const
overridevirtual

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 166 of file MultiRefittedTS.cc.

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

Referenced by ~MultiRefittedTS().

167 {
169  return factory.build(freeTrajectoryState());
170 }
FreeTrajectoryState freeTrajectoryState() const override
reco::TransientTrack build(const FreeTrajectoryState &fts) const
double MultiRefittedTS::weight ( ) const
overridevirtual

The weight of this component in a mixture

Implements RefittedTrackState< 5 >.

Definition at line 99 of file MultiRefittedTS.cc.

References gather_cfg::cout, theComponents, totalWeight, and totalWeightAvailable.

Referenced by stateWithNewWeight(), and ~MultiRefittedTS().

100 {
102  {
103  totalWeight = 0.;
104  if (theComponents.empty()) {
105  cout << "Asking for weight of empty MultiRefittedTS, returning zero!" << endl;
106  }
107  for (RTSvector::const_iterator it = theComponents.begin();
108  it != theComponents.end(); it++) {
109  totalWeight += (**it).weight();
110  }
111  }
112  return totalWeight;
113 }
RTSvector theComponents

Member Data Documentation

FreeTrajectoryState MultiRefittedTS::fts
mutableprivate

Definition at line 126 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and freeTrajectoryState().

bool MultiRefittedTS::ftsAvailable
mutableprivate

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
mutableprivate
double MultiRefittedTS::totalWeight
mutableprivate

Definition at line 125 of file MultiRefittedTS.h.

Referenced by weight().

bool MultiRefittedTS::totalWeightAvailable
mutableprivate

Definition at line 124 of file MultiRefittedTS.h.

Referenced by weight().