#include <calib_barrel_right_offset1.h>
Inheritance diagram for calib_barrel_right_offset1:
Public Member Functions | |
virtual void | calculate (RecordSet *&data, unsigned int icounter) |
virtual void | calculate (RecordSet *&data, unsigned int icounter) |
void | calculate_funcs (const Record *r) |
void | calculate_funcs (const Record *r) |
void | calculate_y (const Record *r) |
void | calculate_y (const Record *r) |
calib_barrel_right_offset1 () | |
calib_barrel_right_offset1 () | |
void | fillTxt (const char *file) |
void | fillTxt (const char *file) |
virtual const string & | name () const |
virtual const string & | name () const |
void | reset () |
void | reset () |
void | updateData (RecordSet *&data) |
void | updateData (RecordSet *&data) |
Protected Attributes | |
HepMatrix | F |
HepVector | funcs |
string | m_name |
std::vector< HepVector > | m_result |
std::vector< HepVector > | m_result |
int | Npar |
HepVector | X |
double | y |
HepVector | Y |
|
00010 :TofCalib( nBarrelRight_Offset1 ) { 00011 m_name = string("calib_barrel_right_offset1"); 00012 }
|
|
00010 :TofCalib( nBarrelRight_Offset1 ) { 00011 m_name = string("calib_barrel_right_offset1"); 00012 }
|
|
|
|
00017 { 00018 00019 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl; 00020 00021 if( data->size() <= 0 ) { 00022 X = HepVector(Npar,1.0); 00023 } 00024 else { 00025 std::vector<Record*>::iterator iter = data->begin(); 00026 for( ; iter!=data->end(); iter++ ) { 00027 calculate_funcs( (*iter) ); 00028 for( int i=0; i<F.num_col(); i++ ) { 00029 for( int j=0; j<F.num_col(); j++ ) { 00030 F[i][j]+=funcs[i]*funcs[j]; 00031 } 00032 } 00033 00034 calculate_y( (*iter) ); 00035 for( int k=0; k<Y.num_row(); k++ ) { 00036 Y[k]+=y*funcs[k]; 00037 } 00038 } 00039 00040 // if( abs(F.determinant())>0. ) { 00041 if( abs(F[0][0])>0. ) { 00042 X = (qr_solve(F,Y)); 00043 } 00044 else { 00045 X = HepVector(Npar,1.0); // one side has no data 00046 } 00047 } 00048 00049 m_result.push_back(X); 00050 00051 updateData( data ); 00052 00053 return; 00054 }
|
|
Implements TofCalib. 00014 { 00015 double z = r->zrhit(); 00016 double t = r->tright(); 00017 00018 if( z>-5.0 && abs(t)<10.0 ) { 00019 funcs[0] = 1.0; 00020 funcs[1] = z; 00021 funcs[2] = z*z; 00022 funcs[3] = z*z*z; 00023 funcs[4] = z*z*z*z; 00024 funcs[5] = z*z*z*z*z; 00025 funcs[6] = z*z*z*z*z*z; 00026 } 00027 else { 00028 funcs[0] = 0.0; 00029 funcs[1] = 0.0; 00030 funcs[2] = 0.0; 00031 funcs[3] = 0.0; 00032 funcs[4] = 0.0; 00033 funcs[5] = 0.0; 00034 funcs[6] = 0.0; 00035 } 00036 00037 return; 00038 }
|
|
Implements TofCalib. 00014 { 00015 double z = r->zrhit(); 00016 double t = r->tright(); 00017 00018 if( z>-5.0 && abs(t)<10.0 ) { 00019 funcs[0] = 1.0; 00020 funcs[1] = z; 00021 funcs[2] = z*z; 00022 funcs[3] = z*z*z; 00023 funcs[4] = z*z*z*z; 00024 funcs[5] = z*z*z*z*z; 00025 funcs[6] = z*z*z*z*z*z; 00026 } 00027 else { 00028 funcs[0] = 0.0; 00029 funcs[1] = 0.0; 00030 funcs[2] = 0.0; 00031 funcs[3] = 0.0; 00032 funcs[4] = 0.0; 00033 funcs[5] = 0.0; 00034 funcs[6] = 0.0; 00035 } 00036 00037 return; 00038 }
|
|
Implements TofCalib. 00040 { 00041 if( r->zrhit() > -5.0 ) { 00042 y = r->tright(); 00043 } 00044 else { 00045 y = 0.0; 00046 } 00047 return; 00048 }
|
|
Implements TofCalib. 00040 { 00041 if( r->zrhit() > -5.0 ) { 00042 y = r->tright(); 00043 } 00044 else { 00045 y = 0.0; 00046 } 00047 return; 00048 }
|
|
|
|
00057 { 00058 std::ofstream out(file,ios::out); 00059 if( out ) { 00060 std::vector<HepVector>::iterator it; 00061 for( it=m_result.begin(); it!=m_result.end(); it++ ) { 00062 for( unsigned int i=0; i<(*it).num_row(); i++ ) { 00063 out << (*it)[i] << " "; 00064 } 00065 out << std::endl; 00066 } 00067 out.close(); 00068 } 00069 else{ 00070 cerr << "error when open file " << file << " for write in " << name() << "::fillTxt()" << std::endl; 00071 cout << "print all parameters to srceen: in total " << m_result.size() << " items" << std::endl; 00072 std::vector<HepVector>::iterator it; 00073 for( it=m_result.begin(); it!=m_result.end(); it++ ) { 00074 for( unsigned int i=0; i<(*it).num_row(); i++ ) { 00075 cout << (*it)[i] << " "; 00076 } 00077 cout << std::endl; 00078 } 00079 } 00080 00081 return; 00082 }
|
|
00027 { return m_name;}
|
|
00027 { return m_name;}
|
|
|
|
00008 { 00009 F = HepMatrix(Npar,Npar,0); 00010 Y = HepVector(Npar,0); 00011 X = HepVector(Npar,0); 00012 funcs = HepVector(Npar,0); 00013 return; 00014 }
|
|
Implements TofCalib. 00050 { 00051 if( data->size() > 0 ) { 00052 std::vector<Record*>::iterator iter = data->begin(); 00053 for( ; iter!=data->end(); iter++ ) { 00054 if( (*iter)->zrhit() < 0.0 ) continue; 00055 calculate_funcs( (*iter) ); 00056 double tcorr = 0.0; 00057 for( int i=0; i<X.num_row(); i++ ) { 00058 tcorr += X[i]*funcs[i]; 00059 } 00060 (*iter)->settright( (*iter)->tright() - tcorr ); 00061 } 00062 } 00063 return; 00064 }
|
|
Implements TofCalib. 00050 { 00051 if( data->size() > 0 ) { 00052 std::vector<Record*>::iterator iter = data->begin(); 00053 for( ; iter!=data->end(); iter++ ) { 00054 if( (*iter)->zrhit() < 0.0 ) continue; 00055 calculate_funcs( (*iter) ); 00056 double tcorr = 0.0; 00057 for( int i=0; i<X.num_row(); i++ ) { 00058 tcorr += X[i]*funcs[i]; 00059 } 00060 (*iter)->settright( (*iter)->tright() - tcorr ); 00061 } 00062 } 00063 return; 00064 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|