BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcLine Class Reference

#include <MdcLine.h>

Public Member Functions

 MdcLine (int n)
 ~MdcLine ()
int fit (int nUse)
 MdcLine (int n)
 ~MdcLine ()
int fit (int nUse)
 MdcLine (int n)
 ~MdcLine ()
int fit (int nUse)

Public Attributes

double * x
double * y
double * sigma
double * resid
int nPoint
double slope
double intercept
double chisq
double errmat [3]

Detailed Description

Constructor & Destructor Documentation

◆ MdcLine() [1/3]

◆ ~MdcLine() [1/3]

MdcLine::~MdcLine ( )
inline

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcTrkRecon/MdcLine.h.

32 {
33 delete[] x;
34 delete[] y;
35 delete[] sigma;
36 delete[] resid;
37 };

◆ MdcLine() [2/3]

MdcLine::MdcLine ( int n)
inline

Definition at line 25 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcTrkRecon/MdcLine.h.

25 {
26 nPoint = n;
27 x = new double[n];
28 y = new double[n];
29 sigma = new double[n];
30 resid = new double[n];
31 };

◆ ~MdcLine() [2/3]

MdcLine::~MdcLine ( )
inline

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcTrkRecon/MdcLine.h.

32 {
33 delete[] x;
34 delete[] y;
35 delete[] sigma;
36 delete[] resid;
37 };

◆ MdcLine() [3/3]

MdcLine::MdcLine ( int n)
inline

Definition at line 25 of file Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/MdcLine.h.

25 {
26 nPoint = n;
27 x = new double[n];
28 y = new double[n];
29 sigma = new double[n];
30 resid = new double[n];
31 };

◆ ~MdcLine() [3/3]

MdcLine::~MdcLine ( )
inline

Definition at line 32 of file Reconstruction/MdcPatRec/MdcTrkRecon/include/MdcTrkRecon/MdcLine.h.

32 {
33 delete[] x;
34 delete[] y;
35 delete[] sigma;
36 delete[] resid;
37 };

Member Function Documentation

◆ fit() [1/3]

int MdcLine::fit ( int nUse)

Definition at line 10 of file MdcLine.cxx.

10 {
11
12 double s1, sx, sy, sxx, sxy; // The various sums.
13 double delinv, denom;
14 double weight = 0.013; // weight for hits, calculated from sigmas.
15 int ihit;
16 if ( nUse > nPoint ) nUse = nPoint;
17 s1 = sx = sy = sxx = sxy = 0.0;
18 chisq = 0.0;
19 for ( ihit = 0; ihit < nUse; ihit++ )
20 {
21
22 if ( sigma[ihit] < 0.0 ) continue;
23 weight = 1. / ( sigma[ihit] * sigma[ihit] ); // NEED sigma of MdcHits
24 s1 += weight;
25 sx += x[ihit] * weight;
26 sy += y[ihit] * weight;
27 sxx += x[ihit] * ( x[ihit] * weight );
28 sxy += y[ihit] * ( x[ihit] * weight );
29
30 // std::cout<<__FILE__<<" "<<__LINE__<< " "<<ihit<<" sigma "<<
31 // sigma[ihit] <<" weight "
32 //<< weight<<" x "
33 //<< x[ihit]<<" y "
34 //<< y[ihit]<< std::endl;
35 }
36
37 /* Calculate parameters. */
38 denom = s1 * sxx - sx * sx;
39 delinv = ( denom == 0.0 ) ? 1.e20 : 1. / denom;
40 intercept = ( sy * sxx - sx * sxy ) * delinv;
41 slope = ( s1 * sxy - sx * sy ) * delinv;
42 errmat[0] = sxx * delinv;
43 errmat[1] = -sx * delinv;
44 errmat[2] = s1 * delinv;
45 // std::cout << " After Fit:" << std::endl;//yzhang debug
46 /* Calculate residuals. */
47 for ( ihit = 0; ihit < nUse; ihit++ )
48 {
49 if ( sigma[ihit] < 0.0 ) continue;
50 resid[ihit] = ( y[ihit] - intercept - slope * x[ihit] );
51 chisq += resid[ihit] * resid[ihit] / ( sigma[ihit] * sigma[ihit] );
52 // std::cout << "resid "<<ihit<<" "<<resid[ihit]<<" sigma "<<sigma[ihit]<<" chisq add
53 // "<<resid[ihit] * resid[ihit] / (sigma[ihit] * sigma[ihit]) << std::endl;//yzhang debug
54 }
55
56 // std::cout<<__FILE__<<" "<<__LINE__
57 //<< " intercept "<<intercept<<" slope "<<slope
58 //<< " chisq "<<chisq<<std::endl;//yzhang debug
59 return 0;
60}
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition KarFin.h:34

Referenced by MdcSegGrouper::calcParByHits(), and MdcSegInfoSterO::calcStereo().

◆ fit() [2/3]

int MdcLine::fit ( int nUse)

◆ fit() [3/3]

int MdcLine::fit ( int nUse)

Member Data Documentation

◆ chisq

◆ errmat

double MdcLine::errmat

◆ intercept

◆ nPoint

int MdcLine::nPoint

◆ resid

double * MdcLine::resid

◆ sigma

◆ slope

◆ x

◆ y


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