CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

KinematicParticleVertexFitter Class Reference

#include <KinematicParticleVertexFitter.h>

List of all members.

Public Member Functions

RefCountedKinematicTree fit (std::vector< RefCountedKinematicParticle > particles) const
 KinematicParticleVertexFitter (const edm::ParameterSet pSet)
 KinematicParticleVertexFitter ()
 ~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().

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

Definition at line 21 of file KinematicParticleVertexFitter.cc.

References setup().

{
  setup(pSet);
}
KinematicParticleVertexFitter::~KinematicParticleVertexFitter ( )

Definition at line 42 of file KinematicParticleVertexFitter.cc.

References fitter, pointFinder, and vFactory.

{
 delete vFactory;
 delete pointFinder;
 delete fitter;
}

Member Function Documentation

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

Definition at line 49 of file KinematicParticleVertexFitter.cc.

References edm::ParameterSet::addParameter().

Referenced by KinematicParticleVertexFitter().

{
  edm::ParameterSet pSet;
  pSet.addParameter<double>("maxDistance", 0.01);
  pSet.addParameter<int>("maxNbrOfIterations", 100); //10
  return pSet;
}
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().

{
 typedef ReferenceCountingPointer<VertexTrack<6> > RefCountedVertexTrack;
//sorting the input 
 if(particles.size()<2) throw VertexException("KinematicParticleVertexFitter::input states are less than 2"); 
 InputSort iSort;
 std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> > input = iSort.sort(particles);
 std::vector<RefCountedKinematicParticle> & newPart = input.first;
 std::vector<FreeTrajectoryState> & freeStates = input.second;

 GlobalPoint linPoint = pointFinder->getLinearizationPoint(freeStates);
  
// cout<<"Linearization point found"<<endl; 
 
//making initial veretx seed with lin point as position and a fake error
 AlgebraicSymMatrix33 we;
 we(0,0)=we(1,1)=we(2,2) = 10000.;
 GlobalError error(we);
 VertexState state(linPoint, error);
 
//vector of Vertex Tracks to fit
 std::vector<RefCountedVertexTrack> ttf; 
 for(std::vector<RefCountedKinematicParticle>::const_iterator i = newPart.begin();i != newPart.end();i++)
 {ttf.push_back(vFactory->vertexTrack((*i)->particleLinearizedTrackState(linPoint),state,1.));}

// //debugging code to check neutrals: 
//  for(std::vector<RefCountedVertexTrack>::const_iterator i = ttf.begin(); i!=ttf.end(); i++)
//  {
// //   cout<<"predicted state momentum error"<<(*i)->linearizedTrack()->predictedStateMomentumError()<<endl;
// //  cout<<"Momentum jacobian"<<(*i)->linearizedTrack()->momentumJacobian() <<endl;
//  //  cout<<"predicted state momentum "<<(*i)->linearizedTrack()->predictedStateMomentum()<<endl;
// //   cout<<"constant term"<<(*i)->linearizedTrack()->constantTerm()<<endl;
// 
//  }

 CachingVertex<6> vtx = fitter->vertex(ttf); 
 if (!vtx.isValid()) {
     LogDebug("RecoVertex/KinematicParticleVertexFitter") 
       << "Fitted position is invalid. Returned Tree is invalid\n";
    return ReferenceCountingPointer<KinematicTree>(new KinematicTree()); // return invalid vertex
 }
 FinalTreeBuilder tBuilder;
 return tBuilder.buildTree(vtx, newPart); 
}
void KinematicParticleVertexFitter::setup ( const edm::ParameterSet  pSet) [private]

Member Data Documentation

Definition at line 62 of file KinematicParticleVertexFitter.h.

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

Definition at line 63 of file KinematicParticleVertexFitter.h.

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

Definition at line 64 of file KinematicParticleVertexFitter.h.

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