CMS 3D CMS Logo

VirtualKinematicParticle.cc
Go to the documentation of this file.
3 
5  (const KinematicState& kineState, float& chiSquared, float& degreesOfFr,
6  KinematicConstraint * lastConstraint,
9 {
10  theField = kineState.magneticField();
11  if(previousParticle.get() == nullptr)
12  {
13  initState = kineState;
14  }else{initState = previousParticle->initialState();}
15  cState = kineState;
16  pState = previousParticle;
17  chi2 = chiSquared;
18  ndf = degreesOfFr;
19  lConstraint = lastConstraint;
20  if(pr != nullptr)
21  {
22  propagator = pr->clone();
23  }else{
25  }
26  tree = nullptr;
27 }
28 
30 {delete propagator;}
31 
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 }
42 
44 {
45  bool res = false;
46  if(*this == *other) res = true;
47  return res;
48 }
49 
51 {
52  if (*this == other){
53  return false;
54  }else{return true;}
55 }
56 
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);} }
64 
66  float chi2, float ndf, KinematicConstraint * cons)const
67 {
68  VirtualKinematicParticle * ncp = const_cast<VirtualKinematicParticle * >(this);
70  return ReferenceCountingPointer<KinematicParticle>(new VirtualKinematicParticle(state,chi2,ndf,cons,current,
71  propagator));
72 }
73 
76 {
77  VirtualKinematicParticle * cr = const_cast<VirtualKinematicParticle * >(this);
79  return linFactory.linearizedTrackState(point,lp);
80 }
virtual KinematicState propagateToTheTransversePCA(const KinematicState &state, const GlobalPoint &point) const =0
T y() const
Definition: PV3DBase.h:63
ParticleKinematicLinearizedTrackStateFactory linFactory
virtual KinematicStatePropagator * clone() const =0
RefCountedKinematicParticle refittedParticle(const KinematicState &state, float chi2, float ndf, KinematicConstraint *cons=0) const override
Definition: Electron.h:6
KinematicState cState
T z() const
Definition: PV3DBase.h:64
KinematicParameters const & kinematicParameters() const
const MagneticField * magneticField() const
bool operator==(const KinematicParticle &other) const override
bool operator!=(const KinematicParticle &other) const override
VirtualKinematicParticle(const KinematicState &kineState, float &chiSquared, float &degreesOfFr, KinematicConstraint *lastConstraint, ReferenceCountingPointer< KinematicParticle > previousParticle, KinematicStatePropagator *pr)
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, RefCountedKinematicParticle &prt) const
virtual KinematicState initialState() const
RefCountedLinearizedTrackState particleLinearizedTrackState(const GlobalPoint &point) const override
KinematicStatePropagator * propagator
Definition: tree.py:1
T x() const
Definition: PV3DBase.h:62
*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
GlobalPoint position() const
KinematicState stateAtPoint(const GlobalPoint &point) const override