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
KinematicParticleVertexFitter Class Reference

#include <KinematicParticleVertexFitter.h>

Public Member Functions

RefCountedKinematicTree fit (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::KinematicParticleVertexFitter ( )

Constructor with LMSLinearizationPointFinder used as default.

Definition at line 15 of file KinematicParticleVertexFitter.cc.

References defaultParameters(), and setup().

16 {
18  setup(pSet);
19 }
edm::ParameterSet defaultParameters() const
void setup(const edm::ParameterSet pSet)
KinematicParticleVertexFitter::KinematicParticleVertexFitter ( const edm::ParameterSet  pSet)

Definition at line 21 of file KinematicParticleVertexFitter.cc.

References setup().

22 {
23  setup(pSet);
24 }
void setup(const edm::ParameterSet pSet)
KinematicParticleVertexFitter::~KinematicParticleVertexFitter ( )

Definition at line 42 of file KinematicParticleVertexFitter.cc.

References fitter, pointFinder, and vFactory.

43 {
44  delete vFactory;
45  delete pointFinder;
46  delete fitter;
47 }

Member Function Documentation

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

Definition at line 49 of file KinematicParticleVertexFitter.cc.

References edm::ParameterSet::addParameter().

Referenced by KinematicParticleVertexFitter().

50 {
51  edm::ParameterSet pSet;
52  pSet.addParameter<double>("maxDistance", 0.01);
53  pSet.addParameter<int>("maxNbrOfIterations", 100); //10
54  return pSet;
55 }
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
RefCountedKinematicTree KinematicParticleVertexFitter::fit ( 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 57 of file KinematicParticleVertexFitter.cc.

References FinalTreeBuilder::buildTree(), error, fitter, LinearizationPointFinder::getLinearizationPoint(), i, LaserDQM_cfg::input, CachingVertex< N >::isValid(), LogDebug, pointFinder, InputSort::sort(), evf::utils::state, VertexFitter< N >::vertex(), VertexTrackFactory< N >::vertexTrack(), and vFactory.

Referenced by KineExample::analyze().

58 {
59  typedef ReferenceCountingPointer<VertexTrack<6> > RefCountedVertexTrack;
60 //sorting the input
61  if(particles.size()<2) throw VertexException("KinematicParticleVertexFitter::input states are less than 2");
62  InputSort iSort;
63  std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> > input = iSort.sort(particles);
64  std::vector<RefCountedKinematicParticle> & newPart = input.first;
65  std::vector<FreeTrajectoryState> & freeStates = input.second;
66 
67  GlobalPoint linPoint = pointFinder->getLinearizationPoint(freeStates);
68 
69 // cout<<"Linearization point found"<<endl;
70 
71 //making initial veretx seed with lin point as position and a fake error
73  we(0,0)=we(1,1)=we(2,2) = 10000.;
74  GlobalError error(we);
75  VertexState state(linPoint, error);
76 
77 //vector of Vertex Tracks to fit
78  std::vector<RefCountedVertexTrack> ttf;
79  for(std::vector<RefCountedKinematicParticle>::const_iterator i = newPart.begin();i != newPart.end();i++)
80  {ttf.push_back(vFactory->vertexTrack((*i)->particleLinearizedTrackState(linPoint),state,1.));}
81 
82 // //debugging code to check neutrals:
83 // for(std::vector<RefCountedVertexTrack>::const_iterator i = ttf.begin(); i!=ttf.end(); i++)
84 // {
85 // // cout<<"predicted state momentum error"<<(*i)->linearizedTrack()->predictedStateMomentumError()<<endl;
86 // // cout<<"Momentum jacobian"<<(*i)->linearizedTrack()->momentumJacobian() <<endl;
87 // // cout<<"predicted state momentum "<<(*i)->linearizedTrack()->predictedStateMomentum()<<endl;
88 // // cout<<"constant term"<<(*i)->linearizedTrack()->constantTerm()<<endl;
89 //
90 // }
91 
92  CachingVertex<6> vtx = fitter->vertex(ttf);
93  if (!vtx.isValid()) {
94  LogDebug("RecoVertex/KinematicParticleVertexFitter")
95  << "Fitted position is invalid. Returned Tree is invalid\n";
96  return ReferenceCountingPointer<KinematicTree>(new KinematicTree()); // return invalid vertex
97  }
98  FinalTreeBuilder tBuilder;
99  return tBuilder.buildTree(vtx, newPart);
100 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::pair< std::vector< RefCountedKinematicParticle >, std::vector< FreeTrajectoryState > > sort(std::vector< RefCountedKinematicParticle > particles) const
Definition: InputSort.cc:6
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
Common base class.
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const =0
RefCountedKinematicTree buildTree(const CachingVertex< 6 > &vtx, std::vector< RefCountedKinematicParticle > input) const
char state
Definition: procUtils.cc:75
virtual GlobalPoint getLinearizationPoint(const std::vector< reco::TransientTrack > &) const =0
bool isValid() const
Definition: CachingVertex.h:95
void KinematicParticleVertexFitter::setup ( const edm::ParameterSet  pSet)
private

Definition at line 27 of file KinematicParticleVertexFitter.cc.

References fitter, pointFinder, and vFactory.

Referenced by KinematicParticleVertexFitter().

Member Data Documentation

VertexFitter<6>* KinematicParticleVertexFitter::fitter
private

Definition at line 62 of file KinematicParticleVertexFitter.h.

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

LinearizationPointFinder* KinematicParticleVertexFitter::pointFinder
private

Definition at line 63 of file KinematicParticleVertexFitter.h.

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

VertexTrackFactory<6>* KinematicParticleVertexFitter::vFactory
private

Definition at line 64 of file KinematicParticleVertexFitter.h.

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