00001 #include "VertexFit/GammaShape.h"
00002 #include <iostream>
00003 #include <cmath>
00004
00005
00006 GammaShape::GammaShape() {
00007 m_tail = 0;
00008 m_width = 0;
00009 m_peak = 0;
00010 m_e = 0;
00011 m_de = 0;
00012 m_dphi = 0;
00013 m_dtheta = 0;
00014 }
00015
00016 GammaShape::GammaShape(const GammaShape &gammashape) {
00017 m_tail = gammashape.m_tail;
00018 m_width = gammashape.m_width;
00019 m_peak = gammashape.m_peak;
00020 m_e = gammashape.m_e;
00021 m_de = gammashape.m_de;
00022 m_dphi = gammashape.m_dphi;
00023 m_dtheta = gammashape.m_dtheta;
00024 }
00025
00026 GammaShape & GammaShape :: operator = (const GammaShape &gammashape) {
00027 m_tail = gammashape.m_tail;
00028 m_width = gammashape.m_width;
00029 m_peak = gammashape.m_peak;
00030 m_e = gammashape.m_e;
00031 m_de = gammashape.m_de;
00032 m_dphi = gammashape.m_dphi;
00033 m_dtheta = gammashape.m_dtheta;
00034 return (*this);
00035 }
00036
00037 GammaShape::GammaShape(const double eorigin, const double peak) {
00038 m_tail = tail(peak);
00039 m_width = width(peak);
00040 m_peak = peak;
00041 m_e = eorigin;
00042 m_de = de(eorigin, peak);
00043 m_dphi = 0;
00044 m_dtheta = 0;
00045 }
00046
00047
00048 GammaShape::GammaShape(const HepLorentzVector p4, const double dphi, const double dthe, const double de) {
00049 m_tail = 0;
00050 m_width = 0;
00051 m_peak = 0;
00052 m_e = 0;
00053 m_de = 0;
00054 m_dphi = dphi;
00055 m_dtheta = dthe;
00056 }
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00069
00070
00071
00072
00073
00074
00075
00077
00079
00080
00081 double GammaShape::tail(const double peak){
00082 return -0.7931 + 0.8026*peak - 0.6694*peak*peak + 0.1476*peak*peak*peak;
00083 }
00084
00085 double GammaShape::width(const double peak){
00086 return 0.002496/sqrt(peak) + 0.01861 + 0.0001788*peak;
00087 }
00088
00089 double GammaShape::mean(const double peak) {
00090 return -0.7984 + 0.7759*peak - 0.6356*peak*peak + 0.1476*peak*peak*peak;
00091 }
00092
00093 double GammaShape::de(double eorigin, double peak) {
00094 double f1;
00095 double tail1 = tail(peak);
00096 double width1 = width(peak);
00097 double mean1 = mean(peak);
00098 double qa = tail1*sqrt(log(4.));
00099 double qb = sinh(qa)/qa;
00100 double qx = (eorigin-peak)/width1*qb*tail1;
00101
00102
00103
00104 if(fabs(qx)>0.001){
00105 f1 = (eorigin-peak)/fitm(eorigin,peak, width1, tail1, mean1);
00106
00107 }
00108 else {
00109
00110 f1 = width1/(qb*tail1);
00111
00112 }
00113
00114
00115
00116 return f1;
00117 }
00118
00119
00120
00121
00122
00123 double GammaShape::fitm(double x, double pk, double width, double tail, double mean) {
00124
00125 double qa = tail*sqrt(log(4.));
00126 double qb = sinh(qa)/qa;
00127 double qx = ((x-pk)/pk)/width*qb;
00128 double qy = 1 + tail * qx;
00129 double qc;
00130 if(qy < 1.e-7) qc = 15;
00131 else
00132 qc = log(qy)/tail;
00133 double val = qc;
00134 return val-mean;
00135 }
00136
00137
00138