BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_etf_weight.h
Go to the documentation of this file.
1#ifndef CALIB_ETF_WEIGHT_H
2#define CALIB_ETF_WEIGHT_H
3
4#include "TofCalib.h"
5
6const int nEtfWeight = 4;
7
8class calib_etf_weight : public TofCalib {
9public:
10 calib_etf_weight() : TofCalib( nEtfWeight ) { m_name = string( "calib_etf_weight" ); }
11
12 void calculate_funcs( const Record* r ) {
13 double tleft = r->tleft();
14 double tright = r->tright();
15 double z = r->zrhit();
16
17 funcs[0] = tright - tleft;
18 funcs[1] = funcs[0] * z;
19 funcs[2] = funcs[1] * z;
20 funcs[3] = funcs[2] * z;
21
22 return;
23 }
24
25 void calculate_y( const Record* r ) {
26 y = 0.0 - ( r->tright() );
27 return;
28 }
29
31 if ( data->size() > 0 )
32 {
33 std::vector<Record*>::iterator iter = data->begin();
34 for ( ; iter != data->end(); iter++ )
35 {
36 calculate_funcs( ( *iter ) );
37 double tcorr = 0.0;
38 for ( int i = 0; i < X.num_row(); i++ ) { tcorr += X[i] * funcs[i]; }
39 ( *iter )->setT0( tcorr + ( *iter )->tright() );
40 }
41 }
42 return;
43 }
44};
45
46#endif
TTree * data
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< Record * > RecordSet
Definition TofDataSet.h:97
const int nEtfWeight
double tleft() const
Definition TofDataSet.h:59
double tright() const
Definition TofDataSet.h:60
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
void updateData(RecordSet *&data)
void calculate_y(const Record *r)
void calculate_funcs(const Record *r)