Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

calib_endcap_veff Class Reference

#include <calib_endcap_veff.h>

Inheritance diagram for calib_endcap_veff:

TofCalib TofCalib List of all members.

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_endcap_veff ()
 calib_endcap_veff ()
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

Constructor & Destructor Documentation

calib_endcap_veff::calib_endcap_veff  )  [inline]
 

00010                      :TofCalib( nEndcapVeff ) {
00011     m_name = string("calib_endcap_veff");
00012   }

calib_endcap_veff::calib_endcap_veff  )  [inline]
 

00010                      :TofCalib( nEndcapVeff ) {
00011     m_name = string("calib_endcap_veff");
00012   }


Member Function Documentation

virtual void TofCalib::calculate RecordSet *&  data,
unsigned int  icounter
[virtual, inherited]
 

void TofCalib::calculate RecordSet *&  data,
unsigned int  icounter
[virtual, inherited]
 

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 }

void calib_endcap_veff::calculate_funcs const Record r  )  [inline, virtual]
 

Implements TofCalib.

00014                                           {
00015     double z = r->zrhit();
00016 
00017     funcs[0] = 1.0;
00018     funcs[1] = z-44.5;
00019     funcs[2] = (z-44.5)*(z-44.5);
00020     funcs[3] = (z-44.5)*(z-44.5)*(z-44.5);
00021 
00022     return;
00023   }

void calib_endcap_veff::calculate_funcs const Record r  )  [inline, virtual]
 

Implements TofCalib.

00014                                           {
00015     double z = r->zrhit();
00016 
00017     funcs[0] = 1.0;
00018     funcs[1] = z-44.5;
00019     funcs[2] = (z-44.5)*(z-44.5);
00020     funcs[3] = (z-44.5)*(z-44.5)*(z-44.5);
00021 
00022     return;
00023   }

void calib_endcap_veff::calculate_y const Record r  )  [inline, virtual]
 

Implements TofCalib.

00025                                     {
00026     y = r->tleft() - r->texp();
00027     return;
00028   }

void calib_endcap_veff::calculate_y const Record r  )  [inline, virtual]
 

Implements TofCalib.

00025                                     {
00026     y = r->tleft() - r->texp();
00027     return;
00028   }

void TofCalib::fillTxt const char *  file  )  [inherited]
 

void TofCalib::fillTxt const char *  file  )  [inherited]
 

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 }

virtual const string& TofCalib::name void   )  const [inline, virtual, inherited]
 

00027 { return m_name;}

virtual const string& TofCalib::name  )  const [inline, virtual, inherited]
 

00027 { return m_name;}

void TofCalib::reset  )  [inherited]
 

void TofCalib::reset  )  [inherited]
 

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 }

void calib_endcap_veff::updateData RecordSet *&  data  )  [inline, virtual]
 

Implements TofCalib.

00030                                       {
00031     return;
00032   }

void calib_endcap_veff::updateData RecordSet *&  data  )  [inline, virtual]
 

Implements TofCalib.

00030                                       {
00031     return;
00032   }


Member Data Documentation

HepMatrix TofCalib::F [protected, inherited]
 

HepVector TofCalib::funcs [protected, inherited]
 

string TofCalib::m_name [protected, inherited]
 

std::vector<HepVector> TofCalib::m_result [protected, inherited]
 

std::vector<HepVector> TofCalib::m_result [protected, inherited]
 

int TofCalib::Npar [protected, inherited]
 

HepVector TofCalib::X [protected, inherited]
 

double TofCalib::y [protected, inherited]
 

HepVector TofCalib::Y [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:55:43 2011 for BOSS6.5.5 by  doxygen 1.3.9.1