#include <CandKinematicVertexFitter.h>
Definition at line 23 of file CandKinematicVertexFitter.h.
Definition at line 25 of file CandKinematicVertexFitter.h.
CandKinematicVertexFitter::CandKinematicVertexFitter | ( | const edm::ParameterSet & | cfg | ) | [inline] |
CandKinematicVertexFitter::CandKinematicVertexFitter | ( | const CandKinematicVertexFitter & | o | ) | [inline] |
RefCountedKinematicParticle CandKinematicVertexFitter::currentParticle | ( | ) | const [inline] |
Definition at line 36 of file CandKinematicVertexFitter.h.
References tree_.
void CandKinematicVertexFitter::fill | ( | std::vector< RefCountedKinematicParticle > & | , |
std::vector< reco::Candidate * > & | , | ||
std::vector< reco::RecoCandidate::TrackType > & | , | ||
reco::Candidate & | |||
) | const [private] |
bool CandKinematicVertexFitter::fit | ( | const std::vector< RefCountedKinematicParticle > & | tracks | ) | const |
void CandKinematicVertexFitter::set | ( | const ParticleDataTable * | pdt | ) | [inline] |
void CandKinematicVertexFitter::set | ( | reco::VertexCompositeCandidate & | c | ) | const |
Definition at line 31 of file CandKinematicVertexFitter.cc.
References GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::cyx(), GlobalErrorBase< T, ErrorWeightType >::cyy(), GlobalErrorBase< T, ErrorWeightType >::czx(), GlobalErrorBase< T, ErrorWeightType >::czy(), GlobalErrorBase< T, ErrorWeightType >::czz(), reco::Candidate::energy(), relval_parameters_module::energy, Exception, lumiContext::fill, reco::RecoCandidate::gsfTrackType, edm::errors::InvalidReference, reco::Candidate::longLived(), PV3DBase< T, PVType, FrameType >::mag(), scaleCards::mass, AlCaHLTBitMon_ParallelJobs::p, p3, pileupReCalc_HLTpaths::scale, reco::VertexCompositeCandidate::setChi2AndNdof(), reco::VertexCompositeCandidate::setCovariance(), reco::LeafCandidate::setP4(), reco::Candidate::setP4(), reco::LeafCandidate::setVertex(), reco::Candidate::setVertex(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
{ if(bField_ == 0) throw edm::Exception(edm::errors::InvalidReference) << "B-Field was not set up CandKinematicVertexFitter.\n" << "the following method must be called before fitting a candidate:\n" << " CandKinematicVertexFitter:.set( const MagneticField * )" << endl; vector<RefCountedKinematicParticle> particles; vector<Candidate *> daughters; vector<RecoCandidate::TrackType> trackTypes; // fill particles with KinematicParticles and daughters with Candidates of the daughters of c fill(particles, daughters, trackTypes, c); assert(particles.size() == daughters.size()); // attempt to fit the KinematicParticles, particles if(fit(particles)) { // after the fit, tree_ contains the KinematicTree from the fit tree_->movePointerToTheTop(); // set the kinematic properties of the daughters from the fit RefCountedKinematicVertex vertex = tree_->currentDecayVertex(); if(vertex->vertexIsValid()) { Candidate::Point vtx(vertex->position()); c.setVertex(vtx); vector<RefCountedKinematicParticle> treeParticles = tree_->daughterParticles(); vector<RefCountedKinematicParticle>::const_iterator particleIt = treeParticles.begin(); vector<Candidate *>::const_iterator daughterIt = daughters.begin(), daughtersEnd = daughters.end(); vector<RecoCandidate::TrackType>::const_iterator trackTypeIt = trackTypes.begin(); Candidate::LorentzVector mp4(0, 0, 0, 0); for(; daughterIt != daughtersEnd; ++ particleIt, ++ daughterIt, ++trackTypeIt) { Candidate & daughter = * * daughterIt; GlobalVector p3 = (*particleIt)->currentState().globalMomentum(); double px = p3.x(), py = p3.y(), pz = p3.z(), p = p3.mag(); double energy; if(!daughter.longLived()) daughter.setVertex(vtx); double scale; switch(*trackTypeIt) { case RecoCandidate::gsfTrackType : //gsf used for electron tracks energy = daughter.energy(); scale = energy / p; px *= scale; py *= scale; pz *= scale; default: double mass = (*particleIt)->currentState().mass(); energy = sqrt(p*p + mass*mass); }; Candidate::LorentzVector dp4(px, py, pz, energy); daughter.setP4(dp4); mp4 += dp4; } c.setP4(mp4); c.setChi2AndNdof(chi2_ = vertex->chiSquared(), ndof_ = vertex->degreesOfFreedom()); GlobalError err = vertex->error(); cov_(0,0) = err.cxx(); cov_(0,1) = err.cyx(); cov_(0,2) = err.czx(); cov_(1,2) = err.czy(); cov_(1,1) = err.cyy(); cov_(2,2) = err.czz(); c.setCovariance(cov_); } } else { c.setChi2AndNdof(chi2_ = -1, ndof_ = 0); c.setCovariance(cov_ = CovarianceMatrix(ROOT::Math::SMatrixIdentity())); } }
void CandKinematicVertexFitter::set | ( | const MagneticField * | bField | ) | [inline] |
Definition at line 32 of file CandKinematicVertexFitter.h.
References ecalTB2006H4_GenSimDigiReco_cfg::bField, and bField_.
Referenced by reco::modules::CandKinematicVertexFitterEventSetupInit::init().
const MagneticField* CandKinematicVertexFitter::bField_ [private] |
Definition at line 41 of file CandKinematicVertexFitter.h.
Referenced by set().
double CandKinematicVertexFitter::chi2_ [mutable, private] |
chi-sqared
Definition at line 54 of file CandKinematicVertexFitter.h.
CovarianceMatrix CandKinematicVertexFitter::cov_ [mutable, private] |
covariance matrix (3x3)
Definition at line 58 of file CandKinematicVertexFitter.h.
particle factor
Definition at line 52 of file CandKinematicVertexFitter.h.
fitter
Definition at line 48 of file CandKinematicVertexFitter.h.
boost::shared_ptr<std::vector<CandKinematicVertexFitter> > CandKinematicVertexFitter::fitters_ [private] |
fitters used for recursive calls
Definition at line 60 of file CandKinematicVertexFitter.h.
double CandKinematicVertexFitter::ndof_ [mutable, private] |
number of degrees of freedom
Definition at line 56 of file CandKinematicVertexFitter.h.
const ParticleDataTable* CandKinematicVertexFitter::pdt_ [private] |
Definition at line 42 of file CandKinematicVertexFitter.h.
Referenced by set().
RefCountedKinematicTree CandKinematicVertexFitter::tree_ [mutable, private] |
fit tree
Definition at line 50 of file CandKinematicVertexFitter.h.
Referenced by currentParticle().