12 X = HepVector(
Npar,0);
13 m_name = string(
"calibration");
28 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) <<
data->size() << setw(30) <<
name() << std::endl;
30 if(
data->size() <= 0 ) {
31 for(
int i=0; i<
X.num_row(); i++ ) {
36 std::vector<Record*>::iterator
iter =
data->begin();
49 std::ofstream out(file,ios::out);
51 std::vector<HepVector>::iterator it;
54 for(
unsigned int i=0; i<
Npar2; i++ ) {
55 out << (*it)[i] <<
" ";
62 cerr <<
"error when open file " << file <<
" for write in " <<
name() <<
"::fillTxt()" << std::endl;
63 cout <<
"print all parameters to srceen: in total " <<
m_result.size() <<
" items" << std::endl;
64 std::vector<HepVector>::iterator it;
67 for(
unsigned int i=0; i<
Npar2; i++ ) {
68 cout << (*it)[i] <<
" ";
80 unsigned int ncounter = 1;
90 std::cout<<
" tofcalgsec::TofCalibration: the number of histograms is NOT integral number of times of counter number!"<<std::endl;
93 unsigned int ngraph =
graphs.size();
95 std::cout<<
" tofcalgsec::TofCalibration: the number of histograms is NOT integral number of times of counter number!"<<std::endl;
99 TFile f(file,
"RECREATE");
101 gStyle->SetOptFit(1111);
102 gStyle->SetOptStat(1111);
103 gStyle->SetLabelSize(0.03,
"x");
104 gStyle->SetLabelSize(0.03,
"y");
109 for(
unsigned int i=0; i<ncounter; i++ ) {
110 sprintf( dirname,
"tofid%i", i );
111 TDirectory* cdresult = f.mkdir( dirname );
115 (*(
iter+i))->Write();
121 sprintf( dirname,
"tofid" );
122 TDirectory* cdresult = f.mkdir( dirname );
std::vector< Record * > RecordSet
const unsigned int NBarrel
const unsigned int NEndcap
TofCalibration(const int npar)
virtual void calculate_record(const Record *r, unsigned int icounter)=0
virtual const string & name() const
std::vector< TGraph * > graphs
unsigned int nHistPerCounter
virtual void calculate(RecordSet *&data, unsigned int icounter)
std::vector< HepVector > m_result
unsigned int nGraphPerCounter
void fillRoot(const char *file, bool isbarrel)
std::vector< TH1F * > histograms
virtual void calculate_result(unsigned int icounter)=0
void fillTxt(const char *file)