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