/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Analysis/VertexFit/VertexFit-00-02-78/src/GammaShape.cxx

Go to the documentation of this file.
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 //double GammaShape::peak(const double fitvalue){
00060 //   if(fitvalue>0.2) return 0.008488 + 0.9971*fitvalue + 0.006237*fitvalue*fitvalue;
00061 //   else return 0.00409 + 0.9561*fitvalue + 0.1232*fitvalue;
00062 //}
00063 
00064 //double GammaShape::tail(const double peak){
00065 //   if(peak>0.2){
00066 //        return -0.8446+0.486*peak-0.1574*peak*peak-0.003065*peak*peak*peak;
00067 //   }else return -0.4676-6.217*peak+30.45*peak*peak-53.39*peak*peak*peak;
00069 //}
00070 
00071 
00072 //double GammaShape::width(const double peak){
00073 //   if(peak>0.2){
00074 //     return -0.000736/sqrt(peak) + 0.00423 + 0.02175*peak; //boss 6.5.0 absolute resolution
00075 //   
00077 //   }else return -2.886*0.00001/sqrt(peak) + 0.000832 + 0.0217*peak;
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 //cout<<"qx ="<<qx<<endl;
00102 //  f1 = (eorigin-peak)/fitm(eorigin,peak, width1, tail1);
00103 
00104   if(fabs(qx)>0.001){
00105     f1 = (eorigin-peak)/fitm(eorigin,peak, width1, tail1, mean1);
00106 //    cout<<"dynamic"<<endl;
00107   }
00108   else { 
00109 //    f1=width1/qb;
00110     f1 = width1/(qb*tail1);
00111 //    cout<<"gaus"<<endl;
00112   }
00113 
00114  // else f1 = 0;
00115 //  return f1*eorigin;
00116   return f1;
00117 }
00118  
00119 
00120 
00121 //for this funtion, becaus I get the parameters from the relative value of the energy,
00122 //I can the x to x/pk
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 

Generated on Tue Nov 29 22:57:39 2016 for BOSS_7.0.2 by  doxygen 1.4.7