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

Go to the documentation of this file.
00001 #ifndef CALIB_MC_ETF_COMBINE_H
00002 #define CALIB_MC_ETF_COMBINE_H
00003 
00004 #include "tofcalgsec/TofCalib.h"
00005 
00006 const int nEtfmcCombine = 2;
00007 
00008 class calib_mc_etf_combine:public TofCalib {
00009  public:
00010   calib_mc_etf_combine():TofCalib( nEtfmcCombine ) {
00011     m_name = string("calib_etf_combine");
00012   }
00013 
00014   void calculate_funcs( const Record* r ) {
00015     double q = ( r->qleft() + r->qright() )/2.0;
00016     double z = r->zrhit();
00017 
00018     if( q<0.0 ) {
00019       for( int i=0; i<nEtfCombine; i++ ) {
00020         funcs[i] = 1.0;
00021       }
00022     }
00023     else {
00024       funcs[0] = 1.0;
00025       funcs[1] = 1.0/sqrt(q);
00026     }
00027 
00028     return;
00029   }
00030 
00031   void calculate_y(const Record* r) {
00032     y = ( r->tleft() + r->tright() )/2.0 - r->texp();
00033     return;
00034   }
00035 
00036   void updateData( RecordSet*& data ) {
00037     if( data->size() > 0 ) {
00038       std::vector<Record*>::iterator iter = data->begin();
00039       for( ; iter!=data->end(); iter++ ) {
00040         calculate_funcs( (*iter) );
00041         double tcorr = 0.0;
00042         for( int i=0; i<X.num_row(); i++ ) {
00043           tcorr += X[i]*funcs[i];
00044         }
00045         (*iter)->setT0( ( (*iter)->tleft() + (*iter)->tright() )/2.0 - tcorr - (*iter)->texp() );
00046       }
00047     }
00048     return;
00049   }
00050 
00051 };
00052 
00053 #endif

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