CGEM BOSS 6.6.5.g
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
52
53 return;
54}
TTree * data
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:212
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()

◆ calculate_y()

◆ 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( unsigned 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( unsigned int i=0; i<(*it).num_row(); i++ ) {
75 cout << (*it)[i] << " ";
76 }
77 cout << std::endl;
78 }
79 }
80
81 return;
82}

◆ 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()

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(), 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(), and calib_endcap_left::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(), 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(), and calib_endcap_left::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(), and calib_endcap_veff::calculate_y().


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