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