BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
TofCalib Class Referenceabstract

#include <TofCalib.h>

+ Inheritance diagram for TofCalib:

Public Member Functions

 TofCalib (const int npar)
 
 ~TofCalib ()
 
void reset ()
 
virtual void calculate (RecordSet *&data, unsigned int icounter)
 
virtual void updateData (RecordSet *&data)=0
 
virtual const string & name () const
 
void fillTxt (const char *file)
 

Protected Member Functions

virtual void calculate_funcs (const Record *r)=0
 
virtual void calculate_y (const Record *r)=0
 

Protected Attributes

string m_name
 
int Npar
 
HepMatrix F
 
HepVector X
 
HepVector Y
 
HepVector funcs
 
double y
 
std::vector< HepVector > m_result
 

Detailed Description

Definition at line 11 of file TofCalib.h.

Constructor & Destructor Documentation

◆ TofCalib()

TofCalib::TofCalib ( const int  npar)
inline

Definition at line 13 of file TofCalib.h.

13 :Npar(npar) {
14 F = HepMatrix(Npar,Npar,0);
15 Y = HepVector(Npar,0);
16 X = HepVector(Npar,0);
17 funcs = HepVector(Npar,0);
18 m_name=string("calculation");
19 }
HepVector funcs
Definition: TofCalib.h:41
string m_name
Definition: TofCalib.h:36
int Npar
Definition: TofCalib.h:37
HepMatrix F
Definition: TofCalib.h:38
HepVector Y
Definition: TofCalib.h:40
HepVector X
Definition: TofCalib.h:39

◆ ~TofCalib()

TofCalib::~TofCalib ( )
inline

Definition at line 20 of file TofCalib.h.

20{}

Member Function Documentation

◆ calculate()

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

Definition at line 17 of file TofCalib.cxx.

17 {
18
19 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) << name() << std::endl;
20
21 if( data->size() <= 0 ) {
22 X = HepVector(Npar,1.0);
23 }
24 else {
25 std::vector<Record*>::iterator iter = data->begin();
26 for( ; iter!=data->end(); iter++ ) {
28 for( int i=0; i<F.num_col(); i++ ) {
29 for( int j=0; j<F.num_col(); j++ ) {
30 F[i][j]+=funcs[i]*funcs[j];
31 }
32 }
33
34 calculate_y( (*iter) );
35 for( int k=0; k<Y.num_row(); k++ ) {
36 Y[k]+=y*funcs[k];
37 }
38 }
39
40 // if( abs(F.determinant())>0. ) {
41 if( abs(F[0][0])>0. ) {
42 X = (qr_solve(F,Y));
43 }
44 else {
45 X = HepVector(Npar,1.0); // one side has no data
46 }
47 }
48
49 m_result.push_back(X);
50
51 updateData( data );
52
53 return;
54}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< HepVector > m_result
Definition: TofCalib.h:44
virtual void calculate_y(const Record *r)=0
virtual const string & name() const
Definition: TofCalib.h:27
virtual void updateData(RecordSet *&data)=0
virtual void calculate_funcs(const Record *r)=0
double y
Definition: TofCalib.h:42

◆ calculate_funcs()

virtual void TofCalib::calculate_funcs ( const Record r)
protectedpure virtual

◆ calculate_y()

virtual void TofCalib::calculate_y ( const Record r)
protectedpure virtual

◆ fillTxt()

void TofCalib::fillTxt ( const char *  file)

Definition at line 57 of file TofCalib.cxx.

57 {
58 std::ofstream out(file,ios::out);
59 if( out ) {
60 std::vector<HepVector>::iterator it;
61 for( it=m_result.begin(); it!=m_result.end(); it++ ) {
62 for( int i=0; i<(*it).num_row(); i++ ) {
63 out << (*it)[i] << " ";
64 }
65 out << std::endl;
66 }
67 out.close();
68 }
69 else{
70 cerr << "error when open file " << file << " for write in " << name() << "::fillTxt()" << std::endl;
71 cout << "print all parameters to srceen: in total " << m_result.size() << " items" << std::endl;
72 std::vector<HepVector>::iterator it;
73 for( it=m_result.begin(); it!=m_result.end(); it++ ) {
74 for( int i=0; i<(*it).num_row(); i++ ) {
75 cout << (*it)[i] << " ";
76 }
77 cout << std::endl;
78 }
79 }
80
81 return;
82}
char * file
Definition: DQA_TO_DB.cxx:15

◆ name()

virtual const string & TofCalib::name ( ) const
inlinevirtual

Definition at line 27 of file TofCalib.h.

27{ return m_name;}

Referenced by calculate(), and fillTxt().

◆ reset()

void TofCalib::reset ( )

Definition at line 8 of file TofCalib.cxx.

8 {
9 F = HepMatrix(Npar,Npar,0);
10 Y = HepVector(Npar,0);
11 X = HepVector(Npar,0);
12 funcs = HepVector(Npar,0);
13 return;
14}

◆ updateData()

virtual void TofCalib::updateData ( RecordSet *&  data)
pure virtual

Member Data Documentation

◆ F

HepMatrix TofCalib::F
protected

Definition at line 38 of file TofCalib.h.

Referenced by calculate(), reset(), and TofCalib().

◆ funcs

HepVector TofCalib::funcs
protected

Definition at line 41 of file TofCalib.h.

Referenced by calculate(), calib_barrel_atten::calculate_funcs(), calib_barrel_left::calculate_funcs(), calib_barrel_left_offset1_bunch0_3::calculate_funcs(), calib_barrel_left_offset1_bunch0_4::calculate_funcs(), calib_barrel_left_offset1_bunch1_3::calculate_funcs(), calib_barrel_left_offset1_bunch1_4::calculate_funcs(), calib_barrel_left_offset1_bunch2_3::calculate_funcs(), calib_barrel_left_offset1_bunch2_4::calculate_funcs(), calib_barrel_left_offset1_bunch3_4::calculate_funcs(), calib_barrel_left_offset2_bunch0_3::calculate_funcs(), calib_barrel_left_offset2_bunch0_4::calculate_funcs(), calib_barrel_left_offset2_bunch1_3::calculate_funcs(), calib_barrel_left_offset2_bunch1_4::calculate_funcs(), calib_barrel_left_offset2_bunch2_3::calculate_funcs(), calib_barrel_left_offset2_bunch2_4::calculate_funcs(), calib_barrel_left_offset2_bunch3_4::calculate_funcs(), calib_barrel_right::calculate_funcs(), calib_barrel_right_offset1_bunch0_3::calculate_funcs(), calib_barrel_right_offset1_bunch0_4::calculate_funcs(), calib_barrel_right_offset1_bunch1_3::calculate_funcs(), calib_barrel_right_offset1_bunch1_4::calculate_funcs(), calib_barrel_right_offset1_bunch2_3::calculate_funcs(), calib_barrel_right_offset1_bunch2_4::calculate_funcs(), calib_barrel_right_offset1_bunch3_4::calculate_funcs(), calib_barrel_right_offset2_bunch0_3::calculate_funcs(), calib_barrel_right_offset2_bunch0_4::calculate_funcs(), calib_barrel_right_offset2_bunch1_3::calculate_funcs(), calib_barrel_right_offset2_bunch1_4::calculate_funcs(), calib_barrel_right_offset2_bunch2_3::calculate_funcs(), calib_barrel_right_offset2_bunch2_4::calculate_funcs(), calib_barrel_right_offset2_bunch3_4::calculate_funcs(), calib_barrel_veff::calculate_funcs(), calib_endcap_left::calculate_funcs(), calib_endcap_veff::calculate_funcs(), calib_etf_combine::calculate_funcs(), calib_etf_left::calculate_funcs(), calib_etf_right::calculate_funcs(), calib_etf_veff::calculate_funcs(), calib_etf_weight::calculate_funcs(), calib_mc_etf_combine::calculate_funcs(), calib_mc_etf_left::calculate_funcs(), calib_mc_etf_right::calculate_funcs(), reset(), TofCalib(), calib_barrel_left::updateData(), calib_barrel_left_offset1_bunch0_3::updateData(), calib_barrel_left_offset1_bunch0_4::updateData(), calib_barrel_left_offset1_bunch1_3::updateData(), calib_barrel_left_offset1_bunch1_4::updateData(), calib_barrel_left_offset1_bunch2_3::updateData(), calib_barrel_left_offset1_bunch2_4::updateData(), calib_barrel_left_offset1_bunch3_4::updateData(), calib_barrel_left_offset2_bunch0_3::updateData(), calib_barrel_left_offset2_bunch0_4::updateData(), calib_barrel_left_offset2_bunch1_3::updateData(), calib_barrel_left_offset2_bunch1_4::updateData(), calib_barrel_left_offset2_bunch2_3::updateData(), calib_barrel_left_offset2_bunch2_4::updateData(), calib_barrel_left_offset2_bunch3_4::updateData(), calib_barrel_right::updateData(), calib_barrel_right_offset1_bunch0_3::updateData(), calib_barrel_right_offset1_bunch0_4::updateData(), calib_barrel_right_offset1_bunch1_3::updateData(), calib_barrel_right_offset1_bunch1_4::updateData(), calib_barrel_right_offset1_bunch2_3::updateData(), calib_barrel_right_offset1_bunch2_4::updateData(), calib_barrel_right_offset1_bunch3_4::updateData(), calib_barrel_right_offset2_bunch0_3::updateData(), calib_barrel_right_offset2_bunch0_4::updateData(), calib_barrel_right_offset2_bunch1_3::updateData(), calib_barrel_right_offset2_bunch1_4::updateData(), calib_barrel_right_offset2_bunch2_3::updateData(), calib_barrel_right_offset2_bunch2_4::updateData(), calib_barrel_right_offset2_bunch3_4::updateData(), calib_endcap_left::updateData(), calib_etf_combine::updateData(), calib_etf_left::updateData(), calib_etf_right::updateData(), calib_etf_weight::updateData(), calib_mc_etf_combine::updateData(), calib_mc_etf_left::updateData(), and calib_mc_etf_right::updateData().

◆ m_name

string TofCalib::m_name
protected

Definition at line 36 of file TofCalib.h.

Referenced by calib_barrel_atten::calib_barrel_atten(), calib_barrel_left::calib_barrel_left(), calib_barrel_left_offset1_bunch0_3::calib_barrel_left_offset1_bunch0_3(), calib_barrel_left_offset1_bunch0_4::calib_barrel_left_offset1_bunch0_4(), calib_barrel_left_offset1_bunch1_3::calib_barrel_left_offset1_bunch1_3(), calib_barrel_left_offset1_bunch1_4::calib_barrel_left_offset1_bunch1_4(), calib_barrel_left_offset1_bunch2_3::calib_barrel_left_offset1_bunch2_3(), calib_barrel_left_offset1_bunch2_4::calib_barrel_left_offset1_bunch2_4(), calib_barrel_left_offset1_bunch3_3::calib_barrel_left_offset1_bunch3_3(), calib_barrel_left_offset1_bunch3_4::calib_barrel_left_offset1_bunch3_4(), calib_barrel_left_offset2_bunch0_3::calib_barrel_left_offset2_bunch0_3(), calib_barrel_left_offset2_bunch0_4::calib_barrel_left_offset2_bunch0_4(), calib_barrel_left_offset2_bunch1_3::calib_barrel_left_offset2_bunch1_3(), calib_barrel_left_offset2_bunch1_4::calib_barrel_left_offset2_bunch1_4(), calib_barrel_left_offset2_bunch2_3::calib_barrel_left_offset2_bunch2_3(), calib_barrel_left_offset2_bunch2_4::calib_barrel_left_offset2_bunch2_4(), calib_barrel_left_offset2_bunch3_3::calib_barrel_left_offset2_bunch3_3(), calib_barrel_left_offset2_bunch3_4::calib_barrel_left_offset2_bunch3_4(), calib_barrel_right::calib_barrel_right(), calib_barrel_right_offset1_bunch0_3::calib_barrel_right_offset1_bunch0_3(), calib_barrel_right_offset1_bunch0_4::calib_barrel_right_offset1_bunch0_4(), calib_barrel_right_offset1_bunch1_3::calib_barrel_right_offset1_bunch1_3(), calib_barrel_right_offset1_bunch1_4::calib_barrel_right_offset1_bunch1_4(), calib_barrel_right_offset1_bunch2_3::calib_barrel_right_offset1_bunch2_3(), calib_barrel_right_offset1_bunch2_4::calib_barrel_right_offset1_bunch2_4(), calib_barrel_right_offset1_bunch3_3::calib_barrel_right_offset1_bunch3_3(), calib_barrel_right_offset1_bunch3_4::calib_barrel_right_offset1_bunch3_4(), calib_barrel_right_offset2_bunch0_3::calib_barrel_right_offset2_bunch0_3(), calib_barrel_right_offset2_bunch0_4::calib_barrel_right_offset2_bunch0_4(), calib_barrel_right_offset2_bunch1_3::calib_barrel_right_offset2_bunch1_3(), calib_barrel_right_offset2_bunch1_4::calib_barrel_right_offset2_bunch1_4(), calib_barrel_right_offset2_bunch2_3::calib_barrel_right_offset2_bunch2_3(), calib_barrel_right_offset2_bunch2_4::calib_barrel_right_offset2_bunch2_4(), calib_barrel_right_offset2_bunch3_3::calib_barrel_right_offset2_bunch3_3(), calib_barrel_right_offset2_bunch3_4::calib_barrel_right_offset2_bunch3_4(), calib_barrel_veff::calib_barrel_veff(), calib_endcap_left::calib_endcap_left(), calib_endcap_veff::calib_endcap_veff(), calib_etf_combine::calib_etf_combine(), calib_etf_left::calib_etf_left(), calib_etf_right::calib_etf_right(), calib_etf_veff::calib_etf_veff(), calib_etf_weight::calib_etf_weight(), calib_mc_etf_combine::calib_mc_etf_combine(), calib_mc_etf_left::calib_mc_etf_left(), calib_mc_etf_right::calib_mc_etf_right(), name(), and TofCalib().

◆ m_result

std::vector<HepVector> TofCalib::m_result
protected

Definition at line 44 of file TofCalib.h.

Referenced by calculate(), and fillTxt().

◆ Npar

int TofCalib::Npar
protected

Definition at line 37 of file TofCalib.h.

Referenced by calculate(), reset(), and TofCalib().

◆ X

HepVector TofCalib::X
protected

Definition at line 39 of file TofCalib.h.

Referenced by calculate(), reset(), TofCalib(), calib_barrel_atten::updateData(), calib_barrel_left::updateData(), calib_barrel_left_offset1_bunch0_3::updateData(), calib_barrel_left_offset1_bunch0_4::updateData(), calib_barrel_left_offset1_bunch1_3::updateData(), calib_barrel_left_offset1_bunch1_4::updateData(), calib_barrel_left_offset1_bunch2_3::updateData(), calib_barrel_left_offset1_bunch2_4::updateData(), calib_barrel_left_offset1_bunch3_4::updateData(), calib_barrel_left_offset2_bunch0_3::updateData(), calib_barrel_left_offset2_bunch0_4::updateData(), calib_barrel_left_offset2_bunch1_3::updateData(), calib_barrel_left_offset2_bunch1_4::updateData(), calib_barrel_left_offset2_bunch2_3::updateData(), calib_barrel_left_offset2_bunch2_4::updateData(), calib_barrel_left_offset2_bunch3_4::updateData(), calib_barrel_right::updateData(), calib_barrel_right_offset1_bunch0_3::updateData(), calib_barrel_right_offset1_bunch0_4::updateData(), calib_barrel_right_offset1_bunch1_3::updateData(), calib_barrel_right_offset1_bunch1_4::updateData(), calib_barrel_right_offset1_bunch2_3::updateData(), calib_barrel_right_offset1_bunch2_4::updateData(), calib_barrel_right_offset1_bunch3_4::updateData(), calib_barrel_right_offset2_bunch0_3::updateData(), calib_barrel_right_offset2_bunch0_4::updateData(), calib_barrel_right_offset2_bunch1_3::updateData(), calib_barrel_right_offset2_bunch1_4::updateData(), calib_barrel_right_offset2_bunch2_3::updateData(), calib_barrel_right_offset2_bunch2_4::updateData(), calib_barrel_right_offset2_bunch3_4::updateData(), calib_endcap_left::updateData(), calib_etf_combine::updateData(), calib_etf_left::updateData(), calib_etf_right::updateData(), calib_etf_weight::updateData(), calib_mc_etf_combine::updateData(), calib_mc_etf_left::updateData(), and calib_mc_etf_right::updateData().

◆ Y

HepVector TofCalib::Y
protected

Definition at line 40 of file TofCalib.h.

Referenced by calculate(), reset(), and TofCalib().

◆ y

double TofCalib::y
protected

Definition at line 42 of file TofCalib.h.

Referenced by calculate(), calib_barrel_atten::calculate_y(), calib_barrel_left::calculate_y(), calib_barrel_left_offset1_bunch0_3::calculate_y(), calib_barrel_left_offset1_bunch0_4::calculate_y(), calib_barrel_left_offset1_bunch1_3::calculate_y(), calib_barrel_left_offset1_bunch1_4::calculate_y(), calib_barrel_left_offset1_bunch2_3::calculate_y(), calib_barrel_left_offset1_bunch2_4::calculate_y(), calib_barrel_left_offset1_bunch3_4::calculate_y(), calib_barrel_left_offset2_bunch0_3::calculate_y(), calib_barrel_left_offset2_bunch0_4::calculate_y(), calib_barrel_left_offset2_bunch1_3::calculate_y(), calib_barrel_left_offset2_bunch1_4::calculate_y(), calib_barrel_left_offset2_bunch2_3::calculate_y(), calib_barrel_left_offset2_bunch2_4::calculate_y(), calib_barrel_left_offset2_bunch3_4::calculate_y(), calib_barrel_right::calculate_y(), calib_barrel_right_offset1_bunch0_3::calculate_y(), calib_barrel_right_offset1_bunch0_4::calculate_y(), calib_barrel_right_offset1_bunch1_3::calculate_y(), calib_barrel_right_offset1_bunch1_4::calculate_y(), calib_barrel_right_offset1_bunch2_3::calculate_y(), calib_barrel_right_offset1_bunch2_4::calculate_y(), calib_barrel_right_offset1_bunch3_4::calculate_y(), calib_barrel_right_offset2_bunch0_3::calculate_y(), calib_barrel_right_offset2_bunch0_4::calculate_y(), calib_barrel_right_offset2_bunch1_3::calculate_y(), calib_barrel_right_offset2_bunch1_4::calculate_y(), calib_barrel_right_offset2_bunch2_3::calculate_y(), calib_barrel_right_offset2_bunch2_4::calculate_y(), calib_barrel_right_offset2_bunch3_4::calculate_y(), calib_barrel_veff::calculate_y(), calib_endcap_left::calculate_y(), calib_endcap_veff::calculate_y(), calib_etf_combine::calculate_y(), calib_etf_left::calculate_y(), calib_etf_right::calculate_y(), calib_etf_veff::calculate_y(), calib_etf_weight::calculate_y(), calib_mc_etf_combine::calculate_y(), calib_mc_etf_left::calculate_y(), and calib_mc_etf_right::calculate_y().


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