BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_endcap_sigma Class Reference

#include <calib_endcap_sigma.h>

+ Inheritance diagram for calib_endcap_sigma:

Public Member Functions

 calib_endcap_sigma (const unsigned int nrbin)
 
 ~calib_endcap_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< 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_endcap_sigma.h.

Constructor & Destructor Documentation

◆ calib_endcap_sigma()

calib_endcap_sigma::calib_endcap_sigma ( const unsigned int  nrbin)

Definition at line 4 of file calib_endcap_sigma.cxx.

4 :TofCalibFit( false, nEndcapSigma ) {
5
6 nKind = 1; // 0:tleft
7 nBinPerCounter = nrbin;
8
11 CanvasPerCounterName.push_back( static_cast<string>("Endcap-offset") );
12 CanvasPerCounterName.push_back( static_cast<string>("Endcap-sigma") );
13
14 nGraphPerCanvasPerCounter.push_back(1);
15 nGraphPerCanvasPerCounter.push_back(1);
16
17 nHistogram = 0;
18 nCanvas = 0;
19
20 int numGraphs = 0;
21 std::vector<unsigned int>::iterator iter = nGraphPerCanvasPerCounter.begin();
22 for( ; iter!=nGraphPerCanvasPerCounter.end(); iter++ ) {
23 numGraphs = numGraphs + (*iter);
24 }
25 if( numGraphs != nGraphEcSigma ) {
26 cout << "tofcalgsec::calib_endcap_sigma: the number of Graphs is NOT reasonable!!!" << endl;
27 exit(0);
28 }
29
30 m_name = string("calib_endcap_sigma");
31
32 const int tbin = 150;
33 const double tbegin = -1.5;
34 const double tend = 1.5;
35
36 // histograms per counter
37 char hname[256];
38 for( unsigned int i=0; i<NEndcap; i++ ) {
39 m_result.push_back( HepVector(nEndcapSigma,0) );
40 for( unsigned int j=0; j<nKind; j++ ) {
41 for( unsigned int k=0; k<nBinPerCounter; k++ ) {
42 sprintf( hname, "tleft-tofid%i-r%i", i, k);
43 m_histograms.push_back( new TH1F( hname, hname, tbin, tbegin, tend ) );
44
45 m_fitresult.push_back( HepVector(nParEcSigma,0) );
46 }
47 }
48 }
49
50 rpos.resize( nBinPerCounter );
51 rposerr.resize( nBinPerCounter );
52 rstep = ( rend - rbegin )/nBinPerCounter;
53 for( unsigned int i=0; i<nBinPerCounter; i++ ) {
54 rpos[i] = rbegin + ( i+0.5 )*rstep;
55 rposerr[i] = 0.5*rstep;
56 }
57
58}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
const double rend
Definition: TofCalibFit.h:19
const double rbegin
Definition: TofCalibFit.h:18
const unsigned int NEndcap
Definition: TofDataSet.h:13
const int nGraphEcSigma
const int nParEcSigma
const int nEndcapSigma
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
std::vector< string > CanvasPerCounterName
Definition: TofCalibFit.h:60

◆ ~calib_endcap_sigma()

calib_endcap_sigma::~calib_endcap_sigma ( )

Definition at line 61 of file calib_endcap_sigma.cxx.

61 {
62 m_fitresult.clear();
63 rpos.clear();
64 rposerr.clear();
65}

Member Function Documentation

◆ calculate()

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

Implements TofCalibFit.

Definition at line 68 of file calib_endcap_sigma.cxx.

68 {
69
70 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
71
72 if( data->size() > 0 ) {
73 std::vector<Record*>::iterator iter = data->begin();
74 for( ; iter!=data->end(); iter++ ) {
75 fillRecord( (*iter), icounter );
76 }
77 }
78 fitHistogram( icounter );
79 fillGraph( icounter );
80 fitGraph( icounter );
81
82 return;
83}
TTree * data
const string & name() const
Definition: TofCalibFit.h:29

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