CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
BasicMultiVertexState Class Reference

#include <BasicMultiVertexState.h>

Inheritance diagram for BasicMultiVertexState:
BasicVertexState ReferenceCounted

Public Member Functions

 BasicMultiVertexState ()
 
 BasicMultiVertexState (const std::vector< VertexState > &vsComp)
 
virtual BasicMultiVertexStateclone () const
 
virtual std::vector< VertexStatecomponents () const
 
GlobalError error () const
 
GlobalError error4D () const
 
bool is4D () const
 
bool isValid () const
 
GlobalPoint position () const
 
double time () const
 
double timeError () const
 
GlobalWeight weight () const
 
GlobalWeight weight4D () const
 
double weightInMixture () const
 
AlgebraicVector3 weightTimesPosition () const
 
AlgebraicVector4 weightTimesPosition4D () const
 
- Public Member Functions inherited from BasicVertexState
virtual ~BasicVertexState ()
 

Private Member Functions

void checkCombinedState () const
 

Private Attributes

VertexState theCombinedState
 
bool theCombinedStateUp2Date
 
MultiVertexStateCombiner theCombiner
 
std::vector< VertexStatetheComponents
 
bool valid
 

Additional Inherited Members

- Public Types inherited from BasicVertexState
typedef ProxyBase
< BasicVertexState,
CopyUsingClone
< BasicVertexState > > 
Proxy
 
typedef
ReferenceCountingPointer
< BasicVertexState
RCPtr
 

Detailed Description

Multi state measurement of a vertex. Some data is calculated on demand to improve performance.

Definition at line 12 of file BasicMultiVertexState.h.

Constructor & Destructor Documentation

BasicMultiVertexState::BasicMultiVertexState ( )
inline

Constructors

Definition at line 18 of file BasicMultiVertexState.h.

Referenced by clone().

18 : valid(false){}
BasicMultiVertexState::BasicMultiVertexState ( const std::vector< VertexState > &  vsComp)

Definition at line 7 of file BasicMultiVertexState.cc.

7  :
8  valid(true), theComponents(vsComp), theCombinedStateUp2Date( false) {}
std::vector< VertexState > theComponents

Member Function Documentation

void BasicMultiVertexState::checkCombinedState ( ) const
private

Definition at line 89 of file BasicMultiVertexState.cc.

References MultiVertexStateCombiner::combine(), theCombinedState, theCombinedStateUp2Date, theCombiner, theComponents, and valid.

Referenced by error(), error4D(), is4D(), position(), time(), timeError(), weight(), weight4D(), weightTimesPosition(), and weightTimesPosition4D().

90 {
91  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
92  if (theCombinedStateUp2Date) return;
93 
96 }
VertexState combine(const VSC &theMixture) const
Common base class.
MultiVertexStateCombiner theCombiner
std::vector< VertexState > theComponents
virtual BasicMultiVertexState* BasicMultiVertexState::clone ( void  ) const
inlinevirtual

Access methods

Implements BasicVertexState.

Definition at line 24 of file BasicMultiVertexState.h.

References BasicMultiVertexState().

25  {
26  return new BasicMultiVertexState(*this);
27  }
virtual std::vector<VertexState> BasicMultiVertexState::components ( ) const
inlinevirtual

Vector of individual components in the mixture.

Reimplemented from BasicVertexState.

Definition at line 88 of file BasicMultiVertexState.h.

References theComponents.

88  {
89  return theComponents;
90  }
std::vector< VertexState > theComponents
GlobalError BasicMultiVertexState::error ( ) const
virtual

Mean covariance matrix of the mixture (covariance matrix of the collapsed state)

Implements BasicVertexState.

Definition at line 24 of file BasicMultiVertexState.cc.

References checkCombinedState(), VertexState::error(), and theCombinedState.

25 {
27  return theCombinedState.error();
28 }
GlobalError error() const
Definition: VertexState.h:74
GlobalError BasicMultiVertexState::error4D ( ) const
virtual

Mean covariance matrix of the mixture (covariance matrix of the collapsed state)

Implements BasicVertexState.

Definition at line 36 of file BasicMultiVertexState.cc.

References checkCombinedState(), VertexState::error4D(), and theCombinedState.

37 {
39  return theCombinedState.error4D();
40 }
GlobalError error4D() const
Definition: VertexState.h:80
bool BasicMultiVertexState::is4D ( ) const
inlinevirtual

Implements BasicVertexState.

Definition at line 97 of file BasicMultiVertexState.h.

References checkCombinedState(), VertexState::is4D(), and theCombinedState.

bool is4D() const
Definition: VertexState.h:133
bool BasicMultiVertexState::isValid ( void  ) const
inlinevirtual

The validity of the vertex

Implements BasicVertexState.

Definition at line 95 of file BasicMultiVertexState.h.

References valid.

Referenced by ntuple._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

GlobalPoint BasicMultiVertexState::position ( ) const
virtual

Mean position of the mixture (position of the collapsed state)

Implements BasicVertexState.

Definition at line 11 of file BasicMultiVertexState.cc.

References checkCombinedState(), VertexState::position(), and theCombinedState.

12 {
14  return theCombinedState.position();
15 }
GlobalPoint position() const
Definition: VertexState.h:69
double BasicMultiVertexState::time ( ) const
virtual

Mean time of the mixture (time of the collapsed state)

Implements BasicVertexState.

Definition at line 17 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::time().

18 {
20  return theCombinedState.time();
21 }
double time() const
Definition: VertexState.h:95
double BasicMultiVertexState::timeError ( ) const
virtual

Mean covariance matrix of the mixture (covariance matrix of the collapsed state)

Implements BasicVertexState.

Definition at line 30 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::timeError().

31 {
33  return theCombinedState.timeError();
34 }
double timeError() const
Definition: VertexState.h:99
GlobalWeight BasicMultiVertexState::weight ( void  ) const
virtual

Mean weight matrix (inverse of covariance) of the mixture ( weight matrix of the collapsed state)

Implements BasicVertexState.

Definition at line 42 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::weight().

Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), and weightInMixture().

43 {
45  return theCombinedState.weight();
46 }
GlobalWeight weight() const
Definition: VertexState.h:85
GlobalWeight BasicMultiVertexState::weight4D ( ) const
virtual

Mean weight matrix (inverse of covariance) of the mixture ( weight matrix of the collapsed state)

Implements BasicVertexState.

Definition at line 48 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::weight4D().

49 {
51  return theCombinedState.weight4D();
52 }
GlobalWeight weight4D() const
Definition: VertexState.h:90
double BasicMultiVertexState::weightInMixture ( ) const
virtual

The weight of this state. It will be the sum of the weights of the individual components in the mixture.

Implements BasicVertexState.

Definition at line 73 of file BasicMultiVertexState.cc.

References gather_cfg::cout, theComponents, valid, and weight().

73  {
74  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
75  if (theComponents.empty()) {
76  cout << "Asking for weight of empty MultiVertexState, returning zero!" << endl;
77  throw VertexException("Asking for weight of empty MultiVertexState, returning zero!");
78  return 0.;
79  }
80 
81  double weight = 0.;
82  for (vector<VertexState>::const_iterator it = theComponents.begin();
83  it != theComponents.end(); it++) {
84  weight += it->weightInMixture();
85  }
86  return weight;
87 }
Common base class.
std::vector< VertexState > theComponents
GlobalWeight weight() const
tuple cout
Definition: gather_cfg.py:145
AlgebraicVector3 BasicMultiVertexState::weightTimesPosition ( ) const
virtual

Mean (weight*position) matrix of the mixture

Implements BasicVertexState.

Definition at line 54 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::weightTimesPosition().

55 {
58 }
AlgebraicVector3 weightTimesPosition() const
Definition: VertexState.h:103
AlgebraicVector4 BasicMultiVertexState::weightTimesPosition4D ( ) const
virtual

Mean (weight*position) matrix of the mixture

Implements BasicVertexState.

Definition at line 60 of file BasicMultiVertexState.cc.

References checkCombinedState(), theCombinedState, and VertexState::weightTimesPosition4D().

61 {
64 }
AlgebraicVector4 weightTimesPosition4D() const
Definition: VertexState.h:108

Member Data Documentation

VertexState BasicMultiVertexState::theCombinedState
mutableprivate
bool BasicMultiVertexState::theCombinedStateUp2Date
mutableprivate

Definition at line 106 of file BasicMultiVertexState.h.

Referenced by checkCombinedState().

MultiVertexStateCombiner BasicMultiVertexState::theCombiner
private

Definition at line 108 of file BasicMultiVertexState.h.

Referenced by checkCombinedState().

std::vector<VertexState> BasicMultiVertexState::theComponents
mutableprivate

Definition at line 104 of file BasicMultiVertexState.h.

Referenced by checkCombinedState(), components(), and weightInMixture().

bool BasicMultiVertexState::valid
private

Definition at line 103 of file BasicMultiVertexState.h.

Referenced by checkCombinedState(), isValid(), and weightInMixture().