/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Tof/tofcalgsec/tofcalgsec-00-02-21/tofcalgsec/calib_etf_right.h

Go to the documentation of this file.
00001 #ifndef CALIB_ETF_RIGHT_H
00002 #define CALIB_ETF_RIGHT_H
00003 
00004 #include "tofcalgsec/TofCalib.h"
00005 
00006 const int nEtfRight = 13;
00007 
00008 class calib_etf_right:public TofCalib {
00009  public:
00010   calib_etf_right():TofCalib( nEtfRight ) {
00011     m_name = string("calib_etf_right");
00012   }
00013 
00014   void calculate_funcs( const Record* r ) {
00015     double q = r->qright();
00016     double z = r->zrhit();
00017 
00018     if( q<0.0 ) {
00019       for( int i=0; i<nEtfLeft; i++ ) {
00020         funcs[i] = 0.0;
00021       }
00022     }
00023     else {
00024       funcs[0] = 1.0;
00025       funcs[1] = 1./sqrt(q);
00026       funcs[2] = q;
00027       funcs[3] = q*q;
00028       funcs[4] = q*q*q;
00029       funcs[5] = q*q*q*q;
00030       funcs[6] = z/sqrt(q);
00031       funcs[7] = 1.0/q;
00032       funcs[8] = z/q;
00033       funcs[9] = z*q;
00034       funcs[10] = z;
00035       funcs[11] = z*z;
00036       funcs[12] = z*z*z;
00037     }
00038 
00039     return;
00040   }
00041 
00042   void calculate_y(const Record* r) {
00043     y = r->tright() - r->texp();
00044     return;
00045   }
00046 
00047   void updateData( RecordSet*& data ) {
00048     if( data->size() > 0 ) {
00049       std::vector<Record*>::iterator iter = data->begin();
00050       for( ; iter!=data->end(); iter++ ) {
00051         calculate_funcs( (*iter) );
00052         double tcorr = 0.0;
00053         for( int i=0; i<X.num_row(); i++ ) {
00054           tcorr += X[i]*funcs[i];
00055         }
00056         (*iter)->settright( (*iter)->tright() - tcorr - (*iter)->texp() );
00057       }
00058     }
00059     return;
00060   }
00061 
00062 };
00063 
00064 #endif

Generated on Tue Nov 29 23:14:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7