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

#include <SecondVertexFit.h>

+ Inheritance diagram for SecondVertexFit:

Public Member Functions

 ~SecondVertexFit ()
 
void init ()
 
void setIterNumber (const int niter=10)
 
void setChisqCut (const double chicut=500, const double chiter=1.0e-2)
 
void setVpar (const VertexParameter vpar)
 
void setPrimaryVertex (const VertexParameter vpar)
 
void setMagCorrFactor (const double factor=1.000)
 
bool Fit ()
 
double chisq () const
 
double decayLength () const
 
double decayLengthError () const
 
double ctau () const
 
double ctauError () const
 
double factor () const
 
HepLorentzVector p4par () const
 
WTrackParameter wpar () const
 
VertexParameter vpar () const
 
HepPoint3D crossPoint () const
 
Hep3Vector crossVector () 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 SecondVertexFitinstance ()
 

Detailed Description

Definition at line 20 of file SecondVertexFit.h.

Constructor & Destructor Documentation

◆ ~SecondVertexFit()

SecondVertexFit::~SecondVertexFit ( )

Definition at line 64 of file SecondVertexFit.cxx.

65{
66 //if(m_pointer) delete m_pointer;
67}

Member Function Documentation

◆ chisq()

◆ crossPoint()

HepPoint3D SecondVertexFit::crossPoint ( ) const
inline

Definition at line 81 of file SecondVertexFit.h.

82{
83 return HepPoint3D(m_crxyz[0], m_crxyz[1], m_crxyz[2]);
84}
HepGeom::Point3D< double > HepPoint3D
Definition Gam4pikp.cxx:37

◆ crossVector()

Hep3Vector SecondVertexFit::crossVector ( ) const
inline

Definition at line 86 of file SecondVertexFit.h.

87{
88 return Hep3Vector(m_crxyz[0] - m_vpar_primary.Vx()[0],
89 m_crxyz[1] - m_vpar_primary.Vx()[1],
90 m_crxyz[2] - m_vpar_primary.Vx()[2]);
91}
HepVector Vx() const

◆ ctau()

double SecondVertexFit::ctau ( ) const
inline

Definition at line 48 of file SecondVertexFit.h.

48{return m_ctau;}

Referenced by DQAKsKpi::execute(), DQAKsKpiDEDX::execute(), inclks::execute(), incllambda::execute(), and Signal::execute().

◆ ctauError()

double SecondVertexFit::ctauError ( ) const
inline

Definition at line 49 of file SecondVertexFit.h.

49{return m_ctau_error;}

◆ decayLength()

◆ decayLengthError()

◆ factor()

double SecondVertexFit::factor ( ) const
inline

Definition at line 50 of file SecondVertexFit.h.

50{return m_factor;}

Referenced by setMagCorrFactor().

◆ Fit()

bool SecondVertexFit::Fit ( )

Definition at line 87 of file SecondVertexFit.cxx.

88{
89 bool okfit = false;
90
91 HepVector aOrigin(10, 0);
92 HepVector aInfit(10, 0);
93 HepSymMatrix VaOrigin(10, 0);
94 HepSymMatrix VaInfit(10, 0);
95 aOrigin.sub(1, wTrackOrigin(0).w());
96 aOrigin.sub(8, m_vpar_primary.Vx());
97 VaOrigin.sub(1, wTrackOrigin(0).Ew());
98 VaOrigin.sub(8, m_vpar_primary.Evx());
99 HepVector ctOrigin(1, 0);
100 HepVector ctInfit(1, 0);
101 HepSymMatrix Vct(1, 0);
102 aInfit = aOrigin;
103 ctInfit = ctOrigin;
104
105 std::vector<double> chisq;
106 chisq.clear();
107 double chi2 = 999;
108 for(int it = 0; it < m_niter; it++)
109 {
110 HepMatrix D(3, 10, 0);
111 HepLorentzVector p4par = HepLorentzVector(aInfit[0], aInfit[1], aInfit[2], aInfit[3]);
112 HepMatrix E(3,1,0);
113 HepVector d(3, 0);
114 if (wTrackOrigin(0).charge() == 0)
115 {
116 D[0][4] = -1.0;
117 D[0][7] = 1.0;
118 D[1][5] = -1.0;
119 D[1][8] = 1.0;
120 D[2][6] = -1.0;
121 D[2][9] = 1.0;
122
123 E[0][0] = p4par.px()/p4par.m();
124 E[1][0] = p4par.py()/p4par.m();
125 E[2][0] = p4par.pz()/p4par.m();
126
127 d[0] = aInfit[7]-aInfit[4]+ctInfit[0]*p4par.px()/p4par.m();
128 d[1] = aInfit[8]-aInfit[5]+ctInfit[0]*p4par.py()/p4par.m();
129 d[2] = aInfit[9]-aInfit[6]+ctInfit[0]*p4par.pz()/p4par.m();
130 }
131 else
132 {
133// double afield = VertexFitBField::instance()->getCBz(m_vpar_primary.Vx(), m_vpar_secondary.Vx());
134 double afield = m_factor * VertexFitBField::instance()->getCBz(m_vpar_primary.Vx(), m_vpar_secondary.Vx());
135 double a = afield * wTrackOrigin(0).charge();
136 D[0][4] = -1.0;
137 D[0][7] = 1.0;
138 D[1][5] = -1.0;
139 D[1][8] = 1.0;
140 D[2][6] = -1.0;
141 D[2][9] = 1.0;
142
143 E[0][0] = p4par.px() / p4par.m() * cos(a * ctInfit[0] / p4par.m()) + p4par.py() / p4par.m() * sin(a * ctInfit[0] / p4par.m());
144 E[1][0] = p4par.py() / p4par.m() * cos(a * ctInfit[0] / p4par.m()) - p4par.px() / p4par.m() * sin(a * ctInfit[0] / p4par.m());
145 E[2][0] = p4par.pz() / p4par.m();
146
147 d[0] = aInfit[7] - aInfit[4]+p4par.px()/a * sin(a * ctInfit[0]/p4par.m()) + p4par.py()/a*(1-cos(a*ctInfit[0]/p4par.m()));
148 d[1] = aInfit[8] - aInfit[5]+p4par.py()/a * sin(a * ctInfit[0]/p4par.m()) - p4par.px()/a*(1-cos(a*ctInfit[0]/p4par.m()));
149 d[2] = aInfit[9] - aInfit[6]+ctInfit[0]*p4par.pz()/p4par.m();
150 }
151
152 HepSymMatrix VD(3, 0);
153 HepVector dela0(10, 0);
154 HepVector lambda0(3, 0);
155 HepVector delct(1, 0);
156 HepVector lambda(3, 0);
157 int ifail;
158
159 VD = (VaOrigin.similarity(D)).inverse(ifail);
160 dela0 = aOrigin - aInfit;
161 lambda0 = VD*(D*dela0 + d);
162 Vct = (VD.similarity(E.T())).inverse(ifail);
163 delct = -(Vct * E.T()) * lambda0;
164 ctInfit = ctInfit + delct;
165 lambda = lambda0 + (VD * E) * delct;
166 aInfit = aOrigin - (VaOrigin * D.T()) * lambda;
167 chi2 = dot(lambda, D*dela0 + d);
168 VaInfit = VaOrigin - (VD.similarity(D.T())).similarity(VaOrigin);
169 VaInfit = VaInfit + (((Vct.similarity(E)).similarity(VD)).similarity(D.T())).similarity(VaOrigin);
170
171 chisq.push_back(chi2);
172
173 if(it > 0)
174 {
175 double delchi = chisq[it] - chisq[it-1];
176 if (fabs(delchi) < m_chiter) break;
177 }
178 }
179 if (chi2 < 0 || chi2 > m_chicut)
180 return okfit;
181
182 HepLorentzVector p4par = HepLorentzVector(aInfit[0], aInfit[1], aInfit[2], aInfit[3]);
183 m_ctau = ctInfit[0];
184 m_ctau_error = sqrt(Vct[0][0]);
185 m_lxyz = ctInfit[0] * p4par.rho() / p4par.m();
186 m_lxyz_error = sqrt(Vct[0][0]) * p4par.rho() / p4par.m();
187 m_chisq = chi2;
188 m_p4par = p4par;
189 for(int i = 0; i < 3; i++)
190 m_crxyz[i] = aInfit[4+i];
191 HepVector w(7, 0);
192 HepSymMatrix Ew(7, 0);
193 for(int i = 0; i < 7; i++)
194 {
195 w[i] = aInfit[i];
196 for(int j = 0; j < 7; j++)
197 {
198 Ew[i][j] = VaInfit[i][j];
199 }
200 }
201 m_wtrk.setW(w);
202 m_wtrk.setEw(Ew);
203 m_wtrk.setCharge(wTrackOrigin(0).charge());
204 okfit = true;
205 return okfit;
206}
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
double w
HepLorentzVector p4par() const
double chisq() const
std::vector< WTrackParameter > wTrackOrigin() const
Definition TrackPool.h:72
double getCBz(const HepVector &vtx, const HepVector &trackPosition)
HepSymMatrix Evx() const
void setEw(const HepSymMatrix &Ew)
void setCharge(const int charge)
void setW(const HepVector &w)
float charge

Referenced by DQAKsInfo::calculate(), DQAKsKpi::execute(), DQAKsKpiDEDX::execute(), inclks::execute(), incllambda::execute(), JsiLL::execute(), Signal::execute(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), K0pipipi0::MTotal(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit(), utility::SecondaryVFit_Lambda(), utility::SecondaryVFit_Lambdaref(), and utility::SecondaryVFitref().

◆ init()

void SecondVertexFit::init ( )

Definition at line 69 of file SecondVertexFit.cxx.

70{
74 m_vpar_secondary = VertexParameter();
75 m_lxyz = 0;
76 m_lxyz_error = 0;
77 m_p4par = HepLorentzVector(0, 0, 0, 0);
78 m_crxyz = HepVector(3, 0);
79 m_chisq = 9999;
80 m_wtrk = WTrackParameter();
81 m_niter = 10;
82 m_chicut = 500;
83 m_chiter = 1.0e-2;
84 m_factor = 1.000;
85}
void clearWTrackOrigin()
Definition TrackPool.h:111
void clearWTrackList()
Definition TrackPool.h:113
void clearWTrackInfit()
Definition TrackPool.h:112

Referenced by DQAKsInfo::calculate(), DQAKsKpi::execute(), DQAKsKpiDEDX::execute(), inclks::execute(), incllambda::execute(), JsiLL::execute(), Signal::execute(), DQAKsInfo::init(), K0kk::MTotal(), K0kpi::MTotal(), K0pi0::MTotal(), K0pipi::MTotal(), K0pipipi0::MTotal(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit(), utility::SecondaryVFit_Lambda(), utility::SecondaryVFit_Lambdaref(), and utility::SecondaryVFitref().

◆ instance()

◆ p4par()

HepLorentzVector SecondVertexFit::p4par ( ) const
inline

◆ setChisqCut()

void SecondVertexFit::setChisqCut ( const double chicut = 500,
const double chiter = 1.0e-2 )
inline

Definition at line 33 of file SecondVertexFit.h.

33{m_chicut = chicut;m_chiter=chiter;}

Referenced by DQAKsInfo::calculate().

◆ setIterNumber()

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

Definition at line 32 of file SecondVertexFit.h.

32{m_niter = niter;}

◆ setMagCorrFactor()

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

Definition at line 39 of file SecondVertexFit.h.

39{m_factor = factor;}
double factor() const

◆ setPrimaryVertex()

◆ setVpar()

◆ vpar()

VertexParameter SecondVertexFit::vpar ( ) const
inline

Definition at line 54 of file SecondVertexFit.h.

54{return m_vpar_secondary;}

Referenced by setPrimaryVertex(), and setVpar().

◆ wpar()

WTrackParameter SecondVertexFit::wpar ( ) const
inline

Definition at line 53 of file SecondVertexFit.h.

53{return m_wtrk;}

Referenced by DQAKsKpi::execute(), DQAKsKpiDEDX::execute(), JsiLL::execute(), Signal::execute(), and K0pipi::MTotal().


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