BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
VertexFitRefine Class Reference

#include <VertexFitRefine.h>

Public Member Functions

 ~VertexFitRefine ()
 
void init ()
 
void AddTrack (const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
 
void AddTrack (const int number, const WTrackParameter wtrk)
 
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 setIterNumber (const int niter=10)
 
void setChisqCut (const double chicut=1000, const double chiter=1.0e-3)
 
void setMagCorrFactor (const double factor=1.000)
 
bool Fit ()
 
bool Fit (int n)
 
double chisq () const
 
double chisq (int n) const
 
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
 
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
 
HepVector helix (int n) const
 
WTrackParameter wVirtualTrack (int n) const
 
int getPath () const
 

Static Public Member Functions

static VertexFitRefineinstance ()
 

Friends

class VertexFit
 

Detailed Description

Definition at line 27 of file VertexFitRefine.h.

Constructor & Destructor Documentation

◆ ~VertexFitRefine()

VertexFitRefine::~VertexFitRefine ( )

Definition at line 56 of file VertexFitRefine.cxx.

57{
58 vtxfit->init();
59}
void init()
Definition VertexFit.cxx:29

Member Function Documentation

◆ AddBeamFit()

void VertexFitRefine::AddBeamFit ( int number,
VertexParameter vpar,
int n )
inline

Definition at line 86 of file VertexFitRefine.cc.

87{
88 vtxfit->AddBeamFit(number, vpar, n);
89}
const Int_t n
VertexParameter vpar(int n) const
void AddBeamFit(int number, VertexParameter vpar, int n)
Definition VertexFit.cxx:74

◆ AddTrack() [1/2]

void VertexFitRefine::AddTrack ( const int index,
RecMdcKalTrack * p,
const RecMdcKalTrack::PidType pid )

Definition at line 78 of file VertexFitRefine.cxx.

80{
81 m_trkIdxOrigin.push_back(index);
82 m_tracksOrigin.push_back(p);
83 m_trkPidOrigin.push_back(pid);
84 int idx = m_trkIdxOrigin.size() - 1;
85 if (index != idx) {
86 std::cerr << "TrackPool: wrong track index " << index << ", "
87 << m_trkIdxOrigin.size() << std::endl;
88 }
89
90 m_tracksOrigin[idx]->setPidType(m_trkPidOrigin[idx]);
91 m_wtrkInfit.push_back(WTrackParameter(VTXPDGM::empikp[m_trkPidOrigin[idx]],
92 m_tracksOrigin[idx]->helix(),
93 m_tracksOrigin[idx]->err()));
94 vtxfit->AddTrack(m_trkIdxOrigin[idx], m_wtrkInfit[idx]);
95}
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition TrackPool.cxx:22
HepVector helix(int n) const
const double empikp[5]

Referenced by KShortReconstruction::execute(), LambdaReconstruction::execute(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit_Lambdaref(), utility::SecondaryVFitref(), utility::UpdatedKsIfo(), utility::UpdatedLambdaIfo(), utility::vfitref(), and utility::vfitref().

◆ AddTrack() [2/2]

void VertexFitRefine::AddTrack ( const int number,
const WTrackParameter wtrk )

Definition at line 61 of file VertexFitRefine.cxx.

62{
63 m_trkIdxOrigin.push_back(index);
64 m_tracksOrigin.push_back(nullptr);
65 m_trkPidOrigin.push_back(RecMdcKalTrack::null);
66 int idx = m_trkIdxOrigin.size() - 1;
67 if (index != idx) {
68 std::cerr << "TrackPool: wrong track index " << index << ", "
69 << m_trkIdxOrigin.size() << std::endl;
70 }
71
72 m_tracksOrigin[idx]->setPidType(m_trkPidOrigin[idx]);
73 m_wtrkInfit.push_back(wtrk);
74 m_helices.push_back(HepVector(5, 0));
75 vtxfit->AddTrack(m_trkIdxOrigin[idx], m_wtrkInfit[idx]);
76}
WTrackParameter wtrk(int n) const

◆ AddVertex() [1/12]

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

Definition at line 22 of file VertexFitRefine.cc.

24{
25 vtxfit->AddVertex(number, vpar, n1, n2);
26}
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:89

◆ AddVertex() [2/12]

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

Definition at line 27 of file VertexFitRefine.cc.

29{
30 vtxfit->AddVertex(number, vpar, n1, n2, n3);
31}

◆ AddVertex() [3/12]

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

Definition at line 32 of file VertexFitRefine.cc.

34{
35 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4);
36}

◆ AddVertex() [4/12]

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

Definition at line 37 of file VertexFitRefine.cc.

39{
40 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5);
41}

◆ AddVertex() [5/12]

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

Definition at line 42 of file VertexFitRefine.cc.

44{
45 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6);
46}

◆ AddVertex() [6/12]

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

Definition at line 47 of file VertexFitRefine.cc.

50{
51 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7);
52}

◆ AddVertex() [7/12]

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

Definition at line 53 of file VertexFitRefine.cc.

56{
57 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7, n8);
58}

◆ AddVertex() [8/12]

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

Definition at line 59 of file VertexFitRefine.cc.

62{
63 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7, n8, n9);
64}

◆ AddVertex() [9/12]

void VertexFitRefine::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 )
inline

Definition at line 65 of file VertexFitRefine.cc.

68{
69 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10);
70}

◆ AddVertex() [10/12]

void VertexFitRefine::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 )
inline

Definition at line 71 of file VertexFitRefine.cc.

74{
75 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10,
76 n11);
77}

◆ AddVertex() [11/12]

void VertexFitRefine::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 )
inline

Definition at line 78 of file VertexFitRefine.cc.

82{
83 vtxfit->AddVertex(number, vpar, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10,
84 n11, n12);
85}

◆ AddVertex() [12/12]

◆ chisq() [1/2]

double VertexFitRefine::chisq ( ) const
inline

◆ chisq() [2/2]

double VertexFitRefine::chisq ( int n) const
inline

Definition at line 122 of file VertexFitRefine.cc.

123{
124 return vtxfit->chisq(0);
125}

◆ errorVx()

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

Definition at line 167 of file VertexFitRefine.cc.

168{
169 return vtxfit->errorVx(n, i);
170}
double errorVx(int n, int i) const
Definition VertexFit.h:88

◆ Evx()

HepSymMatrix VertexFitRefine::Evx ( int n) const
inline

Definition at line 162 of file VertexFitRefine.cc.

163{
164 return vtxfit->Evx(n);
165}
HepSymMatrix Evx(int n) const
Definition VertexFit.h:87

◆ Ew()

HepSymMatrix VertexFitRefine::Ew ( int n) const
inline

Definition at line 142 of file VertexFitRefine.cc.

143{
144 return vtxfit->Ew(n);
145}
HepSymMatrix Ew(int n) const
Definition VertexFit.h:78

◆ Fit() [1/2]

bool VertexFitRefine::Fit ( )

Definition at line 97 of file VertexFitRefine.cxx.

98{
99 HepPoint3D vx(0.0, 0.0, 0.0);
100
101 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
102 m_p4Infit.push_back(m_wtrkInfit[i].p());
103 m_x3Infit.push_back(m_wtrkInfit[i].x());
104 }
105
106 //// setup the initial vertex
107 HepPoint3D vWideVertex(0., 0., 0.);
108
109 HepSymMatrix evWideVertex(3, 0);
110 evWideVertex[0][0] = 1.0E12;
111 evWideVertex[1][1] = 1.0E12;
112 evWideVertex[2][2] = 1.0E12;
113
114 VertexParameter wideVertex;
115 wideVertex.setVx(vWideVertex);
116 wideVertex.setEvx(evWideVertex);
117
118 if (vtxfit->m_vpar_infit.size() == 0) {
119 std::cerr << "Not set Vertex?" << std::endl;
120 return false;
121 }
122
123 HepPoint3D ZDP = vtxfit->vx(0);
124 HepPoint3D ZDPE = HepPoint3D(9999.9, 9999.9, 9999.9);
125 bool ZFit = false;
126 HepVector ZVx = vtxfit->Vx(0);
127 HepSymMatrix ZEVx = evWideVertex;
128
129 //// do the fit
130 if (vtxfit->Fit(0)) {
131 vtxfit->Swim(0);
132 vtxfit->BuildVirtualParticle(0);
133
134 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
135 m_p4Infit[i] = vtxfit->pfit(i);
136 m_x3Infit[i] = vtxfit->xfit(i);
137 }
138
139 ZDP = vtxfit->vx(0);
140 ZVx = vtxfit->Vx(0);
141 ZEVx = vtxfit->Evx(0);
142 ZDPE.set(vtxfit->errorVx(0, 0), vtxfit->errorVx(0, 1),
143 vtxfit->errorVx(0, 2));
144 ZFit = true;
145 }
146
147 if (ZFit) {
148 if (ZDP.perp() > obeampipe) {
149 //// initialize the fitter
150 vtxfit->init();
151
152 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
153 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
154 if (m_trkPidOrigin[i] != RecMdcKalTrack::null) {
155 m_wtrkInfit[i] = WTrackParameter(
156 VTXPDGM::empikp[m_trkPidOrigin[i]],
157 m_tracksOrigin[i]->fhelix(), m_tracksOrigin[i]->ferr());
158 }
159 vtxfit->AddTrack(i, m_wtrkInfit[i]);
160 }
161
162 wideVertex.setVx(ZVx);
163 // wideVertex.setEvx(ZEVx * 25.0); // 5 * sigma square, not good
164 wideVertex.setEvx(evWideVertex);
165
166 //// add the daughters
167 vtxfit->AddVertex(0, wideVertex, m_trkIdxOrigin);
168 //// do the fit
169 if (vtxfit->Fit(0)) {
170 vtxfit->Swim(0);
171 vtxfit->BuildVirtualParticle(0);
172 vx = vtxfit->vx(0);
173 ZVx = vtxfit->Vx(0);
174 ZEVx = vtxfit->Evx(0);
175 thePath = 3;
176 } else {
177 vx = ZDP;
178 thePath = 2;
179 }
180 } else {
181 vx = ZDP;
182 thePath = 1;
183 }
184 } else { // initial ZFit failed.
185 //// initialize the fitter
186 vtxfit->init();
187
188 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
189 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
190 if (m_trkPidOrigin[i] != RecMdcKalTrack::null) {
191 m_wtrkInfit[i] = WTrackParameter(
192 VTXPDGM::empikp[m_trkPidOrigin[i]],
193 m_tracksOrigin[i]->fhelix(), m_tracksOrigin[i]->ferr());
194 }
195 vtxfit->AddTrack(i, m_wtrkInfit[i]);
196 }
197
198 if (vtxfit->Fit(0)) {
199 vtxfit->Swim(0);
200 vtxfit->BuildVirtualParticle(0);
201 vx = vtxfit->vx(0);
202 ZVx = vtxfit->Vx(0);
203 ZEVx = vtxfit->Evx(0);
204 thePath = 4;
205 } else {
206 thePath = 5;
207 return false;
208 }
209 }
210 //// initialize the fitter
211 vtxfit->init();
212
213 for (uint i = 0; i != m_trkIdxOrigin.size(); ++i) {
214 m_tracksOrigin[i]->setPidType(m_trkPidOrigin[i]);
215 if (m_trkPidOrigin[i] != RecMdcKalTrack::null) {
216 vtxext->KalFitExt(vx, m_tracksOrigin[i], m_trkPidOrigin[i]);
217 m_wtrkInfit[i] = WTrackParameter(VTXPDGM::empikp[m_trkPidOrigin[i]],
218 vtxext->getHelixVector(),
219 vtxext->getErrorMatrix());
220 }
221 m_p4Infit[i] = m_wtrkInfit[i].p();
222 m_x3Infit[i] = m_wtrkInfit[i].x();
223
224 vtxfit->AddTrack(i, m_wtrkInfit[i]);
225 }
226
227 wideVertex.setVx(vx);
228 // wideVertex.setEvx(ZEVx * 25.0); // 5 * sigma square, not good, why?
229 wideVertex.setEvx(evWideVertex);
230 //// add the daughters
231 vtxfit->AddVertex(0, wideVertex, m_trkIdxOrigin);
232
233 //// do the fit
234 if (vtxfit->Fit(0)) {
235 vtxfit->Swim(0);
236 vtxfit->BuildVirtualParticle(0);
237 } else {
238 thePath = 6;
239 }
240
241 return true;
242}
Double_t x[10]
HepGeom::Point3D< double > HepPoint3D
Definition Gam4pikp.cxx:37
void KalFitExt(const HepPoint3D &point, DstMdcKalTrack *kalTrack, const int pid)
const HepVector getHelixVector() const
const HepSymMatrix getErrorMatrix() const
HepPoint3D vx(int n) const
HepVector Vx(int n) const
Definition VertexFit.h:86
HepPoint3D vx(int n) const
Definition VertexFit.h:85
HepLorentzVector pfit(int n) const
Definition VertexFit.h:75
HepPoint3D xfit(int n) const
Definition VertexFit.h:76
void BuildVirtualParticle(int number)
void Swim(int n)
Definition VertexFit.h:59
bool Fit()
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)

Referenced by KShortReconstruction::execute(), LambdaReconstruction::execute(), Fit(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit_Lambdaref(), utility::SecondaryVFitref(), utility::UpdatedKsIfo(), utility::UpdatedLambdaIfo(), utility::vfitref(), and utility::vfitref().

◆ Fit() [2/2]

bool VertexFitRefine::Fit ( int n)
inline

Definition at line 112 of file VertexFitRefine.cc.

113{
114 return Fit();
115}

◆ getPath()

int VertexFitRefine::getPath ( ) const
inline

Definition at line 187 of file VertexFitRefine.cc.

188{
189 return thePath;
190}

◆ helix()

HepVector VertexFitRefine::helix ( int n) const
inline

Definition at line 182 of file VertexFitRefine.cc.

183{
184 return m_helices[n];
185}

Referenced by AddTrack().

◆ init()

void VertexFitRefine::init ( )

Definition at line 40 of file VertexFitRefine.cxx.

41{
42 m_trkIdxOrigin.clear();
43 m_tracksOrigin.clear();
44 m_trkPidOrigin.clear();
45 m_wtrkInfit.clear();
46 m_p4Infit.clear();
47 m_x3Infit.clear();
48 m_helices.clear();
49 vtxfit = VertexFit::instance();
50 vtxfit->init();
52 m_vtxsOrigin.clear();
53 thePath = 0;
54}
static VertexExtrapolate * instance()
static VertexFit * instance()
Definition VertexFit.cxx:15

Referenced by KShortReconstruction::execute(), LambdaReconstruction::execute(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit_Lambdaref(), utility::SecondaryVFitref(), utility::UpdatedKsIfo(), utility::UpdatedLambdaIfo(), utility::vfitref(), and utility::vfitref().

◆ instance()

◆ pfit()

HepLorentzVector VertexFitRefine::pfit ( int n) const
inline

◆ setChisqCut()

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

Definition at line 96 of file VertexFitRefine.cc.

98{
99 vtxfit->setChisqCut(chicut, chiter);
100}
void setChisqCut(const double chicut=1000, const double chiter=1.0e-3)
Definition VertexFit.h:49

◆ setIterNumber()

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

Definition at line 92 of file VertexFitRefine.cc.

93{
94 vtxfit->setIterNumber(niter);
95}
void setIterNumber(const int niter=10)
Definition VertexFit.h:48

◆ setMagCorrFactor()

void VertexFitRefine::setMagCorrFactor ( const double factor = 1.000)
inline

Definition at line 101 of file VertexFitRefine.cc.

102{
103 vtxfit->setMagCorrFactor(factor);
104}
void setMagCorrFactor(const double factor=1.000)
Definition VertexFit.h:50

◆ vpar()

◆ Vx()

HepVector VertexFitRefine::Vx ( int n) const
inline

Definition at line 157 of file VertexFitRefine.cc.

158{
159 return vtxfit->Vx(n);
160}

◆ vx()

HepPoint3D VertexFitRefine::vx ( int n) const
inline

Definition at line 152 of file VertexFitRefine.cc.

153{
154 return vtxfit->vx(n);
155}

Referenced by Fit().

◆ w()

HepVector VertexFitRefine::w ( int n) const
inline

Definition at line 137 of file VertexFitRefine.cc.

138{
139 return vtxfit->w(n);
140}
HepVector w(int n) const
Definition VertexFit.h:77

◆ wtrk()

WTrackParameter VertexFitRefine::wtrk ( int n) const
inline

Definition at line 147 of file VertexFitRefine.cc.

148{
149 return vtxfit->wtrk(n);
150}
WTrackParameter wtrk(int n) const
Definition VertexFit.h:79

Referenced by AddTrack(), utility::vfitref(), and utility::vfitref().

◆ wVirtualTrack()

WTrackParameter VertexFitRefine::wVirtualTrack ( int n) const
inline

◆ xfit()

HepPoint3D VertexFitRefine::xfit ( int n) const
inline

Definition at line 132 of file VertexFitRefine.cc.

133{
134 return vtxfit->xfit(n);
135}

Friends And Related Symbol Documentation

◆ VertexFit

friend class VertexFit
friend

Definition at line 29 of file VertexFitRefine.h.


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