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=0) 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 ( 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 5 of file VirtualKinematicParticle.cc.

References vertices_cff::chi2, KinematicStatePropagator::clone(), KinematicState::magneticField(), and PhotonConversionTrajectorySeedProducerFromQuadruplets_cfi::propagator.

Referenced by refittedParticle().

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

Definition at line 29 of file VirtualKinematicParticle.cc.

References propagator.

30 {delete propagator;}
KinematicStatePropagator * propagator

Member Function Documentation

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

Implements KinematicParticle.

Definition at line 50 of file VirtualKinematicParticle.cc.

51 {
52  if (*this == other){
53  return false;
54  }else{return true;}
55 }
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 32 of file VirtualKinematicParticle.cc.

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

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

Implements KinematicParticle.

Definition at line 43 of file VirtualKinematicParticle.cc.

44 {
45  bool res = false;
46  if(*this == *other) res = true;
47  return res;
48 }
Definition: Electron.h:4
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 75 of file VirtualKinematicParticle.cc.

References ParticleKinematicLinearizedTrackStateFactory::linearizedTrackState(), and linFactory.

76 {
77  VirtualKinematicParticle * cr = const_cast<VirtualKinematicParticle * >(this);
79  return linFactory.linearizedTrackState(point,lp);
80 }
ParticleKinematicLinearizedTrackStateFactory linFactory
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, RefCountedKinematicParticle &prt) const
RefCountedKinematicParticle VirtualKinematicParticle::refittedParticle ( const KinematicState state,
float  chi2,
float  ndf,
KinematicConstraint cons = 0 
) 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 65 of file VirtualKinematicParticle.cc.

References propagator, and VirtualKinematicParticle().

67 {
68  VirtualKinematicParticle * ncp = const_cast<VirtualKinematicParticle * >(this);
71  propagator));
72 }
VirtualKinematicParticle(const KinematicState &kineState, float &chiSquared, float &degreesOfFr, KinematicConstraint *lastConstraint, ReferenceCountingPointer< KinematicParticle > previousParticle, KinematicStatePropagator *pr)
KinematicStatePropagator * propagator
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(), KinematicParameters::position(), KinematicStatePropagator::propagateToTheTransversePCA(), propagator, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

58 {
60  if((iP.x() == point.x())&&(iP.y() == point.y())&&(iP.z() == point.z()))
61  {
62  return cState ;
63  }else{return propagator->propagateToTheTransversePCA(cState,point);} }
virtual KinematicState propagateToTheTransversePCA(const KinematicState &state, const GlobalPoint &point) const =0
T y() const
Definition: PV3DBase.h:63
KinematicState cState
T z() const
Definition: PV3DBase.h:64
KinematicParameters const & kinematicParameters() const
KinematicStatePropagator * propagator
T x() const
Definition: PV3DBase.h:62
GlobalPoint position() const

Member Data Documentation

ParticleKinematicLinearizedTrackStateFactory VirtualKinematicParticle::linFactory
private

Definition at line 72 of file VirtualKinematicParticle.h.

Referenced by particleLinearizedTrackState().

KinematicStatePropagator* VirtualKinematicParticle::propagator
private