CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, N
AlgebraicVectorN
 

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

Definition at line 20 of file MultiRefittedTS.h.

Definition at line 19 of file MultiRefittedTS.h.

Definition at line 109 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 11 of file MultiRefittedTS.cc.

Referenced by stateWithNewWeight().

13  : theComponents(prtsComp), ftsAvailable(false), refSurface(&referenceSurface), 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 15 of file MultiRefittedTS.cc.

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

Definition at line 35 of file MultiRefittedTS.h.

35 {}

Member Function Documentation

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

Implements RefittedTrackState< 5 >.

Definition at line 94 of file MultiRefittedTS.h.

References theComponents.

94 { return theComponents; }
RTSvector theComponents
void MultiRefittedTS::computeFreeTrajectoryState ( ) const
private

Definition at line 29 of file MultiRefittedTS.cc.

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

Referenced by freeTrajectoryState().

29  {
30  if (surf) {
32  } else {
33  double maxWeight = -1.;
34  RTSvector::const_iterator maxIt;
35  for (RTSvector::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) {
36  if ((**it).weight() > maxWeight) {
37  maxWeight = (**it).weight();
38  maxIt = it;
39  }
40  }
41 
42  TransverseImpactPointExtrapolator tipe(&((**maxIt).freeTrajectoryState().parameters().magneticField()));
43  TrajectoryStateOnSurface initialTSOS = tipe.extrapolate((**maxIt).freeTrajectoryState(), refPosition);
44 
46  }
47  ftsAvailable = true;
48 }
FreeTrajectoryState fts
const GlobalPoint refPosition
const SurfaceType & surface() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface trajectoryStateOnSurface(const Surface &surface) const override
FreeTrajectoryState freeTrajectoryState() const override
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 64 of file MultiRefittedTS.cc.

64  {
65  throw VertexException("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
66 }
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 23 of file MultiRefittedTS.cc.

References computeFreeTrajectoryState(), fts, and ftsAvailable.

Referenced by computeFreeTrajectoryState(), and transientTrack().

23  {
24  if (!ftsAvailable)
26  return fts;
27 }
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 81 of file MultiRefittedTS.cc.

81  {
82  throw VertexException("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
83 }
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 56 of file MultiRefittedTS.cc.

56  {
57  throw VertexException("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
58 }
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 72 of file MultiRefittedTS.cc.

72  {
73  throw VertexException("MultiRefittedTS::freeTrajectoryState(): Don't know how to do that yet...");
74 }
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 98 of file MultiRefittedTS.cc.

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

98  {
99  if (weight() < DBL_MIN) {
100  throw VertexException(
101  "MultiRefittedTS::stateWithNewWeight(): Can not reweight multi-state with total weight < DBL_MIN");
102  }
103  double factor = newWeight / weight();
104 
105  RTSvector reWeightedRTSC;
106  reWeightedRTSC.reserve(theComponents.size());
107 
108  for (RTSvector::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) {
109  reWeightedRTSC.push_back((**it).stateWithNewWeight((**it).weight() * factor));
110  }
111  if (surf) {
112  return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, *refSurface));
113  } else {
114  return RefCountedRefittedTrackState(new MultiRefittedTS(reWeightedRTSC, refPosition));
115  }
116 }
MultiRefittedTS(const std::vector< RefCountedRefittedTrackState > &prtsComp, const Surface &referenceSurface)
Common base class.
ReferenceCountingPointer< RefittedTrackState< 5 > > RefCountedRefittedTrackState
std::vector< RefCountedRefittedTrackState > RTSvector
const GlobalPoint refPosition
RTSvector theComponents
ConstReferenceCountingPointer< Surface > refSurface
double weight() const override
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 121 of file MultiRefittedTS.cc.

References theComponents.

Referenced by computeFreeTrajectoryState().

121  {
122  vector<TrajectoryStateOnSurface> tsosComponents;
123  tsosComponents.reserve(theComponents.size());
124  for (RTSvector::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) {
125  tsosComponents.push_back((**it).trajectoryStateOnSurface(surface));
126  }
128 }
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 130 of file MultiRefittedTS.cc.

References theComponents.

131  { //fixme... is the propagation done correctly? Is there a gsf propagator?
132  vector<TrajectoryStateOnSurface> tsosComponents;
133  tsosComponents.reserve(theComponents.size());
134  for (RTSvector::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) {
135  tsosComponents.push_back((**it).trajectoryStateOnSurface(surface, propagator));
136  }
138 }
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 140 of file MultiRefittedTS.cc.

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

140  {
142  return factory.build(freeTrajectoryState());
143 }
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 85 of file MultiRefittedTS.cc.

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

Referenced by stateWithNewWeight().

85  {
86  if (!totalWeightAvailable) {
87  totalWeight = 0.;
88  if (theComponents.empty()) {
89  cout << "Asking for weight of empty MultiRefittedTS, returning zero!" << endl;
90  }
91  for (RTSvector::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) {
92  totalWeight += (**it).weight();
93  }
94  }
95  return totalWeight;
96 }
tuple cout
Definition: gather_cfg.py:144
RTSvector theComponents

Member Data Documentation

FreeTrajectoryState MultiRefittedTS::fts
mutableprivate

Definition at line 114 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and freeTrajectoryState().

bool MultiRefittedTS::ftsAvailable
mutableprivate

Definition at line 112 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and freeTrajectoryState().

const GlobalPoint MultiRefittedTS::refPosition
private

Definition at line 115 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and stateWithNewWeight().

ConstReferenceCountingPointer<Surface> MultiRefittedTS::refSurface
private

Definition at line 116 of file MultiRefittedTS.h.

Referenced by stateWithNewWeight().

const bool MultiRefittedTS::surf
private

Definition at line 117 of file MultiRefittedTS.h.

Referenced by computeFreeTrajectoryState(), and stateWithNewWeight().

RTSvector MultiRefittedTS::theComponents
mutableprivate
double MultiRefittedTS::totalWeight
mutableprivate

Definition at line 113 of file MultiRefittedTS.h.

Referenced by weight().

bool MultiRefittedTS::totalWeightAvailable
mutableprivate

Definition at line 112 of file MultiRefittedTS.h.

Referenced by weight().