CMS 3D CMS Logo

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

#include <KinematicParticleVertexFitter.h>

Public Member Functions

RefCountedKinematicTree fit (const std::vector< RefCountedKinematicParticle > &particles) const
 
 KinematicParticleVertexFitter ()
 
 KinematicParticleVertexFitter (const edm::ParameterSet &pSet)
 
 ~KinematicParticleVertexFitter ()
 

Private Member Functions

edm::ParameterSet defaultParameters () const
 
void setup (const edm::ParameterSet &pSet)
 

Private Attributes

VertexFitter< 6 > * fitter
 
LinearizationPointFinderpointFinder
 
VertexTrackFactory< 6 > * vFactory
 

Detailed Description

Class creating a kinematic particle out of set of daughter particles. Daughter particles are supposed to come from a common vertex. Arbitrary VerexFitter can be used to fit the common vertex and refit the daughter particles with the knowledge of vertex. The Kinematic Vertex is also created and the resulting KinematicParticle points on it.

Kirill Prokofiev, December 2002

Definition at line 25 of file KinematicParticleVertexFitter.h.

Constructor & Destructor Documentation

◆ KinematicParticleVertexFitter() [1/2]

KinematicParticleVertexFitter::KinematicParticleVertexFitter ( )

Constructor with LMSLinearizationPointFinder used as default.

Definition at line 15 of file KinematicParticleVertexFitter.cc.

15  {
17  setup(pSet);
18 }

References defaultParameters(), and setup().

◆ KinematicParticleVertexFitter() [2/2]

KinematicParticleVertexFitter::KinematicParticleVertexFitter ( const edm::ParameterSet pSet)

Definition at line 20 of file KinematicParticleVertexFitter.cc.

20 { setup(pSet); }

References setup().

◆ ~KinematicParticleVertexFitter()

KinematicParticleVertexFitter::~KinematicParticleVertexFitter ( )

Definition at line 34 of file KinematicParticleVertexFitter.cc.

34  {
35  delete vFactory;
36  delete pointFinder;
37  delete fitter;
38 }

References fitter, pointFinder, and vFactory.

Member Function Documentation

◆ defaultParameters()

edm::ParameterSet KinematicParticleVertexFitter::defaultParameters ( ) const
private

Definition at line 40 of file KinematicParticleVertexFitter.cc.

40  {
41  edm::ParameterSet pSet;
42  pSet.addParameter<double>("maxDistance", 0.01);
43  pSet.addParameter<int>("maxNbrOfIterations", 100); //10
44  return pSet;
45 }

References edm::ParameterSet::addParameter().

Referenced by KinematicParticleVertexFitter().

◆ fit()

RefCountedKinematicTree KinematicParticleVertexFitter::fit ( const std::vector< RefCountedKinematicParticle > &  particles) const

Fit method taking set of particles, fitting them to the common vertex and creating tree out of them. Input particles can belong to kinmaticTrees. In such a case it should be TOP particle of corresponding tree.

Definition at line 47 of file KinematicParticleVertexFitter.cc.

48  {
49  typedef ReferenceCountingPointer<VertexTrack<6> > RefCountedVertexTrack;
50  //sorting the input
51  if (particles.size() < 2)
52  throw VertexException("KinematicParticleVertexFitter::input states are less than 2");
53  InputSort iSort;
54  std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> > input = iSort.sort(particles);
55  std::vector<RefCountedKinematicParticle> &newPart = input.first;
56  std::vector<FreeTrajectoryState> &freeStates = input.second;
57 
58  GlobalPoint linPoint = pointFinder->getLinearizationPoint(freeStates);
59 
60  // cout<<"Linearization point found"<<endl;
61 
62  //making initial veretx seed with lin point as position and a fake error
64  we(0, 0) = we(1, 1) = we(2, 2) = 10000.;
65  GlobalError error(we);
66  VertexState state(linPoint, error);
67 
68  //vector of Vertex Tracks to fit
69  std::vector<RefCountedVertexTrack> ttf;
71  for (auto const &i : newPart) {
72  if (!(i)->currentState().isValid() || !propagator_.willPropagateToTheTransversePCA((i)->currentState(), linPoint)) {
73  // std::cout << "Here's the bad state." << std::endl;
74  return ReferenceCountingPointer<KinematicTree>(new KinematicTree()); // return invalid vertex
75  }
76  ttf.push_back(vFactory->vertexTrack((i)->particleLinearizedTrackState(linPoint), state, 1.));
77  }
78 
79  // //debugging code to check neutrals:
80  // for(std::vector<RefCountedVertexTrack>::const_iterator i = ttf.begin(); i!=ttf.end(); i++)
81  // {
82  // // cout<<"predicted state momentum error"<<(*i)->linearizedTrack()->predictedStateMomentumError()<<endl;
83  // // cout<<"Momentum jacobian"<<(*i)->linearizedTrack()->momentumJacobian() <<endl;
84  // // cout<<"predicted state momentum "<<(*i)->linearizedTrack()->predictedStateMomentum()<<endl;
85  // // cout<<"constant term"<<(*i)->linearizedTrack()->constantTerm()<<endl;
86  //
87  // }
88 
90  if (!vtx.isValid()) {
91  LogDebug("RecoVertex/KinematicParticleVertexFitter") << "Fitted position is invalid. Returned Tree is invalid\n";
92  return ReferenceCountingPointer<KinematicTree>(new KinematicTree()); // return invalid vertex
93  }
94  FinalTreeBuilder tBuilder;
95  return tBuilder.buildTree(vtx, newPart);
96 }

References FinalTreeBuilder::buildTree(), relativeConstraints::error, fitter, LinearizationPointFinder::getLinearizationPoint(), mps_fire::i, input, LogDebug, ecalTrigSettings_cff::particles, pointFinder, InputSort::sort(), VertexFitter< N >::vertex(), VertexTrackFactory< N >::vertexTrack(), vFactory, extraflags_cff::vtx, and TrackKinematicStatePropagator::willPropagateToTheTransversePCA().

Referenced by KineExample::analyze(), trackingPlots.Iteration::modules(), and PFTau3ProngReco::produce().

◆ setup()

void KinematicParticleVertexFitter::setup ( const edm::ParameterSet pSet)
private

Member Data Documentation

◆ fitter

VertexFitter<6>* KinematicParticleVertexFitter::fitter
private

Definition at line 58 of file KinematicParticleVertexFitter.h.

Referenced by fit(), setup(), and ~KinematicParticleVertexFitter().

◆ pointFinder

LinearizationPointFinder* KinematicParticleVertexFitter::pointFinder
private

Definition at line 59 of file KinematicParticleVertexFitter.h.

Referenced by fit(), setup(), and ~KinematicParticleVertexFitter().

◆ vFactory

VertexTrackFactory<6>* KinematicParticleVertexFitter::vFactory
private

Definition at line 60 of file KinematicParticleVertexFitter.h.

Referenced by fit(), setup(), and ~KinematicParticleVertexFitter().

KalmanVertexUpdator
Definition: KalmanVertexUpdator.h:13
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
InputSort
Definition: InputSort.h:14
KalmanVertexTrackUpdator
Definition: KalmanVertexTrackUpdator.h:17
VertexException
Common base class.
Definition: VertexException.h:12
CachingVertex
Definition: CachingVertex.h:22
KinematicTree
Definition: KinematicTree.h:36
TrackKinematicStatePropagator::willPropagateToTheTransversePCA
bool willPropagateToTheTransversePCA(const KinematicState &state, const GlobalPoint &point) const override
Definition: TrackKinematicStatePropagator.cc:53
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
relativeConstraints.error
error
Definition: relativeConstraints.py:53
ecalTrigSettings_cff.particles
particles
Definition: ecalTrigSettings_cff.py:11
SequentialVertexSmoother
Definition: SequentialVertexSmoother.h:15
TrackKinematicStatePropagator
Definition: TrackKinematicStatePropagator.h:17
KalmanTrackToTrackCovCalculator
Definition: KalmanTrackToTrackCovCalculator.h:13
KalmanSmoothedVertexChi2Estimator
Definition: KalmanSmoothedVertexChi2Estimator.h:14
SequentialVertexFitter
Definition: SequentialVertexFitter.h:34
Point3DBase< float, GlobalTag >
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
VertexFitter::vertex
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const =0
VertexTrackFactory< 6 >
ParticleKinematicLinearizedTrackStateFactory
Definition: ParticleKinematicLinearizedTrackStateFactory.h:9
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
FinalTreeBuilder
Definition: FinalTreeBuilder.h:16
GlobalErrorBase< double, ErrorMatrixTag >
DefaultLinearizationPointFinder
Definition: DefaultLinearizationPointFinder.h:13
KinematicParticleVertexFitter::vFactory
VertexTrackFactory< 6 > * vFactory
Definition: KinematicParticleVertexFitter.h:60
VertexTrackFactory::vertexTrack
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
Definition: VertexTrackFactory.h:27
KinematicParticleVertexFitter::pointFinder
LinearizationPointFinder * pointFinder
Definition: KinematicParticleVertexFitter.h:59
InputSort::sort
std::pair< std::vector< RefCountedKinematicParticle >, std::vector< FreeTrajectoryState > > sort(const std::vector< RefCountedKinematicParticle > &particles) const
Definition: InputSort.cc:5
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
VertexState
Definition: VertexState.h:13
KinematicParticleVertexFitter::defaultParameters
edm::ParameterSet defaultParameters() const
Definition: KinematicParticleVertexFitter.cc:40
LinearizationPointFinder::getLinearizationPoint
virtual GlobalPoint getLinearizationPoint(const std::vector< reco::TransientTrack > &) const =0
KinematicParticleVertexFitter::setup
void setup(const edm::ParameterSet &pSet)
Definition: KinematicParticleVertexFitter.cc:22
FinalTreeBuilder::buildTree
RefCountedKinematicTree buildTree(const CachingVertex< 6 > &vtx, const std::vector< RefCountedKinematicParticle > &input) const
Definition: FinalTreeBuilder.cc:19
KinematicParticleVertexFitter::fitter
VertexFitter< 6 > * fitter
Definition: KinematicParticleVertexFitter.h:58