1#ifndef VertexFit_KinematicFit_H
2#define VertexFit_KinematicFit_H
5#include "VertexFit/WTrackParameter.h"
6#include "VertexFit/KinematicConstraints.h"
7#include "VertexFit/TrackPool.h"
8#include "VertexFit/GammaShape.h"
21 void AddResonance(
int number,
double mres, std::vector<int> tlis);
31 int n5,
int n6,
int n7);
33 int n5,
int n6,
int n7,
int n8);
35 int n5,
int n6,
int n7,
int n8,
int n9);
37 int n5,
int n6,
int n7,
int n8,
int n9,
40 int n5,
int n6,
int n7,
int n8,
int n9,
43 int n5,
int n6,
int n7,
int n8,
int n9,
44 int n10,
int n11,
int n12);
58 int n5,
int n6,
int n7);
60 int n5,
int n6,
int n7,
int n8);
62 int n5,
int n6,
int n7,
int n8,
int n9);
64 int n5,
int n6,
int n7,
int n8,
int n9,
int n10);
66 int n5,
int n6,
int n7,
int n8,
int n9,
int n10,
int n11);
68 int n5,
int n6,
int n7,
int n8,
int n9,
69 int n10,
int n11,
int n12);
84 int n5,
int n6,
int n7);
86 int n5,
int n6,
int n7,
int n8);
88 int n5,
int n6,
int n7,
int n8,
int n9);
90 int n5,
int n6,
int n7,
int n8,
int n9,
93 int n5,
int n6,
int n7,
int n8,
int n9,
96 int n5,
int n6,
int n7,
int n8,
int n9,
97 int n10,
int n11,
int n12);
112 void AddEqualMass(
int number, std::vector<int> tlis1, std::vector<int> tlis2);
132 void setChisqCut(
const double chicut = 200,
const double chiter=0.05) {m_chicut = chicut;m_chiter=chiter;}
150 double chisq()
const {
return m_chi;}
151 double chisq(
int n)
const {
return m_chisq[
n];}
154 HepLorentzVector
pfit(
int n)
const {
return p4Infit(
n);}
157 HepLorentzVector
pfit1(
int n)
const {
return p4Origin(
n);}
163 HepVector
pull(
int n) ;
169 HepVector
cpu()
const {
return m_cpu;}
174 std::vector<WTrackParameter> m_virtual_wtrk;
183 void covMatrix(
int n);
186 std::vector<KinematicConstraints> m_kc;
187 std::vector<double> m_chisq;
192 HepMatrix D(
int ic,
int itk)
const {
return m_D.sub(ic+1, ic+1, itk*NTRKPAR+1, (itk+1)*NTRKPAR);}
193 void setD(
int ic,
int itk,
const HepMatrix &p) {m_D.sub(ic+1, itk*NTRKPAR+1, p);}
195 HepMatrix DT(
int itk,
int ic)
const {
return m_DT.sub(itk*NTRKPAR+1, (itk+1)*NTRKPAR, ic+1, ic+1);}
196 void setDT(
int itk,
int ic,
const HepMatrix &p) { m_DT.sub(itk*NTRKPAR+1, ic+1, p);}
205 HepSymMatrix m_covOrigin;
206 HepSymMatrix m_covInfit;
207 HepVector m_massvector;
208 HepVector pOrigin(
int i)
const {
return m_pOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR);}
209 HepLorentzVector p4Origin(
int i)
const { HepVector p(3, 0); p = pOrigin(i);
double E = sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2] +
origin(i).
mass() *
origin(i).
mass());
return HepLorentzVector(p[0], p[1], p[2], E);}
210 HepVector pInfit(
int i)
const {
return m_pInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR);}
211 HepLorentzVector p4Infit(
int i)
const { HepVector p(3, 0); p = pInfit(i);
double E = sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2] +
origin(i).
mass() *
origin(i).
mass());
return HepLorentzVector(p[0], p[1], p[2], E); }
212 void setPOrigin(
int i,
const HepVector &p) { m_pOrigin.sub(i*NTRKPAR+1, p);}
213 void setPInfit(
int i,
const HepVector &p) {m_pInfit.sub(i*NTRKPAR+1, p);}
214 HepSymMatrix covOrigin(
int i)
const {
return m_covOrigin.sub(i*NTRKPAR+1, (i+1)*NTRKPAR);}
215 HepSymMatrix covInfit(
int i)
const {
return m_covInfit.sub(i*NTRKPAR+1, (i+1)*NTRKPAR);}
216 void setCovOrigin(
int i,
const HepSymMatrix &c) {m_covOrigin.sub(i*NTRKPAR+1, c);}
217 void setCovInfit(
int i,
const HepSymMatrix &c) {m_covInfit.sub(i*NTRKPAR+1,c);}
218 void setMassvector(
int i,
const double mass) {m_massvector[i] =
mass;}
230 double m_collideangle;
236 static const int NTRKPAR;
238 static const int Resonance;
239 static const int TotalEnergy;
240 static const int TotalMomentum;
241 static const int ThreeMomentum;
242 static const int FourMomentum;
243 static const int EqualMass;
244 static const int Position;
static KinematicFit * instance()
void BuildVirtualParticle(int number)
WTrackParameter wVirtualTrack(int n) const
void AddResonance(int number, double mres, std::vector< int > tlis)
double chisq(int n) const
double collideangle() const
WTrackParameter origin(int n) const
void setEspread(const double espread=0.0009)
void AddEqualMass(int number, std::vector< int > tlis1, std::vector< int > tlis2)
void setChisqCut(const double chicut=200, const double chiter=0.05)
void setDynamicerror(const bool dynamicerror=1)
void setIterNumber(const int niter=5)
void AddThreeMomentum(int number, Hep3Vector p3)
bool dynamicerror() const
void AddFourMomentum(int number, HepLorentzVector p4)
void setFlag(const bool flag=1)
HepLorentzVector pfit(int n) const
void setKalman(const int kalman)
HepLorentzVector pfit1(int n) const
void setCollideangle(const double collideangle=11e-3)
WTrackParameter infit(int n) const
void AddTotalEnergy(int number, double etot, std::vector< int > lis)
void AddTotalMomentum(int number, double ptot, std::vector< int > lis)
std::vector< WTrackParameter > wTrackInfit() const
std::vector< WTrackParameter > wTrackOrigin() const