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

Go to the documentation of this file.
00001 #ifndef CALIB_MC_ETF_RIGHT_H
00002 #define CALIB_MCETF_RIGHT_H
00003 
00004 #include "tofcalgsec/TofCalib.h"
00005 
00006 const int nEtfmcRight = 3;
00007 
00008 class calib_mc_etf_right:public TofCalib {
00009  public:
00010   calib_mc_etf_right():TofCalib( nEtfmcRight ) {
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] = z;
00027     }
00028 
00029     return;
00030   }
00031 
00032   void calculate_y(const Record* r) {
00033     y = r->tright() - r->texp();
00034     return;
00035   }
00036 
00037   void updateData( RecordSet*& data ) {
00038     if( data->size() > 0 ) {
00039       std::vector<Record*>::iterator iter = data->begin();
00040       for( ; iter!=data->end(); iter++ ) {
00041         calculate_funcs( (*iter) );
00042         double tcorr = 0.0;
00043         for( int i=0; i<X.num_row(); i++ ) {
00044           tcorr += X[i]*funcs[i];
00045         }
00046         (*iter)->settright( (*iter)->tright() - tcorr - (*iter)->texp() );
00047       }
00048     }
00049     return;
00050   }
00051 
00052 };
00053 
00054 #endif

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