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
 
bool isValid () const
 
GlobalPoint position () const
 
GlobalWeight weight () const
 
double weightInMixture () const
 
AlgebraicVector3 weightTimesPosition () 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 61 of file BasicMultiVertexState.cc.

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

Referenced by error(), position(), weight(), and weightTimesPosition().

62 {
63  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
64  if (theCombinedStateUp2Date) return;
65 
68 }
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 60 of file BasicMultiVertexState.h.

References theComponents.

60  {
61  return theComponents;
62  }
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 18 of file BasicMultiVertexState.cc.

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

19 {
21  return theCombinedState.error();
22 }
GlobalError error() const
Definition: VertexState.h:55
bool BasicMultiVertexState::isValid ( void  ) const
inlinevirtual

The validity of the vertex

Implements BasicVertexState.

Definition at line 67 of file BasicMultiVertexState.h.

References valid.

Referenced by 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:50
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 25 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().

26 {
28  return theCombinedState.weight();
29 }
GlobalWeight weight() const
Definition: VertexState.h:60
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 45 of file BasicMultiVertexState.cc.

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

45  {
46  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
47  if (theComponents.empty()) {
48  cout << "Asking for weight of empty MultiVertexState, returning zero!" << endl;
49  throw VertexException("Asking for weight of empty MultiVertexState, returning zero!");
50  return 0.;
51  }
52 
53  double weight = 0.;
54  for (vector<VertexState>::const_iterator it = theComponents.begin();
55  it != theComponents.end(); it++) {
56  weight += it->weightInMixture();
57  }
58  return weight;
59 }
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 32 of file BasicMultiVertexState.cc.

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

33 {
36 }
AlgebraicVector3 weightTimesPosition() const
Definition: VertexState.h:65

Member Data Documentation

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

Definition at line 76 of file BasicMultiVertexState.h.

Referenced by checkCombinedState().

MultiVertexStateCombiner BasicMultiVertexState::theCombiner
private

Definition at line 78 of file BasicMultiVertexState.h.

Referenced by checkCombinedState().

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

Definition at line 74 of file BasicMultiVertexState.h.

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

bool BasicMultiVertexState::valid
private

Definition at line 73 of file BasicMultiVertexState.h.

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