BOSS 7.0.1
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)
 

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/2]

MdcLine::MdcLine ( int  n)
inline

◆ ~MdcLine() [1/2]

MdcLine::~MdcLine ( )
inline

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

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

◆ MdcLine() [2/2]

MdcLine::MdcLine ( int  n)
inline

Definition at line 25 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/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/2]

MdcLine::~MdcLine ( )
inline

Definition at line 32 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/MdcTrkRecon/MdcLine.h.

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

Member Function Documentation

◆ fit() [1/2]

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 if (sigma[ihit] < 0.0) continue;
22 weight = 1. / (sigma[ihit] * sigma[ihit]);//NEED sigma of MdcHits
23 s1 += weight;
24 sx += x[ihit] * weight;
25 sy += y[ihit] * weight;
26 sxx += x[ihit] * (x[ihit] * weight);
27 sxy += y[ihit] * (x[ihit] * weight);
28
29 //std::cout<<__FILE__<<" "<<__LINE__<< " "<<ihit<<" sigma "<<
30 //sigma[ihit] <<" weight "
31 //<< weight<<" x "
32 //<< x[ihit]<<" y "
33 //<< y[ihit]<< std::endl;
34 }
35
36 /* Calculate parameters. */
37 denom = s1 * sxx - sx * sx;
38 delinv = (denom == 0.0) ? 1.e20 : 1. / denom;
39 intercept = (sy * sxx - sx * sxy) * delinv;
40 slope = (s1 * sxy - sx * sy) * delinv;
41 errmat[0] = sxx * delinv;
42 errmat[1] = -sx * delinv;
43 errmat[2] = s1 * delinv;
44 //std::cout << " After Fit:" << std::endl;//yzhang debug
45 /* Calculate residuals. */
46 for (ihit = 0; ihit < nUse; ihit++) {
47 if (sigma[ihit] < 0.0) continue;
48 resid[ihit] = ( y[ihit] - intercept - slope * x[ihit] );
49 chisq += resid[ihit] * resid[ihit] / (sigma[ihit] * sigma[ihit]);
50 //std::cout << "resid "<<ihit<<" "<<resid[ihit]<<" sigma "<<sigma[ihit]<<" chisq add "<<resid[ihit] * resid[ihit] / (sigma[ihit] * sigma[ihit]) << std::endl;//yzhang debug
51 }
52
53 //std::cout<<__FILE__<<" "<<__LINE__
54 //<< " intercept "<<intercept<<" slope "<<slope
55 //<< " chisq "<<chisq<<std::endl;//yzhang debug
56 return 0;
57}
*********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/2]

int MdcLine::fit ( int  nUse)

Member Data Documentation

◆ chisq

double MdcLine::chisq

◆ errmat

double MdcLine::errmat

Definition at line 23 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcLine.h.

Referenced by fit(), and MdcSeg::setValues().

◆ intercept

◆ nPoint

int MdcLine::nPoint

◆ resid

double * MdcLine::resid

Definition at line 18 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcLine.h.

Referenced by fit(), MdcLine(), and ~MdcLine().

◆ sigma

◆ slope

◆ x

◆ y


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