BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_endcap_atten Class Reference

#include <calib_endcap_atten.h>

+ Inheritance diagram for calib_endcap_atten:

Public Member Functions

 calib_endcap_atten (const unsigned int nrbin)
 
 ~calib_endcap_atten ()
 
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_atten.h.

Constructor & Destructor Documentation

◆ calib_endcap_atten()

calib_endcap_atten::calib_endcap_atten ( const unsigned int  nrbin)

Definition at line 13 of file calib_endcap_atten.cxx.

13 :TofCalibFit( false, nEndcapAtten ) {
14
15 nKind = 1; // pulse height
16 nBinPerCounter = nrbin + 1;
17
20 CanvasPerCounterName.push_back( static_cast<string>("Pulse Height Most Probable Value") );
21 CanvasPerCounterName.push_back( static_cast<string>("Pulse Height Sigma") );
22 nGraphPerCanvasPerCounter.push_back(1);
23 nGraphPerCanvasPerCounter.push_back(1);
24
25 nHistogram = 0;
26 nCanvas = 2;
27 CanvasName.push_back( static_cast<string>("Pulse Height Most Probable Value vs TOF Counter Number") );
28 CanvasName.push_back( static_cast<string>("Pulse Height Sigma vs TOF Counter Number") );
29 nGraphPerCanvas.push_back(1);
30 nGraphPerCanvas.push_back(1);
31
32 int numGraphs1 = 0;
33 std::vector<unsigned int>::iterator iter = nGraphPerCanvasPerCounter.begin();
34 for( ; iter!=nGraphPerCanvasPerCounter.end(); iter++ ) {
35 numGraphs1 = numGraphs1 + (*iter);
36 }
37 if( numGraphs1 != nGraphEcAtten ) {
38 cout << "tofcalgsec::calib_endcap_atten: the number of Graphs is NOT reasonable!!!" << endl;
39 exit(0);
40 }
41 int numGraphs2 = 0;
42 iter = nGraphPerCanvas.begin();
43 for( ; iter!=nGraphPerCanvas.end(); iter++ ) {
44 numGraphs2 = numGraphs2 + (*iter);
45 }
46 if( numGraphs2 != nGraphEcAtten ) {
47 cout << "tofcalgsec::calib_endcap_atten: the number of Graphs is NOT reasonable!!!" << endl;
48 exit(0);
49 }
50
51 m_name = string("calib_endcap_atten");
52
53 const int qbin = 100;
54 const double qbegin = 0.0;
55 const double qend = 5000.0;
56
57 // histograms per counter
58 char hname[256];
59 for( unsigned int i=0; i<NEndcap; i++ ) {
60 m_result.push_back( HepVector(nEndcapAtten,0) );
61 for( unsigned int k=0; k<nrbin; k++ ) {
62 sprintf( hname, "Q-id%i-r%i", i, k);
63 m_histograms.push_back( new TH1F( hname, hname, qbin, qbegin, qend ) );
64 m_fitresult.push_back( HepVector(nParEcAtten,0) );
65 }
66 sprintf( hname, "Q0-id%i", i );
67 m_histograms.push_back( new TH1F( hname, hname, qbin, qbegin, qend ) );
68 m_fitresult.push_back( HepVector(nParEcAtten,0) );
69 }
70
71 rpos.resize( nrbin );
72 rposerr.resize( nrbin );
73 rstep = ( rend - rbegin )/nrbin;
74 for( unsigned int i=0; i<nrbin; i++ ) {
75 rpos[i] = rbegin + ( i+0.5 )*rstep;
76 rposerr[i] = 0.5*rstep;
77 }
78 itofid.resize( NEndcap );
79 itofiderr.resize( NEndcap );
80 itofidstep = 1.0;
81 for( unsigned int i=0; i<NEndcap; i++ ) {
82 itofid[i] = i*1.0;
83 itofiderr[i] = 0.5;
84 }
85
86}
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 nEndcapAtten
const int nGraphEcAtten
const int nParEcAtten
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
std::vector< unsigned int > nGraphPerCanvas
Definition: TofCalibFit.h:50
std::vector< string > CanvasName
Definition: TofCalibFit.h:61
unsigned int nHistogram
Definition: TofCalibFit.h:48
std::vector< string > CanvasPerCounterName
Definition: TofCalibFit.h:60

◆ ~calib_endcap_atten()

calib_endcap_atten::~calib_endcap_atten ( )

Definition at line 89 of file calib_endcap_atten.cxx.

89 {
90 m_fitresult.clear();
91 rpos.clear();
92 rposerr.clear();
93 itofid.clear();
94 itofiderr.clear();
95}

Member Function Documentation

◆ calculate()

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

Implements TofCalibFit.

Definition at line 98 of file calib_endcap_atten.cxx.

98 {
99
100 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
101
102 if( data->size() > 0 ) {
103 std::vector<Record*>::iterator iter = data->begin();
104 for( ; iter!=data->end(); iter++ ) {
105 fillRecord( (*iter), icounter );
106 }
107 fitHistogram( icounter );
108 fillGraph( icounter );
109 fitGraph( icounter );
110 }
111 else {
112 fillGraph( icounter ); // keep the m_graphs is not empty()
113 }
114
115 if( data->size() > 0 ) {
116 std::vector<Record*>::iterator iter = data->begin();
117 for( ; iter!=data->end(); iter++ ) {
118 updateData( (*iter), icounter );
119 fillRecordQ0( (*iter), icounter );
120 }
121 fitHistogramQ0( icounter );
122 }
123
124 if( icounter==(NEndcap-1) ) {
125 fillGraphQ0();
126 }
127
128 return;
129}
TTree * data
const string & name() const
Definition: TofCalibFit.h:29

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