BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_etf_bunch Class Reference

#include <calib_etf_bunch.h>

+ Inheritance diagram for calib_etf_bunch:

Public Member Functions

 calib_etf_bunch (const unsigned int nbunch)
 
 ~calib_etf_bunch ()
 
void calculate (RecordSet *&data, unsigned int ibunch)
 
 calib_etf_bunch (const unsigned int nbunch)
 
 ~calib_etf_bunch ()
 
void calculate (RecordSet *&data, unsigned int ibunch)
 
- 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)
 
 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

Constructor & Destructor Documentation

◆ calib_etf_bunch() [1/2]

calib_etf_bunch::calib_etf_bunch ( const unsigned int  nbunch)

Definition at line 4 of file calib_etf_bunch.cxx.

4 :TofCalibFit( true, nParEtfBunch ) {
5
6 nKind = nbunch;
8
12 nCanvas = 8;
13 CanvasName.push_back( static_cast<string>("Offset-bunch0") );
14 CanvasName.push_back( static_cast<string>("Offset-bunch1") );
15 CanvasName.push_back( static_cast<string>("Offset-bunch2") );
16 CanvasName.push_back( static_cast<string>("Offset-bunch3") );
17 CanvasName.push_back( static_cast<string>("Sigma-bunch0") );
18 CanvasName.push_back( static_cast<string>("Sigma-bunch1") );
19 CanvasName.push_back( static_cast<string>("Sigma-bunch2") );
20 CanvasName.push_back( static_cast<string>("Sigma-bunch3") );
21
22 nGraphPerCanvas.push_back(1);
23 nGraphPerCanvas.push_back(1);
24 nGraphPerCanvas.push_back(1);
25 nGraphPerCanvas.push_back(1);
26 nGraphPerCanvas.push_back(1);
27 nGraphPerCanvas.push_back(1);
28 nGraphPerCanvas.push_back(1);
29 nGraphPerCanvas.push_back(1);
30
31 int numGraphs = 0;
32 std::vector<unsigned int>::iterator iter = nGraphPerCanvas.begin();
33 for( ; iter!=nGraphPerCanvas.end(); iter++ ) {
34 numGraphs = numGraphs + (*iter);
35 }
36 if( numGraphs != nGraphTotalBunch ) {
37 cout << "tofcalgsec::calib_barrel_common: the number of Graphs is NOT reasonable!!!" << endl;
38 exit(0);
39 }
40
41 m_name = string("calib_etf_bunch");
42
43 const int tbin = 160;
44 const double tbegin = -0.8;
45 const double tend = 0.8;
46
47 char hname[256];
48 // histograms
49 for( unsigned int j=0; j<nKind; j++ ) {
50 for( unsigned int k=0; k<nBinPerCounter; k++ ) {
51 if( k==0 ) { sprintf( hname, "tleft-bunch%i", j); }
52 else if( k==1 ) { sprintf( hname, "tright-bunch%i", j); }
53 else if( k==2 ) { sprintf( hname, "tcombine-bunch%i", j); }
54 m_fitresult.push_back( HepVector( nParEtfBunch,0 ) );
55 m_histograms.push_back( new TH1F( hname, hname, tbin, tbegin, tend ) );
56 }
57 }
58 m_fitresult.push_back( HepVector( nParEtfBunch,0 ) );
59
60 modpos.resize( nBinPerCounter );
61 modposerr.resize( nBinPerCounter );
62 for( unsigned int i=0; i<nBinPerCounter; i++ ) {
63 modpos[i] = 1.0*i;
64 modposerr[i] = 0.5;
65 }
66
67 return;
68}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

◆ ~calib_etf_bunch() [1/2]

calib_etf_bunch::~calib_etf_bunch ( )

Definition at line 71 of file calib_etf_bunch.cxx.

71 {
72 m_fitresult.clear();
73 modpos.clear();
74 modposerr.clear();
75}

◆ calib_etf_bunch() [2/2]

calib_etf_bunch::calib_etf_bunch ( const unsigned int  nbunch)

◆ ~calib_etf_bunch() [2/2]

calib_etf_bunch::~calib_etf_bunch ( )

Member Function Documentation

◆ calculate() [1/2]

void calib_etf_bunch::calculate ( RecordSet *&  data,
unsigned int  ibunch 
)
virtual

Implements TofCalibFit.

Definition at line 78 of file calib_etf_bunch.cxx.

78 {
79
80 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
81
82 if( data->size() > 0 ) {
83 std::vector<Record*>::iterator iter = data->begin();
84 for( ; iter!=data->end(); iter++ ) {
85 fillRecord( (*iter) );
86 }
87 }
88
89 if( icounter==(NEtf*NStrip-1) ) {
90 fitHistogram();
91 fillGraph();
92 fitGraph();
93 }
94
95 return;
96}
TTree * data

◆ calculate() [2/2]

void calib_etf_bunch::calculate ( RecordSet *&  data,
unsigned int  ibunch 
)
virtual

Implements TofCalibFit.


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