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

Go to the documentation of this file.
00001 #ifndef CALIB_BARREL_LEFT_H
00002 #define CALIB_BARREL_LEFT_H
00003 
00004 #include "tofcalgsec/TofCalib.h"
00005 
00006 const int nBarrelLeft = 7;
00007 
00008 class calib_barrel_left:public TofCalib {
00009  public:
00010   calib_barrel_left():TofCalib( nBarrelLeft ) {
00011     m_name = string("calib_barrel_left");
00012   }
00013 
00014   void calculate_funcs( const Record* r ) {
00015     double q = r->qleft();
00016     double z = r->zrhit();
00017 
00018     if( q<0.0 ) {
00019       for( int i=0; i<nBarrelLeft; 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/sqrt(q);
00027       funcs[3] = 1.0/q;
00028       funcs[4] = z;
00029       funcs[5] = z*z;
00030       funcs[6] = z*z*z;
00031     }
00032 
00033     return;
00034   }
00035 
00036   void calculate_y(const Record* r) {
00037     y = r->tleft() - r->texp();
00038     return;
00039   }
00040 
00041   void updateData( RecordSet*& data ) {
00042     if( data->size() > 0 ) {
00043       std::vector<Record*>::iterator iter = data->begin();
00044       for( ; iter!=data->end(); iter++ ) {
00045         calculate_funcs( (*iter) );
00046         double tcorr = 0.0;
00047         for( int i=0; i<X.num_row(); i++ ) {
00048           tcorr += X[i]*funcs[i];
00049         }
00050         (*iter)->settleft( (*iter)->tleft() - tcorr - (*iter)->texp() );
00051       }
00052     }
00053     return;
00054   }
00055 
00056 };
00057 
00058 #endif

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