CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_barrel_common Class Reference

#include <calib_barrel_common.h>

+ Inheritance diagram for calib_barrel_common:

Public Member Functions

 calib_barrel_common (const unsigned int nzbin)
 
 ~calib_barrel_common ()
 
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< 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_common.h.

Constructor & Destructor Documentation

◆ calib_barrel_common()

calib_barrel_common::calib_barrel_common ( const unsigned int  nzbin)

Definition at line 4 of file calib_barrel_common.cxx.

4 :TofCalibFit( true, nBarrelCommon ) {
5
6 nKind = 4;
7 nBinPerCounter = nzbin;
8
12 nCanvas = 4;
13 CanvasName.push_back( static_cast<string>("Offset") );
14 CanvasName.push_back( static_cast<string>("Offset-PlusMinus") );
15 CanvasName.push_back( static_cast<string>("Sigma") );
16 CanvasName.push_back( static_cast<string>("Sigma-TCorrelation") );
17 nGraphPerCanvas.push_back(2);
18 nGraphPerCanvas.push_back(2);
19 nGraphPerCanvas.push_back(2);
20 nGraphPerCanvas.push_back(3);
21
22 int numGraphs = 0;
23 std::vector<unsigned int>::iterator iter = nGraphPerCanvas.begin();
24 for( ; iter!=nGraphPerCanvas.end(); iter++ ) {
25 numGraphs = numGraphs + (*iter);
26 }
27 if( numGraphs != nGraphTotalCommon ) {
28 cout << "tofcalgsec::calib_barrel_common: the number of Graphs is NOT reasonable!!!" << endl;
29 exit(0);
30 }
31
32 m_name = string("calib_barrel_common");
33
34 const int tbin = 150;
35 const double tbegin = -1.5;
36 const double tend = 1.5;
37
38 char hname[256];
39 // histograms
40 for( unsigned int j=0; j<nKind; j++ ) {
41 for( unsigned int k=0; k<nBinPerCounter; k++ ) {
42 if( j==0 ) { sprintf( hname, "tleft-z%i", k); }
43 else if( j==1 ) { sprintf( hname, "tright-z%i", k); }
44 else if( j==2 ) { sprintf( hname, "tplus-z%i", k); }
45 else if( j==3 ) { sprintf( hname, "tminus-z%i", k); }
46 m_fitresult.push_back( HepVector( nParCommon,0 ) );
47 m_histograms.push_back( new TH1F( hname, hname, tbin, tbegin, tend ) );
48 }
49 }
50 sprintf( hname, "deltaT" );
51 m_fitresult.push_back( HepVector( nParCommon,0 ) );
52 m_histograms.push_back( new TH1F( hname, hname, tbin, tbegin, tend ) );
53
54 zpos.resize( nBinPerCounter );
55 zposerr.resize( nBinPerCounter );
56 zstep = ( zend - zbegin )/nBinPerCounter;
57 for( unsigned int i=0; i<nBinPerCounter; i++ ) {
58 zpos[i] = zbegin + ( i+0.5 )*zstep;
59 zposerr[i] = 0.5*zstep;
60 }
61
62}
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 int nBarrelCommon
Definition: TofCalibFit.h:21
const int nParCommon
const int nGraphTotalCommon
string m_name
Definition: TofCalibFit.h:52
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
unsigned int nCanvasPerCounter
Definition: TofCalibFit.h:46
unsigned int nHistPerCounter
Definition: TofCalibFit.h:45
std::vector< unsigned int > nGraphPerCanvas
Definition: TofCalibFit.h:50
std::vector< string > CanvasName
Definition: TofCalibFit.h:61
unsigned int nHistogram
Definition: TofCalibFit.h:48

◆ ~calib_barrel_common()

calib_barrel_common::~calib_barrel_common ( )

Definition at line 65 of file calib_barrel_common.cxx.

65 {
66 m_fitresult.clear();
67 zpos.clear();
68 zposerr.clear();
69}

Member Function Documentation

◆ calculate()

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

Implements TofCalibFit.

Definition at line 72 of file calib_barrel_common.cxx.

72 {
73
74 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
75
76 if( data->size() > 0 ) {
77 std::vector<Record*>::iterator iter = data->begin();
78 for( ; iter!=data->end(); iter++ ) {
79 fillRecord( (*iter) );
80 }
81 }
82
83 if( icounter==(NBarrel-1) ) {
84 fitHistogram();
85 fillGraph();
86 fitGraph();
87 }
88
89 return;
90}
TTree * data
const unsigned int NBarrel
Definition: TofDataSet.h:12
const string & name() const
Definition: TofCalibFit.h:29

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