CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
GammaShape.cxx
Go to the documentation of this file.
2#include <iostream>
3#include <cmath>
4
5
7 m_tail = 0;
8 m_width = 0;
9 m_peak = 0;
10 m_e = 0;
11 m_de = 0;
12 m_dphi = 0;
13 m_dtheta = 0;
14}
15
17 m_tail = gammashape.m_tail;
18 m_width = gammashape.m_width;
19 m_peak = gammashape.m_peak;
20 m_e = gammashape.m_e;
21 m_de = gammashape.m_de;
22 m_dphi = gammashape.m_dphi;
23 m_dtheta = gammashape.m_dtheta;
24}
25
26GammaShape & GammaShape :: operator = (const GammaShape &gammashape) {
27 m_tail = gammashape.m_tail;
28 m_width = gammashape.m_width;
29 m_peak = gammashape.m_peak;
30 m_e = gammashape.m_e;
31 m_de = gammashape.m_de;
32 m_dphi = gammashape.m_dphi;
33 m_dtheta = gammashape.m_dtheta;
34 return (*this);
35}
36
37GammaShape::GammaShape(const double eorigin, const double peak) {
38 m_tail = tail(peak);
39 m_width = width(peak);
40 m_peak = peak;
41 m_e = eorigin;
42 m_de = de(eorigin, peak);
43 m_dphi = 0;
44 m_dtheta = 0;
45}
46
47
48GammaShape::GammaShape(const HepLorentzVector p4, const double dphi, const double dthe, const double de) {
49 m_tail = 0;
50 m_width = 0;
51 m_peak = 0;
52 m_e = 0;
53 m_de = 0;
54 m_dphi = dphi;
55 m_dtheta = dthe;
56}
57
58
59//double GammaShape::peak(const double fitvalue){
60// if(fitvalue>0.2) return 0.008488 + 0.9971*fitvalue + 0.006237*fitvalue*fitvalue;
61// else return 0.00409 + 0.9561*fitvalue + 0.1232*fitvalue;
62//}
63
64//double GammaShape::tail(const double peak){
65// if(peak>0.2){
66// return -0.8446+0.486*peak-0.1574*peak*peak-0.003065*peak*peak*peak;
67// }else return -0.4676-6.217*peak+30.45*peak*peak-53.39*peak*peak*peak;
68//// return -0.5253-0.7995*peak+0.9823*peak*peak-0.2942*peak*peak*peak;
69//}
70
71
72//double GammaShape::width(const double peak){
73// if(peak>0.2){
74// return -0.000736/sqrt(peak) + 0.00423 + 0.02175*peak; //boss 6.5.0 absolute resolution
75//
76//// return 0.001822/sqrt(peak)+0.02483-0.001221*peak; //boss 6.5.0
77// }else return -2.886*0.00001/sqrt(peak) + 0.000832 + 0.0217*peak;
78//// return 0.002123/sqrt(peak)+0.01877+0.0005207*peak;
79//}
80
81double GammaShape::tail(const double peak){
82 return -0.7931 + 0.8026*peak - 0.6694*peak*peak + 0.1476*peak*peak*peak;
83}
84
85double GammaShape::width(const double peak){
86 return 0.002496/sqrt(peak) + 0.01861 + 0.0001788*peak;
87}
88
89double GammaShape::mean(const double peak) {
90 return -0.7984 + 0.7759*peak - 0.6356*peak*peak + 0.1476*peak*peak*peak;
91}
92
93double GammaShape::de(double eorigin, double peak) {
94 double f1;
95 double tail1 = tail(peak);
96 double width1 = width(peak);
97 double mean1 = mean(peak);
98 double qa = tail1*sqrt(log(4.));
99 double qb = sinh(qa)/qa;
100 double qx = (eorigin-peak)/width1*qb*tail1;
101//cout<<"qx ="<<qx<<endl;
102// f1 = (eorigin-peak)/fitm(eorigin,peak, width1, tail1);
103
104 if(fabs(qx)>0.001){
105 f1 = (eorigin-peak)/fitm(eorigin,peak, width1, tail1, mean1);
106// cout<<"dynamic"<<endl;
107 }
108 else {
109// f1=width1/qb;
110 f1 = width1/(qb*tail1);
111// cout<<"gaus"<<endl;
112 }
113
114 // else f1 = 0;
115// return f1*eorigin;
116 return f1;
117}
118
119
120
121//for this funtion, becaus I get the parameters from the relative value of the energy,
122//I can the x to x/pk
123double GammaShape::fitm(double x, double pk, double width, double tail, double mean) {
124
125 double qa = tail*sqrt(log(4.));
126 double qb = sinh(qa)/qa;
127 double qx = ((x-pk)/pk)/width*qb;
128 double qy = 1 + tail * qx;
129 double qc;
130 if(qy < 1.e-7) qc = 15;
131 else
132 qc = log(qy)/tail;
133 double val = qc;
134 return val-mean;
135 }
136
137
138
TFile * f1
Double_t x[10]
double tail(const double epeak)
double width(const double epeak)
double peak(const double fitvalue)
double de(const double eorigin, const double peak)
double fitm(double x, double pk, double width, double tail, double mean)
double mean(const double epeak)