BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_barrel_sigma Class Reference

#include <calib_barrel_sigma.h>

+ Inheritance diagram for calib_barrel_sigma:

Public Member Functions

 calib_barrel_sigma (const unsigned int nzbin)
 
 ~calib_barrel_sigma ()
 
void calculate (RecordSet *&data, unsigned int icounter)
 
- Public Member Functions inherited from TofCalibFit
 TofCalibFit (bool isbarrel, const int npar)
 
 ~TofCalibFit ()
 
const string & name () const
 
virtual void calculate (RecordSet *&data, unsigned int icounter)=0
 
void fillTxt (const char *file)
 
void fillRoot (const char *file)
 
HepVector tcorrelation ()
 
void setTCorrelation (HepVector tc)
 

Additional Inherited Members

- Protected Attributes inherited from TofCalibFit
int m_npar
 
unsigned int nKind
 
unsigned int nBinPerCounter
 
unsigned int nHistPerCounter
 
unsigned int nCanvasPerCounter
 
std::vector< unsigned int > nGraphPerCanvasPerCounter
 
unsigned int nHistogram
 
unsigned int nCanvas
 
std::vector< unsigned int > nGraphPerCanvas
 
string m_name
 
HepVector X
 
std::vector< TH1F * > m_histograms
 
std::vector< TH1F * > m_graphs
 
std::vector< HepVector > m_result
 
std::vector< string > CanvasPerCounterName
 
std::vector< string > CanvasName
 
HepVector m_tcorrelation
 

Detailed Description

Definition at line 10 of file calib_barrel_sigma.h.

Constructor & Destructor Documentation

◆ calib_barrel_sigma()

calib_barrel_sigma::calib_barrel_sigma ( const unsigned int  nzbin)

Definition at line 22 of file calib_barrel_sigma.cxx.

22 :TofCalibFit( true, nBarrelSigma ) {
23
24 nKind = 5; // 0:tleft, 1:tright, 2:t0, 3:tplus, 4:tminus
25 nBinPerCounter = nzbin;
26
29 CanvasPerCounterName.push_back( static_cast<string>("Barrel-offset") );
30 CanvasPerCounterName.push_back( static_cast<string>("Offset-TimeCorrelation") );
31 CanvasPerCounterName.push_back( static_cast<string>("Barrel-sigma") );
32 CanvasPerCounterName.push_back( static_cast<string>("Sigma-TimeCorrelation") );
33 nGraphPerCanvasPerCounter.push_back(3);
34 nGraphPerCanvasPerCounter.push_back(2);
35 nGraphPerCanvasPerCounter.push_back(3);
36 nGraphPerCanvasPerCounter.push_back(3);
37
38 nHistogram = 0;
39 nCanvas = 0;
40
41 int numGraphs = 0;
42 std::vector<unsigned int>::iterator iter = nGraphPerCanvasPerCounter.begin();
43 for( ; iter!=nGraphPerCanvasPerCounter.end(); iter++ ) {
44 numGraphs = numGraphs + (*iter);
45 }
46 if( numGraphs != nGraphTotalSigma ) {
47 cout << "tofcalgsec::calib_barrel_sigma: the number of Graphs is NOT reasonable!!!" << endl;
48 exit(0);
49 }
50
51 m_name = string("calib_barrel_sigma");
52
53 const int tbin = 150;
54 const double tbegin = -1.5;
55 const double tend = 1.5;
56
57 // histograms per counter
58 char hname[256];
59 for( unsigned int i=0; i<NBarrel; i++ ) {
60 m_result.push_back( HepVector(nBarrelSigma,0) );
61 for( unsigned int j=0; j<nKind; j++ ) {
62 for( unsigned int k=0; k<nBinPerCounter; k++ ) {
63 if( j==0 ) { sprintf( hname, "tleft-id%i-z%i", i, k); }
64 else if( j==1 ) { sprintf( hname, "tright-id%i-z%i", i, k); }
65 else if( j==2 ) { sprintf( hname, "t0-id%i-z%i", i, k); }
66 else if( j==3 ) { sprintf( hname, "tplus-id%i-z%i", i, k); }
67 else if( j==4 ) { sprintf( hname, "tminus-id%i-z%i", i, k); }
68 m_histograms.push_back( new TH1F( hname, hname, tbin, tbegin, tend ) );
69
70 m_fitresult.push_back( HepVector(nParSigma,0) );
71 }
72 }
73 }
74
75 zpos.resize( nBinPerCounter );
76 zposerr.resize( nBinPerCounter );
77 zstep = ( zend - zbegin )/nBinPerCounter;
78 for( unsigned int i=0; i<nBinPerCounter; i++ ) {
79 zpos[i] = zbegin + ( i+0.5 )*zstep;
80 zposerr[i] = 0.5*zstep;
81 }
82
83}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
const double zend
Definition: TofCalibFit.h:13
const double zbegin
Definition: TofCalibFit.h:12
const unsigned int NBarrel
Definition: TofDataSet.h:12
const int nParSigma
const int nBarrelSigma
const int nGraphTotalSigma
string m_name
Definition: TofCalibFit.h:50
std::vector< HepVector > m_result
Definition: TofCalibFit.h:55
unsigned int nCanvas
Definition: TofCalibFit.h:47
std::vector< TH1F * > m_histograms
Definition: TofCalibFit.h:53
unsigned int nBinPerCounter
Definition: TofCalibFit.h:41
unsigned int nKind
Definition: TofCalibFit.h:40
std::vector< unsigned int > nGraphPerCanvasPerCounter
Definition: TofCalibFit.h:45
unsigned int nCanvasPerCounter
Definition: TofCalibFit.h:44
unsigned int nHistPerCounter
Definition: TofCalibFit.h:43
unsigned int nHistogram
Definition: TofCalibFit.h:46
std::vector< string > CanvasPerCounterName
Definition: TofCalibFit.h:57
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)

◆ ~calib_barrel_sigma()

calib_barrel_sigma::~calib_barrel_sigma ( )

Definition at line 86 of file calib_barrel_sigma.cxx.

86 {
87 m_fitresult.clear();
88 zpos.clear();
89 zposerr.clear();
90}

Member Function Documentation

◆ calculate()

void calib_barrel_sigma::calculate ( RecordSet *&  data,
unsigned int  icounter 
)
virtual

Implements TofCalibFit.

Definition at line 93 of file calib_barrel_sigma.cxx.

93 {
94
95 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
96
97 if( data->size() > 0 ) {
98 std::vector<Record*>::iterator iter = data->begin();
99 for( ; iter!=data->end(); iter++ ) {
100 fillRecord( (*iter), icounter );
101 }
102 }
103 fitHistogram( icounter );
104 fillGraph( icounter );
105 fitGraph( icounter );
106
107 if( data->size() > 0 ) {
108 std::vector<Record*>::iterator iter = data->begin();
109 for( ; iter!=data->end(); iter++ ) {
110 updateData( (*iter), icounter );
111 fillRecordT0( (*iter), icounter );
112 }
113 }
114 fitHistogramT0( icounter );
115 fillGraphT0( icounter );
116 fitGraphT0( icounter );
117
118 return;
119}
const string & name() const
Definition: TofCalibFit.h:27

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