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

Go to the documentation of this file.
00001 #ifndef CALIB_BARREL_LEFT_OFFSET1_BUNCH0_3_H
00002 #define CALIB_BARREL_LEFT_OFFSET1_BUNCH0_3_H
00003 
00004 #include "tofcalgsec/TofCalib.h"
00005 
00006 const int nBarrelLeft_Offset1_bunch0_3 = 7;
00007 
00008 class calib_barrel_left_offset1_bunch0_3:public TofCalib {
00009  public:
00010   calib_barrel_left_offset1_bunch0_3():TofCalib( nBarrelLeft_Offset1_bunch0_3 ) {
00011     m_name = string("calib_barrel_left_offset1_bunch0");
00012   }
00013 
00014   void calculate_funcs( const Record* r ) {
00015     int  run = r->run();
00016     double z = r->zrhit();
00017     double t = r->tleft();
00018     double t0 = r->phi();
00019     if( run<0 || (static_cast<int>(t0/(8.0*12000./499.8/8./3. )+0.1))%3==0 ) { 
00020        if( z>-5.0 && abs(t)<10.0 ) {
00021          funcs[0] = 1.0;
00022          funcs[1] = z;
00023          funcs[2] = z*z;
00024          funcs[3] = z*z*z;
00025          funcs[4] = z*z*z*z;
00026          funcs[5] = z*z*z*z*z;
00027          funcs[6] = z*z*z*z*z*z;
00028        }
00029        else {
00030          funcs[0] = 0.0;
00031          funcs[1] = 0.0;
00032          funcs[2] = 0.0;
00033          funcs[3] = 0.0;
00034          funcs[4] = 0.0;
00035          funcs[5] = 0.0;
00036          funcs[6] = 0.0;
00037        }
00038     }
00039     return;
00040   }
00041 
00042   void calculate_y(const Record* r) {
00043     if( r->run()<0 || (static_cast<int>((r->phi())/(8.0*12000./499.8/8./3. )+0.1))%3==0 ) {
00044        if( r->zrhit() > -5.0 ) {
00045          y = r->tleft();
00046        }
00047        else {
00048          y = 0.0;
00049        }
00050     }
00051     return;
00052   }
00053 
00054   void updateData( RecordSet*& data ) {
00055     if( data->size() > 0 ) {
00056       std::vector<Record*>::iterator iter = data->begin();
00057       for( ; iter!=data->end(); iter++ ) {
00058         if( (*iter)->run() < 0 ) return;
00059         if ((static_cast<int>(((*iter)->phi())/(8.0*12000./499.8/8./3. )+0.1))%3==0) {
00060            if( (*iter)->zrhit() < 0.0 ) continue;
00061            calculate_funcs( (*iter) );
00062            double tcorr = 0.0;
00063            for( int i=0; i<X.num_row(); i++ ) {
00064              tcorr += X[i]*funcs[i];
00065            }
00066            (*iter)->settleft( (*iter)->tleft() - tcorr );
00067         }
00068       }
00069     }
00070     return;
00071   }
00072 
00073 };
00074 
00075 #endif

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