BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_barrel_left_offset2_bunch0_3.h
Go to the documentation of this file.
1#ifndef CALIB_BARREL_LEFT_OFFSET2_BUNCH0_3_H
2#define CALIB_BARREL_LEFT_OFFSET2_BUNCH0_3_H
3
5
7
9 public:
11 m_name = string("calib_barrel_left_offset2_bunch0");
12 }
13
14 void calculate_funcs( const Record* r ) {
15 int run = r->run();
16 double z = r->zrhit();
17 double t = r->tleft();
18 double t0 = r->phi();
19 if( run<0 || (static_cast<int>(t0/(8.0*12000./499.8/8./3. )+0.1))%3==0){
20 if( z<5.0 && abs(t)<10.0 ) {
21 funcs[0] = 1.0;
22 funcs[1] = z;
23 funcs[2] = z*z;
24 funcs[3] = z*z*z;
25 funcs[4] = z*z*z*z;
26 funcs[5] = z*z*z*z*z;
27 funcs[6] = z*z*z*z*z*z;
28 }
29 else {
30 funcs[0] = 0.0;
31 funcs[1] = 0.0;
32 funcs[2] = 0.0;
33 funcs[3] = 0.0;
34 funcs[4] = 0.0;
35 funcs[5] = 0.0;
36 funcs[6] = 0.0;
37 }
38 }
39 return;
40 }
41
42 void calculate_y(const Record* r) {
43 if( r->run()<0 || (static_cast<int>((r->phi())/(8.0*12000./499.8/8./3. )+0.1))%3==0){
44 if( r->zrhit() < 5.0 ) {
45 y = r->tleft();
46 }
47 else {
48 y = 0.0;
49 }
50 }
51 return;
52 }
53
55 if( data->size() > 0 ) {
56 std::vector<Record*>::iterator iter = data->begin();
57 for( ; iter!=data->end(); iter++ ) {
58 if( (*iter)->run() < 0 ) return;
59 if ((static_cast<int>(((*iter)->phi())/(8.0*12000./499.8/8./3. )+0.1))%3==0){
60 if( (*iter)->zrhit()>=0.0 ) continue;
62 double tcorr = 0.0;
63 for( int i=0; i<X.num_row(); i++ ) {
64 tcorr += X[i]*funcs[i];
65 }
66 (*iter)->settleft( (*iter)->tleft() - tcorr );
67 }
68 }
69 }
70 return;
71 }
72
73};
74
75#endif
TTree * data
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< Record * > RecordSet
Definition TofDataSet.h:98
TTree * t
Definition binning.cxx:23
const int nBarrelLeft_Offset2_bunch0_3
double tleft() const
Definition TofDataSet.h:59
double phi() const
Definition TofDataSet.h:65
int run() const
Definition TofDataSet.h:53
double zrhit() const
Definition TofDataSet.h:61
HepVector funcs
Definition TofCalib.h:41
string m_name
Definition TofCalib.h:36
HepVector X
Definition TofCalib.h:39
double y
Definition TofCalib.h:42