CMS 3D CMS Logo

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

#include <VirtualKinematicParticle.h>

Inheritance diagram for VirtualKinematicParticle:
KinematicParticle ReferenceCounted

Public Member Functions

bool operator!= (const KinematicParticle &other) const override
 
bool operator== (const KinematicParticle &other) const override
 
bool operator== (const ReferenceCountingPointer< KinematicParticle > &other) const override
 
RefCountedLinearizedTrackState particleLinearizedTrackState (const GlobalPoint &point) const override
 
RefCountedKinematicParticle refittedParticle (const KinematicState &state, float chi2, float ndf, KinematicConstraint *cons=nullptr) const override
 
KinematicState stateAtPoint (const GlobalPoint &point) const override
 
 VirtualKinematicParticle (const KinematicState &kineState, float &chiSquared, float &degreesOfFr, KinematicConstraint *lastConstraint, ReferenceCountingPointer< KinematicParticle > previousParticle, KinematicStatePropagator *pr)
 
 ~VirtualKinematicParticle () override
 
- Public Member Functions inherited from KinematicParticle
virtual float chiSquared () const
 
virtual KinematicTreecorrespondingTree () const
 
virtual KinematicState currentState () const
 
virtual float degreesOfFreedom () const
 
virtual KinematicState initialState () const
 
 KinematicParticle ()
 
virtual KinematicConstraintlastConstraint () const
 
const MagneticFieldmagneticField () const
 
virtual bool operator< (const KinematicParticle &other) const
 
virtual ReferenceCountingPointer< KinematicParticlepreviousParticle () const
 
reco::TransientTrack refittedTransientTrack () const
 
 ~KinematicParticle () override
 

Private Attributes

ParticleKinematicLinearizedTrackStateFactory linFactory
 
KinematicStatePropagatorpropagator
 

Additional Inherited Members

- Public Types inherited from KinematicParticle
typedef ReferenceCountingPointer< LinearizedTrackState< 6 > > RefCountedLinearizedTrackState
 
- Protected Member Functions inherited from KinematicParticle
virtual void setTreePointer (KinematicTree *tr) const
 
- Protected Attributes inherited from KinematicParticle
float chi2
 
KinematicState cState
 
KinematicState initState
 
KinematicConstraintlConstraint
 
float ndf
 
ReferenceCountingPointer< KinematicParticlepState
 
const MagneticFieldtheField
 
KinematicTreetree
 

Detailed Description

Class representing KinematicParticle created as a result of kinematic fit. uses the same state propagator as a TransientTrackKinematicParticle

Definition at line 14 of file VirtualKinematicParticle.h.

Constructor & Destructor Documentation

◆ VirtualKinematicParticle()

VirtualKinematicParticle::VirtualKinematicParticle ( const KinematicState kineState,
float &  chiSquared,
float &  degreesOfFr,
KinematicConstraint lastConstraint,
ReferenceCountingPointer< KinematicParticle previousParticle,
KinematicStatePropagator pr 
)

Constructor using KinematicState, Previous state of particle and last constraint used . All the pointers can be set to 0 if there's no such information available. Constructor should be use by specific factory only. Propagator for TransientTrackKinematicState is used.

Definition at line 4 of file VirtualKinematicParticle.cc.

References KinematicParticle::chi2, KinematicParticle::chiSquared(), KinematicParticle::cState, KinematicParticle::initState, KinematicParticle::lastConstraint(), KinematicParticle::lConstraint, KinematicState::magneticField(), KinematicParticle::ndf, KinematicParticle::previousParticle(), propagator, KinematicParticle::pState, and KinematicParticle::theField.

Referenced by refittedParticle().

9  {
10  theField = kineState.magneticField();
11  if (previousParticle.get() == nullptr) {
12  initState = kineState;
13  } else {
14  initState = previousParticle->initialState();
15  }
16  cState = kineState;
18  chi2 = chiSquared;
19  ndf = degreesOfFr;
21  if (pr != nullptr) {
22  propagator = pr->clone();
23  } else {
25  }
26  tree = nullptr;
27 }
ReferenceCountingPointer< KinematicParticle > pState
virtual ReferenceCountingPointer< KinematicParticle > previousParticle() const
KinematicState cState
virtual float chiSquared() const
KinematicConstraint * lConstraint
KinematicState initState
virtual KinematicConstraint * lastConstraint() const
const MagneticField * theField
const MagneticField * magneticField() const
KinematicStatePropagator * propagator
Definition: tree.py:1

◆ ~VirtualKinematicParticle()

VirtualKinematicParticle::~VirtualKinematicParticle ( )
override

Definition at line 29 of file VirtualKinematicParticle.cc.

References propagator.

29 { delete propagator; }
KinematicStatePropagator * propagator

Member Function Documentation

◆ operator!=()

bool VirtualKinematicParticle::operator!= ( const KinematicParticle other) const
overridevirtual

Implements KinematicParticle.

Definition at line 49 of file VirtualKinematicParticle.cc.

References trackingPlots::other.

49  {
50  if (*this == other) {
51  return false;
52  } else {
53  return true;
54  }
55 }

◆ operator==() [1/2]

bool VirtualKinematicParticle::operator== ( const KinematicParticle other) const
overridevirtual

Comparison by contents operator Returns TRUE if initial TransientTracks match(if they exist). If not, compares the initial KinematicStates Retunes true if they match.

Implements KinematicParticle.

Definition at line 31 of file VirtualKinematicParticle.cc.

References KinematicParticle::initialState(), and trackingPlots::other.

31  {
32  bool dc = false;
33 
34  //first looking if this is an object of the same type
35  const KinematicParticle* lp = &other;
36  const VirtualKinematicParticle* lPart = dynamic_cast<const VirtualKinematicParticle*>(lp);
37  if (lPart != nullptr && initialState() == lPart->initialState())
38  dc = true;
39  return dc;
40 }
virtual KinematicState initialState() const

◆ operator==() [2/2]

bool VirtualKinematicParticle::operator== ( const ReferenceCountingPointer< KinematicParticle > &  other) const
overridevirtual

Implements KinematicParticle.

Definition at line 42 of file VirtualKinematicParticle.cc.

References trackingPlots::other.

42  {
43  bool res = false;
44  if (*this == *other)
45  res = true;
46  return res;
47 }
Definition: Electron.h:6

◆ particleLinearizedTrackState()

VirtualKinematicParticle::RefCountedLinearizedTrackState VirtualKinematicParticle::particleLinearizedTrackState ( const GlobalPoint point) const
overridevirtual

Method returning LinearizedTrackState of the particle needed for Kalman flter vertex fit. This implementation uses the ParticleLinearizedTrackStateFactory class.

Implements KinematicParticle.

Definition at line 76 of file VirtualKinematicParticle.cc.

References ParticleKinematicLinearizedTrackStateFactory::linearizedTrackState(), linFactory, and point.

77  {
78  VirtualKinematicParticle* cr = const_cast<VirtualKinematicParticle*>(this);
81 }
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, RefCountedKinematicParticle &prt) const
ParticleKinematicLinearizedTrackStateFactory linFactory
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

◆ refittedParticle()

RefCountedKinematicParticle VirtualKinematicParticle::refittedParticle ( const KinematicState state,
float  chi2,
float  ndf,
KinematicConstraint cons = nullptr 
) const
overridevirtual

Method producing new particle with refitted parameters. Current state is then shifted to previous state. RCP<VirtualKinematicParticle> is returned.

Implements KinematicParticle.

Definition at line 66 of file VirtualKinematicParticle.cc.

References KinematicParticle::chi2, KinematicParticle::ndf, propagator, and VirtualKinematicParticle().

69  {
70  VirtualKinematicParticle* ncp = const_cast<VirtualKinematicParticle*>(this);
73  new VirtualKinematicParticle(state, chi2, ndf, cons, current, propagator));
74 }
VirtualKinematicParticle(const KinematicState &kineState, float &chiSquared, float &degreesOfFr, KinematicConstraint *lastConstraint, ReferenceCountingPointer< KinematicParticle > previousParticle, KinematicStatePropagator *pr)
KinematicStatePropagator * propagator

◆ stateAtPoint()

KinematicState VirtualKinematicParticle::stateAtPoint ( const GlobalPoint point) const
overridevirtual

Access to KinematicState of particle at given point

Implements KinematicParticle.

Definition at line 57 of file VirtualKinematicParticle.cc.

References KinematicParticle::cState, KinematicState::kinematicParameters(), point, KinematicParameters::position(), KinematicStatePropagator::propagateToTheTransversePCA(), propagator, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

57  {
59  if ((iP.x() == point.x()) && (iP.y() == point.y()) && (iP.z() == point.z())) {
60  return cState;
61  } else {
63  }
64 }
T z() const
Definition: PV3DBase.h:61
virtual KinematicState propagateToTheTransversePCA(const KinematicState &state, const GlobalPoint &point) const =0
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
KinematicState cState
KinematicParameters const & kinematicParameters() const
GlobalPoint position() const
KinematicStatePropagator * propagator
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

Member Data Documentation

◆ linFactory

ParticleKinematicLinearizedTrackStateFactory VirtualKinematicParticle::linFactory
private

Definition at line 73 of file VirtualKinematicParticle.h.

Referenced by particleLinearizedTrackState().

◆ propagator

KinematicStatePropagator* VirtualKinematicParticle::propagator
private