BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
calib_barrel_atten.h
Go to the documentation of this file.
1#ifndef CALIB_BARREL_ATTEN_H
2#define CALIB_BARREL_ATTEN_H
3
4#include "TofCalib.h"
5
6const int nBarrelAtten = 2;
7
9public:
10 calib_barrel_atten() : TofCalib( nBarrelAtten ) { m_name = string( "calib_barrel_atten" ); }
11
12 void calculate_funcs( const Record* r ) {
13 double z = r->zrhit();
14 double q1 = r->qleft();
15 double q2 = r->qright();
16
17 if ( q1 > 0.0 && q2 > 0.0 )
18 {
19 funcs[0] = 2.0 * z;
20 funcs[1] = 1.0;
21 }
22 else
23 {
24 funcs[0] = 0.0;
25 funcs[1] = 0.0;
26 }
27
28 return;
29 }
30
31 void calculate_y( const Record* r ) {
32 double q1 = r->qleft();
33 double q2 = r->qright();
34 if ( q1 > 0.0 && q2 > 0.0 ) { y = log( q1 / q2 ); }
35 else { y = 0.0; }
36 return;
37 }
38
40 if ( data->size() > 0 )
41 {
42 std::vector<Record*>::iterator iter = data->begin();
43 for ( ; iter != data->end(); iter++ )
44 {
45 double z = ( *iter )->zrhit();
46 double sintheta = ( *iter )->theta();
47 double q1 = ( *iter )->qleft();
48 double q2 = ( *iter )->qright();
49 double latten = 1.0 / X[0];
50 double a1overa2 = exp( X[1] );
51 double q0 =
52 sintheta *
53 ( q1 * exp( ( 115.0 - z ) / latten ) + q2 * exp( ( 115.0 + z ) / latten ) ) /
54 ( 1.0 + a1overa2 );
55 ( *iter )->setQ0( q0 );
56 }
57 }
58 return;
59 }
60};
61
62#endif
TTree * data
EvtComplex exp(const EvtComplex &c)
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< Record * > RecordSet
Definition TofDataSet.h:97
const int nBarrelAtten
double qleft() const
Definition TofDataSet.h:57
double zrhit() const
Definition TofDataSet.h:61
double qright() const
Definition TofDataSet.h:58
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_funcs(const Record *r)
void calculate_y(const Record *r)