CGEM BOSS 6.6.5.i
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
 
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< TGraphErrors * > 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 21 of file calib_barrel_sigma.cxx.

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

◆ ~calib_barrel_sigma()

calib_barrel_sigma::~calib_barrel_sigma ( )

Definition at line 85 of file calib_barrel_sigma.cxx.

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

Member Function Documentation

◆ calculate()

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

Implements TofCalibFit.

Definition at line 92 of file calib_barrel_sigma.cxx.

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

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