BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
VertexFit Class Reference

#include <VertexFit.h>

+ Inheritance diagram for VertexFit:

Public Member Functions

 ~VertexFit ()
 
void init ()
 
void AddVertex (int number, VertexParameter vpar, std::vector< int > lis)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11)
 
void AddVertex (int number, VertexParameter vpar, int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12)
 
void AddBeamFit (int number, VertexParameter vpar, int n)
 
void BuildVirtualParticle (int number)
 
void setIterNumber (const int niter=10)
 
void setChisqCut (const double chicut=1000, const double chiter=1.0e-3)
 
bool Fit ()
 
bool Fit (int n)
 
bool BeamFit (int n)
 
void Swim (int n)
 
double chisq () const
 
double chisq (int n) const
 
bool pull (int n, int itk, HepVector &p)
 
HepLorentzVector pfit (int n) const
 
HepPoint3D xfit (int n) const
 
HepVector w (int n) const
 
HepSymMatrix Ew (int n) const
 
WTrackParameter wtrk (int n) const
 
HepVector cpu () const
 
HepPoint3D vx (int n) const
 
HepVector Vx (int n) const
 
HepSymMatrix Evx (int n) const
 
double errorVx (int n, int i) const
 
VertexParameter vpar (int n) const
 
WTrackParameter wVirtualTrack (int n) const
 
- Public Member Functions inherited from TrackPool
 TrackPool ()
 
 ~TrackPool ()
 
void AddTrack (const int number, const double mass, const RecMdcTrack *trk)
 
void AddTrack (const int number, const double mass, const RecMdcKalTrack *trk)
 
void AddTrack (const int number, const double mass, const RecEmcShower *trk)
 
void AddTrack (const int number, const WTrackParameter wtrk)
 
void AddMissTrack (const int number, const double mass)
 
void AddMissTrack (const int number, const double mass, const HepLorentzVector p4)
 
void AddMissTrack (const int number, const double mass, const RecEmcShower *trk)
 
void AddMissTrack (const int number, const RecEmcShower *trk)
 
void AddMissTrack (const int number, const HepLorentzVector p4)
 
void AddTrackVertex (const int number, const double mass, const RecEmcShower *trk)
 
std::vector< int > AddList (int n1)
 
std::vector< int > AddList (int n1, int n2)
 
std::vector< int > AddList (int n1, int n2, int n3)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11)
 
std::vector< int > AddList (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12)
 
std::vector< WTrackParameterwTrackOrigin () const
 
std::vector< WTrackParameterwTrackInfit () const
 
std::vector< int > wTrackList () const
 
WTrackParameter wTrackOrigin (int n) const
 
WTrackParameter wTrackInfit (int n) const
 
int wTrackList (int n) const
 
int numberWTrack () const
 
std::vector< GammaShapeGammaShapeValue () const
 
std::vector< int > GammaShapeList () const
 
GammaShape GammaShapeValue (int n) const
 
int GammaShapeList (int n) const
 
int numberGammaShape () const
 
void setWTrackOrigin (const int n, const WTrackParameter wtrk)
 
void setWTrackInfit (const int n, const WTrackParameter wtrk)
 
void setWTrackOrigin (const WTrackParameter wtrk)
 
void setWTrackInfit (const WTrackParameter wtrk)
 
void setWTrackList (const int n)
 
void clearWTrackOrigin ()
 
void clearWTrackInfit ()
 
void clearWTrackList ()
 
void clearone ()
 
void cleartwo ()
 
int numberone () const
 
int numbertwo () const
 
vector< int > mappositionA () const
 
vector< int > mappositionB () const
 
vector< int > mapkinematic () const
 
void clearMapkinematic ()
 
void clearMappositionA ()
 
void clearMappositionB ()
 
void setMapkinematic (const int n)
 
void setMappositionA (const int n)
 
void setMappositionB (const int n)
 
void setGammaShape (const int n, const GammaShape gammashape)
 
void setGammaShape (const GammaShape gammashape)
 
void setGammaShapeList (const int n)
 
void clearGammaShape ()
 
void clearGammaShapeList ()
 
void setBeamPosition (const HepPoint3D BeamPosition)
 
void setVBeamPosition (const HepSymMatrix VBeamPosition)
 
HepPoint3D getBeamPosition () const
 
HepSymMatrix getVBeamPosition () const
 

Static Public Member Functions

static VertexFitinstance ()
 

Detailed Description

Definition at line 26 of file VertexFit.h.

Constructor & Destructor Documentation

◆ ~VertexFit()

VertexFit::~VertexFit ( )

Definition at line 22 of file VertexFit.cxx.

23{
24 //if (m_pointer) delete m_pointer;
25}

Member Function Documentation

◆ AddBeamFit()

void VertexFit::AddBeamFit ( int  number,
VertexParameter  vpar,
int  n 
)

Definition at line 72 of file VertexFit.cxx.

73{
74 std::vector<int> tlis = AddList(n);
77 m_vc.push_back(vc);
78 m_vpar_origin.push_back(vpar);
79 m_vpar_infit.push_back(vpar);
80 if ((unsigned int)number != m_vc.size() - 1)
81 std::cout << "wrong kinematic constraints index" << std::endl;
82}
const Int_t n
std::vector< int > AddList(int n1)
Definition: TrackPool.cxx:483
void FixedVertexConstraints(std::vector< int > tlis)
VertexParameter vpar(int n) const
Definition: VertexFit.h:94

◆ AddVertex() [1/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2 
)

Definition at line 106 of file VertexFit.cxx.

107{
108 std::vector<int> tlis = AddList(n1, n2);
109 AddVertex(number, vpar, tlis);
110}
int n2
Definition: SD0Tag.cxx:55
int n1
Definition: SD0Tag.cxx:54
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
Definition: VertexFit.cxx:87

◆ AddVertex() [2/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3 
)

Definition at line 113 of file VertexFit.cxx.

114{
115 std::vector<int> tlis = AddList(n1, n2, n3);
116 AddVertex(number, vpar, tlis);
117}

◆ AddVertex() [3/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4 
)

Definition at line 119 of file VertexFit.cxx.

120{
121 std::vector<int> tlis = AddList(n1, n2, n3, n4);
122 AddVertex(number, vpar, tlis);
123}

◆ AddVertex() [4/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5 
)

Definition at line 125 of file VertexFit.cxx.

126{
127 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5);
128 AddVertex(number, vpar, tlis);
129}

◆ AddVertex() [5/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6 
)

Definition at line 131 of file VertexFit.cxx.

132{
133 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6);
134 AddVertex(number, vpar, tlis);
135}

◆ AddVertex() [6/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7 
)

Definition at line 137 of file VertexFit.cxx.

138{
139 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7);
140 AddVertex(number, vpar, tlis);
141}

◆ AddVertex() [7/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8 
)

Definition at line 143 of file VertexFit.cxx.

144{
145 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8);
146 AddVertex(number, vpar, tlis);
147}

◆ AddVertex() [8/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8,
int  n9 
)

Definition at line 149 of file VertexFit.cxx.

150{
151 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9);
152 AddVertex(number, vpar, tlis);
153}

◆ AddVertex() [9/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8,
int  n9,
int  n10 
)

Definition at line 155 of file VertexFit.cxx.

156{
157 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10);
158 AddVertex(number, vpar, tlis);
159}

◆ AddVertex() [10/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8,
int  n9,
int  n10,
int  n11 
)

Definition at line 161 of file VertexFit.cxx.

162{
163 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11);
164 AddVertex(number, vpar, tlis);
165}

◆ AddVertex() [11/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8,
int  n9,
int  n10,
int  n11,
int  n12 
)

Definition at line 167 of file VertexFit.cxx.

168{
169 std::vector<int> tlis = AddList(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12);
170 AddVertex(number, vpar, tlis);
171}

◆ AddVertex() [12/12]

void VertexFit::AddVertex ( int  number,
VertexParameter  vpar,
std::vector< int >  lis 
)

Definition at line 87 of file VertexFit.cxx.

88{
91 m_vc.push_back(vc);
92 HepVector vx(3, 0);
93 for (unsigned int i = 0; i < tlis.size(); i++)
94 vx += wTrackOrigin(tlis[i]).X();
95 vx = vx/tlis.size();
96 VertexParameter n_vpar = vpar;
97 n_vpar.setVx(vx);
98 m_vpar_origin.push_back(n_vpar);
99 m_vpar_infit.push_back(n_vpar);
100 WTrackParameter vwtrk;
101 m_virtual_wtrk.push_back(vwtrk);
102 if ((unsigned int)number != m_vc.size() - 1)
103 std::cout << "wrong kinematic constraints index" << std::endl;
104}
std::vector< WTrackParameter > wTrackOrigin() const
Definition: TrackPool.h:72
void CommonVertexConstraints(std::vector< int > tlis)
HepPoint3D vx(int n) const
Definition: VertexFit.h:90
void setVx(const HepPoint3D &vx)

Referenced by AddVertex(), DQAKsInfo::calculate(), Gam4pikp::execute(), Ppjrhopi::execute(), Rhopi::execute(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), DQARhopi::execute(), JsiLL::execute(), BeamParams::execute(), PrimaryVertex::execute(), KShortReconstruction::execute(), LambdaReconstruction::execute(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), K0pipipi0::MTotal(), K3pi::MTotal(), K3pipi0::MTotal(), Kk::MTotal(), Kkpi0::MTotal(), Kkpipi::MTotal(), Kpi::MTotal(), Kpipi0::MTotal(), Kpipi0pi0::MTotal(), Pipi::MTotal(), and Pipipi0::MTotal().

◆ BeamFit()

bool VertexFit::BeamFit ( int  n)

Definition at line 257 of file VertexFit.cxx.

258{
259 bool okfit = false;
260 if (n < 0 || (unsigned int)n >= m_vc.size())
261 return okfit;
262 for (unsigned int i = 0; i < (m_vc[n].Ltrk()).size(); i++)
263 {
264 int itk = (m_vc[n].Ltrk())[i];
265 setWTrackInfit(itk, wTrackOrigin(itk));
266 }
267 m_vpar_infit[n] = m_vpar_origin[n];
268
269 // iteration loop
270 std::vector<double> chisq;
271 chisq.clear();
272 for (int it = 0; it < m_niter; it++)
273 {
274 std::vector<WTrackParameter> wlis;
275 wlis.clear();
276 for (unsigned int i = 0; i < (m_vc[n].Ltrk()).size(); i++)
277 {
278 int itk = (m_vc[n].Ltrk())[i];
279 wlis.push_back(wTrackInfit(itk));
280 }
281 VertexParameter vpar = m_vpar_infit[n];
282 m_vc[n].UpdateConstraints(vpar, wlis);
283
284 fitBeam(n);
285 chisq.push_back(m_chisq[n]);
286 if (it > 0)
287 {
288 double delchi = chisq[it] - chisq[it-1];
289 if(fabs(delchi) < m_chiter)
290 break;
291 }
292 }
293 if(m_chisq[n]>=m_chicut) return okfit;
294 swimBeam(n);
295 okfit = true;
296 return okfit;
297}
std::vector< WTrackParameter > wTrackInfit() const
Definition: TrackPool.h:73
void setWTrackInfit(const int n, const WTrackParameter wtrk)
Definition: TrackPool.h:106
double chisq() const
Definition: VertexFit.h:71

◆ BuildVirtualParticle()

void VertexFit::BuildVirtualParticle ( int  number)

Definition at line 616 of file VertexFit.cxx.

617{
618
619 vertexCovMatrix(n);
620 TStopwatch timer;
621 timer.Start();
622
623 HepMatrix A(NTRKPAR, NTRKPAR * m_nvtrk, 0);
624 HepMatrix B(NTRKPAR, NVTXPAR, 0);
625 VertexConstraints vc = m_vc[n];
626 unsigned int NSIZE = vc.Ltrk().size();
627 int charge = 0;
628
629 HepMatrix Ai(6, 6, 0);
630 Ai[0][0] = 1.0;
631 Ai[1][1] = 1.0;
632 Ai[2][2] = 1.0;
633 HepMatrix Bi(6, 3, 0);
634 Bi[3][0] = 1.0;
635 Bi[4][1] = 1.0;
636 Bi[5][2] = 1.0;
637 HepVector w1(6, 0);
638 HepVector w2(7, 0);
639 HepSymMatrix Ew(7, 0);
640 HepMatrix ew1(6, 6, 0);
641 HepMatrix ew2(7, 7, 0);
642 double totalE = 0;
643
644 for(unsigned int i = 0; i < NSIZE; i++)
645 {
646 int itk = vc.Ltrk()[i];
647 charge += wTrackInfit(itk).charge();
648 double afield = VertexFitBField::instance()->getCBz(m_xInfit, pInfit(itk).sub(4, 6));
649 double a = afield * wTrackInfit(itk).charge();
650
651 totalE += wTrackOrigin(itk).w()[3];
652 Ai[0][4] = a;
653 Ai[1][3] = -a;
654 Bi[0][1] = -a;
655 Bi[1][0] = a;
656 A.sub(1, NTRKPAR*itk + 1, Ai);
657 B += Bi;
658 }
659 B[3][0] = 1.0;
660 B[4][1] = 1.0;
661 B[5][2] = 1.0;
662
663 w1 = A * m_pInfit + B * m_xInfit;
664 ew1 = m_pcovInfit.similarity(A) + m_xcovInfit.similarity(B) + A*m_E*B.T()+B*(m_E.T())*A.T();
665
666 //convert w1(6x1) to w2(7x1)
667 w2[0] = w1[0];
668 w2[1] = w1[1];
669 w2[2] = w1[2];
670 w2[3] = totalE;
671 w2[4] = w1[3];
672 w2[5] = w1[4];
673 w2[6] = w1[5];
674 //convert ew1(6x6) to ew2(7x7)
675 m_TRB[3][0] = w1[0] / totalE;
676 m_TRB[3][1] = w1[1] / totalE;
677 m_TRB[3][2] = w1[2] / totalE;
678 ew2 = m_TRB * ew1 * m_TRB.T();
679 Ew.assign(ew2);
680 WTrackParameter vwtrk;
681 vwtrk.setCharge(charge);
682 vwtrk.setW(w2);
683 vwtrk.setEw(Ew);
684
685 m_virtual_wtrk[n] = vwtrk;
686 timer.Stop();
687 m_cpu[5] += timer.CpuTime();
688}
std::vector< int > Ltrk() const
double getCBz(const HepVector &vtx, const HepVector &trackPosition)
HepSymMatrix Ew(int n) const
Definition: VertexFit.h:83
void setEw(const HepSymMatrix &Ew)
void setCharge(const int charge)
void setW(const HepVector &w)

Referenced by DQAKsInfo::calculate(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), JsiLL::execute(), KShortReconstruction::execute(), LambdaReconstruction::execute(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), and K0pipipi0::MTotal().

◆ chisq() [1/2]

double VertexFit::chisq ( ) const
inline

◆ chisq() [2/2]

double VertexFit::chisq ( int  n) const
inline

Definition at line 72 of file VertexFit.h.

72{return m_chisq[n];}

◆ cpu()

HepVector VertexFit::cpu ( ) const
inline

Definition at line 87 of file VertexFit.h.

87{return m_cpu;}

◆ errorVx()

double VertexFit::errorVx ( int  n,
int  i 
) const
inline

Definition at line 93 of file VertexFit.h.

93{ return sqrt((m_vpar_infit[n].Evx())[i][i]);}
HepSymMatrix Evx(int n) const
Definition: VertexFit.h:92

◆ Evx()

HepSymMatrix VertexFit::Evx ( int  n) const
inline

Definition at line 92 of file VertexFit.h.

92{ return m_vpar_infit[n].Evx();}

Referenced by errorVx(), Gam4pikp::execute(), and PrimaryVertex::execute().

◆ Ew()

HepSymMatrix VertexFit::Ew ( int  n) const
inline

Definition at line 83 of file VertexFit.h.

83{return wTrackInfit(n).Ew();}

Referenced by BuildVirtualParticle(), and Fit().

◆ Fit() [1/2]

bool VertexFit::Fit ( )

Definition at line 299 of file VertexFit.cxx.

300{
301 bool okfit = false;
302 double mychi = 0;
303 for (unsigned int n = 0; n<(int)(m_vc.size()); n++)
304 {
305 Fit(n);
306 if (m_chisq[n] >= m_chicut) return okfit;
307 swimVertex(n);
308 mychi = mychi + m_chisq[n];
309 }
310 m_chi = mychi;
311 okfit = true;
312 return okfit;
313}
bool Fit()
Definition: VertexFit.cxx:299

Referenced by DQAKsInfo::calculate(), Gam4pikp::execute(), Ppjrhopi::execute(), Rhopi::execute(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), DQARhopi::execute(), JsiLL::execute(), BeamParams::execute(), PrimaryVertex::execute(), KShortReconstruction::execute(), LambdaReconstruction::execute(), Fit(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), K0pipipi0::MTotal(), K3pi::MTotal(), K3pipi0::MTotal(), Kk::MTotal(), Kkpi0::MTotal(), Kkpipi::MTotal(), Kpi::MTotal(), Kpipi0::MTotal(), Kpipi0pi0::MTotal(), Pipi::MTotal(), and Pipipi0::MTotal().

◆ Fit() [2/2]

bool VertexFit::Fit ( int  n)

Definition at line 173 of file VertexFit.cxx.

174{
175 bool okfit = false;
176 TStopwatch timer;
177 m_cpu = HepVector(10, 0);
178 if (n < 0 || (unsigned int)n >= m_vc.size()) return okfit;
179
180 timer.Start();
181 int ifail;
182 m_nvtrk = numberWTrack();
183
184 m_pOrigin = HepVector(m_nvtrk * NTRKPAR, 0);
185 m_pInfit = HepVector(m_nvtrk * NTRKPAR, 0);
186 m_pcovOrigin = HepSymMatrix(m_nvtrk * NTRKPAR, 0);
187 m_pcovInfit = HepSymMatrix(m_nvtrk * NTRKPAR, 0);
188
189 int ntrk = numberWTrack();
190 for(unsigned int itk = 0; itk < ntrk; itk++)
191 {
192 setWTrackInfit(itk, wTrackOrigin(itk));
193 setPOrigin(itk, Convert76(wTrackOrigin(itk).w()));
194 setPCovOrigin(itk, wTrackOrigin(itk).Ew().similarity(m_TRA));
195 }
196 m_pInfit = m_pOrigin;
197
198 m_xOrigin = HepVector(NVTXPAR, 0);
199 m_xInfit = HepVector(NVTXPAR, 0);
200 m_xcovOrigin = HepSymMatrix(NVTXPAR, 0);
201 m_xcovInfit = HepSymMatrix(NVTXPAR, 0);
202 m_xcovOriginInversed = HepSymMatrix(NVTXPAR, 0);
203 m_xcovInfitInversed = HepSymMatrix(NVTXPAR, 0);
204
205 m_xOrigin = m_vpar_origin[n].Vx();
206 m_xcovOrigin = m_vpar_origin[n].Evx();
207 m_xcovOriginInversed = m_xcovOrigin.inverse(ifail);
208 m_xInfit = m_xOrigin;
209
210 m_vpar_infit[n] = m_vpar_origin[n];
211
212 m_B = HepMatrix(NCONSTR*m_nvtrk, NVTXPAR, 0);
213 m_A = HepMatrix(NCONSTR*m_nvtrk, NTRKPAR*m_nvtrk, 0);
214 m_BT = HepMatrix(NVTXPAR,NCONSTR*m_nvtrk, 0);
215 m_AT = HepMatrix(NTRKPAR*m_nvtrk, NCONSTR*m_nvtrk, 0);
216 m_G = HepVector(NCONSTR*m_nvtrk, 0);
217 m_W = HepSymMatrix(NCONSTR*m_nvtrk, 0);
218 m_E = HepMatrix(NTRKPAR*m_nvtrk, NVTXPAR, 0);
219
220 timer.Stop();
221 m_cpu[0] += timer.CpuTime();
222
223 // iteration loop
224 std::vector<double> chisq;
225 chisq.clear();
226 for (int it = 0; it < m_niter; it++)
227 {
228 timer.Start();
229 UpdateConstraints(m_vc[n]);
230 timer.Stop();
231 m_cpu[1] += timer.CpuTime();
232 timer.Start();
233 fitVertex(n);
234 timer.Stop();
235 m_cpu[2] += timer.CpuTime();
236 chisq.push_back(m_chisq[n]);
237 if (it > 0)
238 {
239 double delchi = chisq[it] - chisq[it-1];
240 if (fabs(delchi) < m_chiter) break;
241 }
242 }
243
244 /*REVISED
245 if(m_chisq[n] >= m_chicut || m_chisq[n] < 0) return okfit;
246 REVISED*/
247 if (m_chisq[n] >= m_chicut) return okfit;
248
249 // update vertex and its covariance
250 m_vpar_infit[n].setVx(m_xInfit);
251 m_vpar_infit[n].setEvx(m_xcovInfit);
252
253 okfit = true;
254 return okfit;
255}
int numberWTrack() const
Definition: TrackPool.h:79
HepVector w(int n) const
Definition: VertexFit.h:82

◆ init()

void VertexFit::init ( )

Definition at line 29 of file VertexFit.cxx.

30{
31 //derived from TrackPool
40 clearone();
41 cleartwo();
42
43 m_vpar_origin.clear();
44 m_vpar_infit.clear();
45 m_vc.clear();
46 m_chisq.clear();
47 m_chi = 9999.;
48 m_virtual_wtrk.clear();
49 m_niter = 10;
50 m_chiter = 1.0e-3;
51 m_chicut = 1000;
52
53 m_TRA = HepMatrix(6, 7, 0);
54 m_TRA[0][0] = 1.0;
55 m_TRA[1][1] = 1.0;
56 m_TRA[2][2] = 1.0;
57 m_TRA[3][4] = 1.0;
58 m_TRA[4][5] = 1.0;
59 m_TRA[5][6] = 1.0;
60 m_TRB = HepMatrix(7, 6, 0);
61 m_TRB[0][0] = 1.0;
62 m_TRB[1][1] = 1.0;
63 m_TRB[2][2] = 1.0;
64 m_TRB[4][3] = 1.0;
65 m_TRB[5][4] = 1.0;
66 m_TRB[6][5] = 1.0;
67}
void clearMapkinematic()
Definition: TrackPool.h:124
void clearGammaShapeList()
Definition: TrackPool.h:140
void clearWTrackOrigin()
Definition: TrackPool.h:111
void clearone()
Definition: TrackPool.h:115
void clearMappositionB()
Definition: TrackPool.h:126
void clearWTrackList()
Definition: TrackPool.h:113
void clearMappositionA()
Definition: TrackPool.h:125
void cleartwo()
Definition: TrackPool.h:116
void clearGammaShape()
Definition: TrackPool.h:139
void clearWTrackInfit()
Definition: TrackPool.h:112

Referenced by DQAKsInfo::calculate(), Gam4pikp::execute(), Ppjrhopi::execute(), Rhopi::execute(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), DQARhopi::execute(), JsiLL::execute(), BeamParams::execute(), PrimaryVertex::execute(), KShortReconstruction::execute(), LambdaReconstruction::execute(), DQAKsInfo::init(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), K0pipipi0::MTotal(), K3pi::MTotal(), K3pipi0::MTotal(), Kk::MTotal(), Kkpi0::MTotal(), Kkpipi::MTotal(), Kpi::MTotal(), Kpipi0::MTotal(), Kpipi0pi0::MTotal(), Pipi::MTotal(), and Pipipi0::MTotal().

◆ instance()

◆ pfit()

HepLorentzVector VertexFit::pfit ( int  n) const
inline

Definition at line 80 of file VertexFit.h.

80{return wTrackInfit(n).p();}

◆ pull()

bool VertexFit::pull ( int  n,
int  itk,
HepVector &  p 
)

Definition at line 454 of file VertexFit.cxx.

455{
456 assert(p.num_row() == 5);
457 vertexCovMatrix(n);
458
459 WTrackParameter wtrk0, wtrk1;
460 HepVector w1(6, 0);
461 HepVector w2(7, 0);
462 HepSymMatrix ew1(6, 0);
463 HepSymMatrix ew2(7, 0);
464 wtrk0 = wTrackOrigin(itk);
465 w1 = pInfit(itk);
466 ew1 = pcovInfit(itk);
467 w2 = Convert67(wtrk0.mass(), w1);
468 m_TRB[3][0] = w2[0] / w2[3];
469 m_TRB[3][1] = w2[1] / w2[3];
470 m_TRB[3][2] = w2[2] / w2[3];
471 ew2 = ew1.similarity(m_TRB);
472 wtrk1.setW(w2);
473 wtrk1.setEw(ew2);
474 wtrk1.setCharge(wtrk0.charge());
475
476 HTrackParameter htrk0(wtrk0);
477 HTrackParameter htrk1(wtrk1);
478 for (int i = 0; i < 5; i++)
479 {
480 double del = htrk0.eHel()[i][i] - htrk1.eHel()[i][i];
481 if (del == 0.0)
482 {
483 return false;
484 }
485 p[i] = (htrk0.helix()[i] - htrk1.helix()[i]) / sqrt(abs(del));
486 }
487 return true;
488}
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:212
int charge() const
double mass() const

Referenced by BeamParams::execute().

◆ setChisqCut()

void VertexFit::setChisqCut ( const double  chicut = 1000,
const double  chiter = 1.0e-3 
)
inline

Definition at line 56 of file VertexFit.h.

56{ m_chicut = chicut;m_chiter=chiter; }

Referenced by DQAKsInfo::calculate().

◆ setIterNumber()

void VertexFit::setIterNumber ( const int  niter = 10)
inline

Definition at line 55 of file VertexFit.h.

55{ m_niter = niter; }

◆ Swim()

◆ vpar()

◆ vx()

HepPoint3D VertexFit::vx ( int  n) const
inline

Definition at line 90 of file VertexFit.h.

90{ return m_vpar_infit[n].vx();}

Referenced by AddVertex(), and Gam4pikp::execute().

◆ Vx()

HepVector VertexFit::Vx ( int  n) const
inline

Definition at line 91 of file VertexFit.h.

91{ return m_vpar_infit[n].Vx();}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ w()

HepVector VertexFit::w ( int  n) const
inline

Definition at line 82 of file VertexFit.h.

82{return wTrackInfit(n).w();}

Referenced by Fit().

◆ wtrk()

◆ wVirtualTrack()

◆ xfit()

HepPoint3D VertexFit::xfit ( int  n) const
inline

Definition at line 81 of file VertexFit.h.

81{return wTrackInfit(n).x();}

The documentation for this class was generated from the following files: