BOSS 7.0.5
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)
 
void setMagCorrFactor (const double factor=1.000)
 
double factor () const
 
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
 
 ~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)
 
void setMagCorrFactor (const double factor=1.000)
 
double factor () const
 
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
 
 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 ()
 
static VertexFitinstance ()
 

Detailed Description

Constructor & Destructor Documentation

◆ ~VertexFit() [1/2]

VertexFit::~VertexFit ( )

Definition at line 22 of file VertexFit.cxx.

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

◆ ~VertexFit() [2/2]

VertexFit::~VertexFit ( )

Member Function Documentation

◆ AddBeamFit() [1/2]

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

Definition at line 74 of file VertexFit.cxx.

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

◆ AddBeamFit() [2/2]

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

◆ AddVertex() [1/24]

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

Definition at line 108 of file VertexFit.cxx.

109{
110 std::vector<int> tlis = AddList(n1, n2);
111 AddVertex(number, vpar, tlis);
112}
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/24]

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

◆ AddVertex() [3/24]

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

Definition at line 115 of file VertexFit.cxx.

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

◆ AddVertex() [4/24]

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

◆ AddVertex() [5/24]

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

Definition at line 121 of file VertexFit.cxx.

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

◆ AddVertex() [6/24]

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

◆ AddVertex() [7/24]

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

Definition at line 127 of file VertexFit.cxx.

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

◆ AddVertex() [8/24]

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

◆ AddVertex() [9/24]

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

Definition at line 133 of file VertexFit.cxx.

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

◆ AddVertex() [10/24]

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

◆ AddVertex() [11/24]

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

Definition at line 139 of file VertexFit.cxx.

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

◆ AddVertex() [12/24]

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

◆ AddVertex() [13/24]

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 145 of file VertexFit.cxx.

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

◆ AddVertex() [14/24]

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

◆ AddVertex() [15/24]

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 151 of file VertexFit.cxx.

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

◆ AddVertex() [16/24]

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 
)

◆ AddVertex() [17/24]

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 157 of file VertexFit.cxx.

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

◆ AddVertex() [18/24]

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 
)

◆ AddVertex() [19/24]

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 163 of file VertexFit.cxx.

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

◆ AddVertex() [20/24]

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 
)

◆ AddVertex() [21/24]

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 169 of file VertexFit.cxx.

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

◆ AddVertex() [22/24]

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 
)

◆ AddVertex() [23/24]

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

Definition at line 89 of file VertexFit.cxx.

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

Referenced by AddVertex(), DQAKsInfo::calculate(), Gam4pikp::execute(), Ppjrhopi::execute(), Rhopi::execute(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), DQAKsKpiDEDX::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(), Pipipi0::MTotal(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit(), utility::SecondaryVFit_Lambda(), and utility::vfit().

◆ AddVertex() [24/24]

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

◆ BeamFit() [1/2]

bool VertexFit::BeamFit ( int  n)

Definition at line 259 of file VertexFit.cxx.

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

◆ BeamFit() [2/2]

bool VertexFit::BeamFit ( int  n)

◆ BuildVirtualParticle() [1/2]

void VertexFit::BuildVirtualParticle ( int  number)

Definition at line 619 of file VertexFit.cxx.

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

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

◆ BuildVirtualParticle() [2/2]

void VertexFit::BuildVirtualParticle ( int  number)

◆ chisq() [1/4]

◆ chisq() [2/4]

double VertexFit::chisq ( ) const
inline

Definition at line 65 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

65{return m_chi;}

◆ chisq() [3/4]

double VertexFit::chisq ( int  n) const
inline

Definition at line 66 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

66{return m_chisq[n];}

◆ chisq() [4/4]

double VertexFit::chisq ( int  n) const
inline

Definition at line 66 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

66{return m_chisq[n];}

◆ cpu() [1/2]

HepVector VertexFit::cpu ( ) const
inline

Definition at line 81 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

81{return m_cpu;}

◆ cpu() [2/2]

HepVector VertexFit::cpu ( ) const
inline

Definition at line 81 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

81{return m_cpu;}

◆ errorVx() [1/2]

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

Definition at line 87 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

87{ return sqrt((m_vpar_infit[n].Evx())[i][i]);}

◆ errorVx() [2/2]

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

Definition at line 87 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

87{ return sqrt((m_vpar_infit[n].Evx())[i][i]);}

◆ Evx() [1/2]

HepSymMatrix VertexFit::Evx ( int  n) const
inline

Definition at line 86 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

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

◆ Evx() [2/2]

HepSymMatrix VertexFit::Evx ( int  n) const
inline

Definition at line 86 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ Ew() [1/2]

HepSymMatrix VertexFit::Ew ( int  n) const
inline

Definition at line 77 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

Referenced by BuildVirtualParticle(), and Fit().

◆ Ew() [2/2]

HepSymMatrix VertexFit::Ew ( int  n) const
inline

Definition at line 77 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ factor() [1/2]

double VertexFit::factor ( ) const
inline

Definition at line 50 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

50{ return m_factor; }

Referenced by setMagCorrFactor().

◆ factor() [2/2]

double VertexFit::factor ( ) const
inline

Definition at line 50 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

50{ return m_factor; }

◆ Fit() [1/4]

◆ Fit() [2/4]

bool VertexFit::Fit ( )

◆ Fit() [3/4]

bool VertexFit::Fit ( int  n)

Definition at line 175 of file VertexFit.cxx.

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

◆ Fit() [4/4]

bool VertexFit::Fit ( int  n)

◆ init() [1/2]

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
68 m_factor = 1.000;
69}

Referenced by DQAKsInfo::calculate(), Gam4pikp::execute(), Ppjrhopi::execute(), Rhopi::execute(), inclks::execute(), incllambda::execute(), DQAKsKpi::execute(), DQAKsKpiDEDX::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(), Pipipi0::MTotal(), LocalKsSelector::operator()(), LocalLambdaSelector::operator()(), utility::SecondaryVFit(), utility::SecondaryVFit_Lambda(), and utility::vfit().

◆ init() [2/2]

void VertexFit::init ( )

◆ instance() [1/2]

◆ instance() [2/2]

static VertexFit * VertexFit::instance ( )
static

◆ pfit() [1/2]

HepLorentzVector VertexFit::pfit ( int  n) const
inline

Definition at line 74 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

◆ pfit() [2/2]

HepLorentzVector VertexFit::pfit ( int  n) const
inline

Definition at line 74 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ pull() [1/2]

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

Definition at line 457 of file VertexFit.cxx.

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

Referenced by BeamParams::execute().

◆ pull() [2/2]

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

◆ setChisqCut() [1/2]

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

Definition at line 48 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

48{ m_chicut = chicut;m_chiter = chiter; }

Referenced by DQAKsInfo::calculate().

◆ setChisqCut() [2/2]

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

Definition at line 48 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

48{ m_chicut = chicut;m_chiter = chiter; }

◆ setIterNumber() [1/2]

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

Definition at line 47 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

47{ m_niter = niter; }

◆ setIterNumber() [2/2]

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

Definition at line 47 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

47{ m_niter = niter; }

◆ setMagCorrFactor() [1/2]

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

◆ setMagCorrFactor() [2/2]

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

Definition at line 49 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

49{ m_factor = factor; }

◆ Swim() [1/2]

◆ Swim() [2/2]

void VertexFit::Swim ( int  n)
inline

Definition at line 58 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

58{ vertexCovMatrix(n); swimVertex(n);}

◆ vpar() [1/2]

◆ vpar() [2/2]

VertexParameter VertexFit::vpar ( int  n) const
inline

Definition at line 88 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

88{return m_vpar_infit[n];}

◆ vx() [1/2]

HepPoint3D VertexFit::vx ( int  n) const
inline

Definition at line 84 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

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

◆ Vx() [1/2]

HepVector VertexFit::Vx ( int  n) const
inline

Definition at line 85 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

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

◆ vx() [2/2]

HepPoint3D VertexFit::vx ( int  n) const
inline

Definition at line 84 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ Vx() [2/2]

HepVector VertexFit::Vx ( int  n) const
inline

Definition at line 85 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ w() [1/2]

HepVector VertexFit::w ( int  n) const
inline

Definition at line 76 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

◆ w() [2/2]

HepVector VertexFit::w ( int  n) const
inline

Definition at line 76 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

◆ wtrk() [1/2]

◆ wtrk() [2/2]

WTrackParameter VertexFit::wtrk ( int  n) const
inline

Definition at line 78 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

78{return wTrackInfit(n);}

◆ wVirtualTrack() [1/2]

◆ wVirtualTrack() [2/2]

WTrackParameter VertexFit::wVirtualTrack ( int  n) const
inline

Definition at line 91 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

91{return m_virtual_wtrk[n];}

◆ xfit() [1/2]

HepPoint3D VertexFit::xfit ( int  n) const
inline

Definition at line 75 of file Analysis/VertexFit/VertexFit-00-02-85/VertexFit/VertexFit.h.

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

◆ xfit() [2/2]

HepPoint3D VertexFit::xfit ( int  n) const
inline

Definition at line 75 of file InstallArea/include/VertexFit/VertexFit/VertexFit.h.

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

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