/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/DedxCalibAlg/DedxCalibAlg-00-01-15/DedxCalibAlg/DedxCalibParameters.h File Reference

#include <vector>

Go to the source code of this file.

Defines

#define NormalMean   550
#define NumHistBins   300
#define MinHistValue   10
#define MaxHistValue   3000
#define MinHistValue1   300
#define MaxHistValue1   950
#define MinChiValue   -1
#define MaxChiValue   1
#define MinADCValuecut   10
#define MaxADCValuecut   35000
#define RPhi_PathMaxCut   3
#define Iner_RPhi_PathMinCut   0.24
#define Out_RPhi_PathMinCut   0.32
#define Iner_DriftDistCut   0.75
#define Out_DriftDistCut   1.0
#define NumSlices   100
#define NumSlicesDoca   40
#define NumSlicesEAng   40
#define DocaMin   -1.1
#define DocaMax   1.1
#define PhiMin   -0.25
#define PhiMax   0.25
#define NumBinCostheta   80
#define CosthetaMin   -1.00
#define CosthetaMax   1.00

Functions

double mylan (double *x, double *par)
double landaun (double *x, double *par)
double Landau (double *x, double *par)
double Vavilov (double *x, double *par)
double AsymGauss (double *x, double *par)
void dedx_pid_exp_old (int landau, int runflag, float dedx, int Nohit, float mom, float theta, float t0, float lsamp, double dedx_exp[5], double ex_sigma[5], double pid_prob[5], double chi_dedx[5])
void dedx_pid_exp (int vflag[3], float dedx, int trkalg, int Nohit, float mom, float theta, float t0, float lsamp, double dedx_exp[5], double ex_sigma[5], double pid_prob[5], double chi_dedx[5], std::vector< double > &par, std::vector< double > &sig_par)
double SpaceChargeCorrec (double m_theta, double mom, int Particle, double dEdx)

Variables

const long int RUN0 = 0
const long int RUN1 = 0
const long int RUN2 = 5459
const long int RUN3 = 8093
const long int RUN4 = 9947
const long int RUN5 = 11397
const long int RUN6 = 23455
const long int RUN7 = 25244
const double HV1_curvep0 = 500.0*0.1165
const double HV1_curvep1 = 9.404
const double HV1_curvep2 = 0.009811
const double HV1_curvep3 = 1.621
const double HV1_curvep4 = 1.19
const double HV1_index_sin = 0
const double HV1_index_nhit = 0.9525
const double HV1_sigmap0 = 65
const double HV1_sigmap1 = 57.08
const double HV1_sigmap2 = 60.03
const double HV1_sigmap3 = -2.747
const double HV2_curvep0 = 550.0*0.0182604
const double HV2_curvep1 = 35.0428
const double HV2_curvep2 = 1.24185e-09
const double HV2_curvep3 = 2.25831
const double HV2_curvep4 = 5.81573
const double HV2_index_sin = 0.341267
const double HV2_index_nhit = 0.557516
const double HV2_sigmap0 = 33.0
const double HV2_sigmap1 = 33.1897
const double HV2_sigmap2 = 29.3308
const double HV2_sigmap3 = -2.11828
const double VR0CUT = 1.0
const double VZ0CUT = 10.0
const double PT0HighCut = 5.0
const double PT0LowCut = 0.05
static const double doca_norm [43]
static const double Eangle_value_cut [15]
static const double Eangle_cut_bin [14] = {1, 1, 2, 6, 6, 2, 2, 2, 2, 6, 6, 2, 1, 1}


Define Documentation

#define CosthetaMax   1.00

Definition at line 71 of file DedxCalibParameters.h.

Referenced by DedxCalibCostheta::BookHists(), and DedxCalibCostheta::FillHists().

#define CosthetaMin   -1.00

Definition at line 70 of file DedxCalibParameters.h.

Referenced by DedxCalibCostheta::BookHists(), DedxCalibCostheta::FillHists(), and DedxCalibCostheta::WriteHists().

#define DocaMax   1.1

Definition at line 65 of file DedxCalibParameters.h.

Referenced by DedxCalibDocaEAng::BookHists(), and DedxCalibDocaEAng::FillHists().

#define DocaMin   -1.1

Definition at line 64 of file DedxCalibParameters.h.

Referenced by DedxCalibDocaEAng::BookHists(), DedxCalibDocaEAng::FillHists(), and DedxCalibDocaEAng::WriteHists().

#define Iner_DriftDistCut   0.75

Definition at line 58 of file DedxCalibParameters.h.

Referenced by MdcDedxRecon::execute(), DedxCalibWireGain::FillHists(), DedxCalibLayerGain::FillHists(), DedxCalibEAng::FillHists(), MdcDedxRecon::kaltrackrec(), and MdcDedxRecon::mdctrackrec().

#define Iner_RPhi_PathMinCut   0.24

Definition at line 56 of file DedxCalibParameters.h.

#define MaxADCValuecut   35000

Definition at line 54 of file DedxCalibParameters.h.

Referenced by DedxCalibWireGain::FillHists(), DedxCalibLayerGain::FillHists(), and DedxCalibEAng::FillHists().

#define MaxChiValue   1

Definition at line 51 of file DedxCalibParameters.h.

Referenced by DedxCalibCostheta::BookHists().

#define MaxHistValue   3000

Definition at line 47 of file DedxCalibParameters.h.

Referenced by DedxCalibWireGain::BookHists(), DedxCalibLayerGain::BookHists(), DedxCalibEAng::BookHists(), DedxCalibDocaEAng::BookHists(), MdcDedxRecon::execute(), MdcDedxRecon::kaltrackrec(), and MdcDedxRecon::mdctrackrec().

#define MaxHistValue1   950

Definition at line 49 of file DedxCalibParameters.h.

Referenced by DedxCalibRunByRun::BookHists(), DedxCalibLayerGain::BookHists(), and DedxCalibCostheta::BookHists().

#define MinADCValuecut   10

Definition at line 53 of file DedxCalibParameters.h.

#define MinChiValue   -1

Definition at line 50 of file DedxCalibParameters.h.

Referenced by DedxCalibCostheta::BookHists().

#define MinHistValue   10

Definition at line 46 of file DedxCalibParameters.h.

Referenced by DedxCalibWireGain::BookHists(), DedxCalibLayerGain::BookHists(), DedxCalibEAng::BookHists(), and DedxCalibDocaEAng::BookHists().

#define MinHistValue1   300

Definition at line 48 of file DedxCalibParameters.h.

Referenced by DedxCalibRunByRun::BookHists(), DedxCalibLayerGain::BookHists(), and DedxCalibCostheta::BookHists().

#define NormalMean   550

Definition at line 43 of file DedxCalibParameters.h.

Referenced by DedxCalibRunByRun::WriteHists(), and DedxCalibCostheta::WriteHists().

#define NumBinCostheta   80

Definition at line 69 of file DedxCalibParameters.h.

Referenced by DedxCalibCostheta::AnalyseHists(), DedxCalibCostheta::BookHists(), and DedxCalibCostheta::WriteHists().

#define NumHistBins   300

Definition at line 45 of file DedxCalibParameters.h.

Referenced by DedxCalibLayerGain::AnalyseHists(), DedxCalibWireGain::BookHists(), DedxCalibRunByRun::BookHists(), DedxCalibLayerGain::BookHists(), DedxCalibEAng::BookHists(), DedxCalibDocaEAng::BookHists(), and DedxCalibCostheta::BookHists().

#define NumSlices   100

Definition at line 61 of file DedxCalibParameters.h.

Referenced by DedxCalibEAng::AnalyseHists(), DedxCalibEAng::BookHists(), and DedxCalibEAng::WriteHists().

#define NumSlicesDoca   40

Definition at line 62 of file DedxCalibParameters.h.

Referenced by DedxCalibDocaEAng::AnalyseHists(), DedxCalibDocaEAng::BookHists(), DedxCorrecSvc::DocaSinCorrec(), DedxCorrecSvc::init_param_svc(), and DedxCalibDocaEAng::WriteHists().

#define NumSlicesEAng   40

Definition at line 63 of file DedxCalibParameters.h.

Referenced by DedxCalibDocaEAng::AnalyseHists(), DedxCalibDocaEAng::BookHists(), and DedxCalibDocaEAng::WriteHists().

#define Out_DriftDistCut   1.0

Definition at line 59 of file DedxCalibParameters.h.

Referenced by MdcDedxRecon::execute(), DedxCalibWireGain::FillHists(), DedxCalibLayerGain::FillHists(), DedxCalibEAng::FillHists(), MdcDedxRecon::kaltrackrec(), and MdcDedxRecon::mdctrackrec().

#define Out_RPhi_PathMinCut   0.32

Definition at line 57 of file DedxCalibParameters.h.

#define PhiMax   0.25

Definition at line 67 of file DedxCalibParameters.h.

Referenced by DedxCalibEAng::BookHists(), DedxCalibDocaEAng::BookHists(), DedxCalibEAng::FillHists(), and DedxCalibDocaEAng::FillHists().

#define PhiMin   -0.25

Definition at line 66 of file DedxCalibParameters.h.

Referenced by DedxCalibEAng::BookHists(), DedxCalibDocaEAng::BookHists(), DedxCalibEAng::FillHists(), DedxCalibDocaEAng::FillHists(), and DedxCalibEAng::WriteHists().

#define RPhi_PathMaxCut   3

Definition at line 55 of file DedxCalibParameters.h.

Referenced by MdcDedxRecon::execute(), DedxCalibWireGain::FillHists(), DedxCalibLayerGain::FillHists(), DedxCalibEAng::FillHists(), MdcDedxRecon::kaltrackrec(), and MdcDedxRecon::mdctrackrec().


Function Documentation

double AsymGauss ( double *  x,
double *  par 
)

Definition at line 50 of file DedxCalibParameters.cxx.

Referenced by DedxCalibWireGain::AnalyseHists(), DedxCalibLayerGain::AnalyseHists(), DedxCalibEAng::AnalyseHists(), and DedxCalibDocaEAng::AnalyseHists().

00051 {
00052     double delta, a, b, c, d, fitval;
00053     a = TMath::Sqrt(log(4.0));
00054     b = (x[0]-par[1])/par[2];
00055     c = TMath::Power(par[3],2.0);
00056     delta = (1+ TMath::SinH(par[3]*a)/a)*b;
00057     d = TMath::Power(log(delta),2.0)/c+c;
00058     fitval = par[0]*TMath::Exp(-0.5*d);
00059     return fitval;
00060 }

void dedx_pid_exp ( int  vflag[3],
float  dedx,
int  trkalg,
int  Nohit,
float  mom,
float  theta,
float  t0,
float  lsamp,
double  dedx_exp[5],
double  ex_sigma[5],
double  pid_prob[5],
double  chi_dedx[5],
std::vector< double > &  par,
std::vector< double > &  sig_par 
)

Definition at line 165 of file DedxCalibParameters.cxx.

References EvtCyclic3::A, EvtCyclic3::B, EvtCyclic3::C, exp(), prob_(), sin(), and x.

Referenced by DedxCalib::set_dEdx().

00170 {
00171     const int    par_cand( 5 );
00172     const float  Charge_Mass[par_cand] = {0.00051100, 0.10566, 0.13957, 0.4937, 0.93827 };
00173     double       beta_G, beta, betterm, bethe_B;
00174 
00175     int dedxflag = vflag[0];
00176     int sigmaflag = vflag[1]; 
00177     bool ifMC = false;
00178     if(vflag[2] == 1)  ifMC = true;
00179 
00180     int          Nmax_prob(0);
00181     float        max_prob(-0.01);
00182     int ndf;
00183     float  chi2;
00184 
00185     for( int it = 0; it < par_cand; it++ ) {
00186         beta_G = mom/Charge_Mass[it];
00187 
00188         if(dedxflag == 1){
00189             beta = beta_G/sqrt(1+(beta_G)*(beta_G));
00190             betterm = par[1]-log(par[2]+pow(1/beta_G,par[4]));
00191             bethe_B = par[0]/pow(beta,par[3])*betterm-par[0];
00192         }
00193         else if(dedxflag == 2) {
00194             double A=0, B=0,C=0;
00195             double x = beta_G;
00196             if(x<4.5)
00197               A=1;
00198             else if(x<10)
00199               B=1;
00200             else
00201               C=1;
00202             double partA = par[0]*pow(sqrt(x*x+1),par[2])/pow(x,par[2])*(par[1]-par[5]*log(pow(1/x,par[3])) ) - par[4]+exp(par[6]+par[7]*x);
00203             double partB = par[8]*pow(x,3)+par[9]*pow(x,2)+par[10]*x+par[11];
00204             double partC = -par[12]*log(par[15]+pow(1/x,par[13]))+par[14];
00205             bethe_B = 550*(A*partA+B*partB+C*partC);
00206             //for fermi plateau ( the electron region) we just use 1.0
00207             if(beta_G> 100)  bethe_B=550*1.0;
00208         }
00209 
00210         if (ifMC) {
00211             double A=0, B=0,C=0;
00212             double x = beta_G;
00213             if(x<4.5)
00214               A=1;
00215             else if(x<10)
00216               B=1;
00217             else 
00218               C=1;
00219             double partA = par[0]*pow(sqrt(x*x+1),par[2])/pow(x,par[2])*(par[1]-par[5]*log(pow(1/x,par[3])) ) - par[4]+exp(par[6]+par[7]*x);
00220             double partB = par[8]*pow(x,3)+par[9]*pow(x,2)+par[10]*x+par[11];
00221             double partC = -par[12]*log(par[15]+pow(1/x,par[13]))+par[14];
00222             bethe_B = 550*(A*partA+B*partB+C*partC);
00223             //for fermi plateau ( the electron region) we just use 1.0
00224             if(beta_G> 100)  bethe_B=550*1.0;
00225         }   
00226 
00227 
00228         if (Nohit > 0) {
00229             dedx_exp[it] = bethe_B;
00230             double sig_the = std::sin((double)theta);
00231             double f_betagamma, g_sinth, h_nhit, i_t0;
00232 
00233             if (ifMC) {
00234 
00235                 double x= beta_G;
00236                 double nhit = (double)Nohit;
00237                 double sigma_bg=1.0;
00238                 if (x > 0.3)
00239                   sigma_bg = sig_par[0]*exp(sig_par[1]*x)+sig_par[2]*exp(sig_par[3]*pow(x,0.25))+sig_par[4];
00240                 else
00241                   sigma_bg = sig_par[5]*exp(sig_par[6]*x)+ sig_par[7];
00242 
00243                 double cor_nhit = 1.0;
00244                 if (nhit < 5) nhit = 5;
00245                 if (nhit <= 35)
00246                   cor_nhit =  sig_par[8]*pow(nhit,4)+sig_par[9]*pow(nhit,3)+sig_par[10]*pow(nhit,2) +
00247                       sig_par[11]*nhit+sig_par[12];
00248 
00249                 double cor_sin=  1.0;
00250                 if(sig_the>0.99) sig_the=0.99;
00251                 cor_sin = sig_par[13]*pow(sig_the,4)+sig_par[14]*pow(sig_the,3) +
00252                     sig_par[15]*pow(sig_the,2)+sig_par[16]*sig_the+sig_par[17];
00253 
00254                 //sigma vs t0
00255                 double cor_t0 = 1.0;
00256 
00257                 //calculate sigma
00258                 if (trkalg == 1)
00259                   ex_sigma[it] = 550 * sigma_bg * cor_nhit * cor_sin * cor_t0;
00260                 else
00261                   ex_sigma[it] = 550 * sigma_bg * cor_nhit * cor_sin * cor_t0 * sig_par[18];
00262             }
00263             else {
00264                 if(sigmaflag == 1) {
00265                     f_betagamma=sig_par[0]*pow(beta_G,sig_par[1])+sig_par[2];
00266                     g_sinth=(sig_par[3]*sig_the*sig_the+sig_par[4])/(sig_par[3]*sig_par[5]*sig_par[5]+sig_par[4]);
00267                     h_nhit=(sig_par[6]*Nohit*Nohit+sig_par[7]*Nohit+sig_par[8]) /
00268                         (sig_par[6]*sig_par[9]*sig_par[9]+sig_par[7]*sig_par[9]+sig_par[8]);
00269                     if(sig_par[13] != 0)
00270                       i_t0 = (sig_par[10]*t0*t0+sig_par[11]*t0+sig_par[12]) /
00271                           (sig_par[10]*sig_par[13]*sig_par[13]+sig_par[11]*sig_par[13]+sig_par[12]);
00272                     else if(sig_par[13] == 0)
00273                       i_t0 =1;
00274                     //cout<<"f_betagamma : "<<f_betagamma<<"       g_sinth : "<<g_sinth<<"       h_nhit : "
00275                     //<<h_nhit<<"     i_t0 : "<<i_t0<<endl;  
00276                     ex_sigma[it]= f_betagamma* g_sinth * h_nhit * i_t0;
00277                 }
00278                 else if(sigmaflag == 2) {
00279                     double x = beta_G;
00280                     double nhit = (double)Nohit;
00281                     double sigma_bg=1.0;
00282                     if (x > 0.3)
00283                       sigma_bg = sig_par[0]*exp(sig_par[1]*x)+sig_par[2]*exp(sig_par[3]*pow(x,0.25))+sig_par[4];
00284                     else
00285                       sigma_bg = sig_par[5]*exp(sig_par[6]*x)+ sig_par[7];
00286 
00287                     double cor_nhit=1.0;
00288                     if(nhit<5) nhit=5;
00289                     if (nhit <= 35)
00290                       cor_nhit =  sig_par[8]*pow(nhit,4)+sig_par[9]*pow(nhit,3)+sig_par[10]*pow(nhit,2) +  sig_par[11]*nhit+sig_par[12];
00291 
00292                     double cor_sin=  1.0;
00293                     if(sig_the>0.99) sig_the = 0.99;
00294                     cor_sin = sig_par[13]*pow(sig_the,4)+sig_par[14]*pow(sig_the,3) +
00295                         sig_par[15]*pow(sig_the,2)+sig_par[16]*sig_the+sig_par[17];
00296 
00297                     double cor_t0 = 1;
00298                     if (t0 > 1200) t0 = 1200;
00299                     if (t0 > 800)
00300                       cor_t0 = sig_par[18]*pow(t0,2)+sig_par[19]*t0+sig_par[20];
00301 
00302                     ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin*cor_t0;
00303                 }
00304                 else if(sigmaflag == 3) {
00305                     double x= beta_G;
00306                     double nhit = (double)Nohit;
00307                     double sigma_bg=1.0;
00308                     if (x > 0.3)
00309                       sigma_bg = sig_par[0]*exp(sig_par[1]*x)+sig_par[2]*exp(sig_par[3]*pow(x,0.25))+sig_par[4];
00310                     else
00311                       sigma_bg = sig_par[5]*exp(sig_par[6]*x)+ sig_par[7];
00312 
00313                     double cor_nhit = 1.0;
00314                     if (nhit < 5) nhit = 5;
00315                     if (nhit <= 35)
00316                       cor_nhit =  sig_par[8]*pow(nhit,4)+sig_par[9]*pow(nhit,3)+sig_par[10]*pow(nhit,2) +  sig_par[11]*nhit+sig_par[12];
00317 
00318                     double cor_sin=  1.0;
00319                     if(sig_the>0.99) sig_the=0.99;
00320                     cor_sin = sig_par[13]*pow(sig_the,4)+sig_par[14]*pow(sig_the,3) +
00321                         sig_par[15]*pow(sig_the,2)+sig_par[16]*sig_the+sig_par[17];
00322 
00323                     ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin;
00324                 }   
00325                 else if(sigmaflag == 4) {
00326                     double x= beta_G;
00327                     double nhit = (double)Nohit;
00328                     double sigma_bg=1.0;
00329                     if (x > 0.3)
00330                       sigma_bg = sig_par[0]*exp(sig_par[1]*x)+sig_par[2]*exp(sig_par[3]*pow(x,0.25))+sig_par[4];
00331                     else
00332                       sigma_bg = sig_par[5]*exp(sig_par[6]*x)+ sig_par[7];
00333 
00334                     double cor_nhit = 1.0;
00335                     if (nhit < 5) nhit = 5;
00336                     if (nhit <= 35)
00337                       cor_nhit =  sig_par[8]*pow(nhit,4)+sig_par[9]*pow(nhit,3)+sig_par[10]*pow(nhit,2) +  sig_par[11]*nhit+sig_par[12];
00338 
00339                     double cor_sin=  1.0;
00340                     if(sig_the>0.99) sig_the=0.99;
00341                     cor_sin = sig_par[13]*pow(sig_the,4)+sig_par[14]*pow(sig_the,3) +
00342                         sig_par[15]*pow(sig_the,2)+sig_par[16]*sig_the+sig_par[17];
00343 
00344                     if(trkalg==1)
00345                       ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin;
00346                     else
00347                       ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin*sig_par[18];
00348                 }
00349                 else if(sigmaflag == 5) {
00350                     double x = beta_G;
00351                     double nhit = (double)Nohit;
00352                     double sigma_bg=1.0;
00353                     if (x > 0.3)
00354                       sigma_bg = sig_par[0]*exp(sig_par[1]*x)+sig_par[2]*exp(sig_par[3]*pow(x,0.25))+sig_par[4];
00355                     else
00356                       sigma_bg = sig_par[5]*exp(sig_par[6]*x)+ sig_par[7];
00357 
00358                     double cor_nhit=1.0;
00359                     if(nhit<5) nhit=5;
00360                     if (nhit <= 35)
00361                       cor_nhit =  sig_par[8]*pow(nhit,4)+sig_par[9]*pow(nhit,3)+sig_par[10]*pow(nhit,2) +
00362                           sig_par[11]*nhit+sig_par[12];
00363                     double cor_sin=  1.0;
00364                     if(sig_the>0.99) sig_the = 0.99;
00365                     cor_sin = sig_par[13]*pow(sig_the,4)+sig_par[14]*pow(sig_the,3) +
00366                         sig_par[15]*pow(sig_the,2)+sig_par[16]*sig_the+sig_par[17];
00367 
00368                     double cor_t0 = 1;
00369                     if (t0 > 1200) t0 = 1200;
00370                     if (t0 > 800)
00371                       cor_t0 = sig_par[18]*pow(t0,2)+sig_par[19]*t0+sig_par[20];
00372 
00373                     if(trkalg==1)
00374                       ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin*cor_t0;
00375                     else
00376                       ex_sigma[it]=550*sigma_bg*cor_nhit*cor_sin*cor_t0*sig_par[21];
00377                 }   
00378             }       
00379 
00380             double dedx_correc = dedx;
00381             chi_dedx[it] =  (dedx_correc - dedx_exp[it])/ex_sigma[it];
00382             chi2 = chi_dedx[it]*chi_dedx[it]; 
00383             ndf=1;
00384             pid_prob[it] = prob_(&chi2,&ndf);
00385             //if(it ==0 ) cout<<"runflag: "<<runflag<<"    dedx : "<<dedx<<"      chi_dedx: "
00386             //<<chi_dedx[it] <<"      ptrk: "<<mom<<endl; 
00387             if (it == -999) {            // here a debug flag
00388                 std::cout << " mom = " << mom <<"exp"<< dedx_exp[it]
00389                     <<  " sigma "<<ex_sigma[it] <<"  prob   "<<pid_prob[it]
00390                     << std::endl;
00391             } 
00392             if( pid_prob[it] > max_prob ){
00393                 max_prob = pid_prob[it];
00394                 Nmax_prob = it;
00395             }       
00396         }           
00397         else{       
00398             dedx_exp[it] = 0.0;
00399             ex_sigma[it] = 1000.0;
00400             pid_prob[it] = 0.0;
00401             chi_dedx[it] = 999.0;
00402         } //if Nohit > 0
00403     }
00404 }

void dedx_pid_exp_old ( int  landau,
int  runflag,
float  dedx,
int  Nohit,
float  mom,
float  theta,
float  t0,
float  lsamp,
double  dedx_exp[5],
double  ex_sigma[5],
double  pid_prob[5],
double  chi_dedx[5] 
)

Definition at line 63 of file DedxCalibParameters.cxx.

References HV1_curvep0, HV1_curvep1, HV1_curvep2, HV1_curvep3, HV1_curvep4, HV1_index_nhit, HV1_index_sin, HV1_sigmap0, HV1_sigmap1, HV1_sigmap2, HV1_sigmap3, HV2_curvep0, HV2_curvep1, HV2_curvep2, HV2_curvep3, HV2_curvep4, HV2_index_nhit, HV2_index_sin, HV2_sigmap0, HV2_sigmap1, HV2_sigmap2, HV2_sigmap3, prob_(), sin(), and SpaceChargeCorrec().

Referenced by DedxCalib::set_dEdx().

00067 {
00068     double par[5], sigma_par[4], sigma_index_nhit, sigma_index_sin;
00069 
00070     if(runflag==1) {
00071         par[0]= HV1_curvep0;
00072         par[1]= HV1_curvep1;
00073         par[2]= HV1_curvep2;
00074         par[3]= HV1_curvep3;
00075         par[4]= HV1_curvep4;
00076         sigma_par[0] = HV1_sigmap0;
00077         sigma_par[1] = HV1_sigmap1;
00078         sigma_par[2] = HV1_sigmap2;
00079         sigma_par[3] = HV1_sigmap3;
00080         sigma_index_nhit = HV1_index_nhit;
00081         sigma_index_sin  = HV1_index_sin;
00082     }
00083     else if(runflag==2) {
00084         par[0]= HV2_curvep0;
00085         par[1]= HV2_curvep1;
00086         par[2]= HV2_curvep2;
00087         par[3]= HV2_curvep3;
00088         par[4]= HV2_curvep4;
00089         sigma_par[0] = HV2_sigmap0;
00090         sigma_par[1] = HV2_sigmap1;
00091         sigma_par[2] = HV2_sigmap2;
00092         sigma_par[3] = HV2_sigmap3;
00093         sigma_index_nhit = HV2_index_nhit;
00094         sigma_index_sin  = HV2_index_sin;
00095     }
00096 
00097     const int    par_cand( 5 );
00098     const float  Charge_Mass[par_cand] = {0.00051100, 0.10566, 0.13957, 0.4937, 0.93827 };
00099     double       beta_G, beta, betterm, bethe_B, sig_param;
00100 
00101     int          Nmax_prob( 0 );
00102     float        max_prob( -0.01 );
00103     int ndf;
00104     float chi2;
00105 
00106     for( int it = 0; it < par_cand; it++ ) {
00107         beta_G = mom/Charge_Mass[it];
00108         beta = beta_G/sqrt(1+(beta_G)*(beta_G));
00109         betterm = par[1]-log(par[2]+pow(1/beta_G,par[4]));
00110         bethe_B = par[0]/pow(beta,par[3])*betterm-par[0];
00111 
00112         if( Nohit >0 ) {
00113             dedx_exp[it] = bethe_B;
00114             double sig_the=std::sin( (double)theta );
00115 
00116             if(runflag <3 && runflag>0){
00117                 if(landau == 0) {
00118                     sig_param = 1.6*std::sin( (double) theta )/(lsamp*double(Nohit));
00119                     ex_sigma[it] = 0.05*bethe_B*sqrt( 50.0*sig_param );
00120                 }
00121                 else {
00122                     //currently use one sigmap0
00123                     if(beta_G < 4) {
00124                         sig_param=sigma_par[1]+sigma_par[2]*std::pow(beta_G,sigma_par[3]);
00125                     } else {
00126                         sig_param= sigma_par[0];
00127                     }
00128                     //double sig_the=std::sin( (double)theta );
00129                     sig_the=std::pow(sig_the,sigma_index_sin);
00130                     double sig_n;
00131                     sig_n=35.0/double(Nohit);
00132                     sig_n=std::pow(sig_n,sigma_index_nhit);
00133                     ex_sigma[it]=sig_param*sig_the*sig_n;
00134                 }
00135             }
00136 
00137             double dedx_correc;
00138             if(runflag == 2 ) dedx_correc = SpaceChargeCorrec(theta, mom, it, dedx);
00139             else  dedx_correc = dedx;
00140             chi_dedx[it] = (dedx_correc - dedx_exp[it])/ex_sigma[it];
00141             chi2 = chi_dedx[it]*chi_dedx[it];
00142             ndf = 1;
00143             pid_prob[it] = prob_(&chi2,&ndf);
00144             //if(it ==0 ) cout<<"runflag: "<<runflag<<"    dedx : "<<dedx<<"      chi_dedx: "
00145             //<<chi_dedx[it] <<"      ptrk: "<<mom<<endl; 
00146             if( it == -999 ){            // here a debug flag
00147                 std::cout << " mom = " << mom <<"exp"<< dedx_exp[it]
00148                     <<  " sigma "<<ex_sigma[it] <<"  prob   "<<pid_prob[it]
00149                     << std::endl;
00150             } 
00151             if( pid_prob[it] > max_prob ) {
00152                 max_prob = pid_prob[it];
00153                 Nmax_prob = it;
00154             }
00155         }       
00156         else {      
00157             dedx_exp[it] = 0.0;
00158             ex_sigma[it] = 1000.0;
00159             pid_prob[it] = 0.0;
00160             chi_dedx[it] = 999.0;
00161         }           
00162     }                   
00163 }                   

double Landau ( double *  x,
double *  par 
)

Definition at line 34 of file DedxCalibParameters.cxx.

References Landau().

Referenced by DedxCalibWireGain::AnalyseHists(), DedxCalibLayerGain::AnalyseHists(), DedxCalibEAng::AnalyseHists(), DedxCalibDocaEAng::AnalyseHists(), and Landau().

00035 {  
00036     double fitval = TMath::Landau(x[0], par[0], par[1], kFALSE);
00037     return fitval;
00038 }

double landaun ( double *  x,
double *  par 
)

Definition at line 25 of file DedxCalibParameters.cxx.

References exp().

Referenced by DedxCalibWireGain::AnalyseHists(), DedxCalibLayerGain::AnalyseHists(), DedxCalibEAng::AnalyseHists(), and DedxCalibDocaEAng::AnalyseHists().

00026 {  
00027 
00028     double kk=(x[0]-par[1])/par[2];
00029     double fterm=kk+exp(-1*kk);
00030     double fitval=par[0]*exp(-0.5*fterm);
00031     return fitval;
00032 } 

double mylan ( double *  x,
double *  par 
)

Definition at line 17 of file DedxCalibParameters.cxx.

References exp().

Referenced by DedxCalibWireGain::AnalyseHists(), DedxCalibLayerGain::AnalyseHists(), DedxCalibEAng::AnalyseHists(), and DedxCalibDocaEAng::AnalyseHists().

00018 {
00019     double kk=(x[0]-par[1])/par[2];
00020     double fterm=kk+exp(-1*kk);
00021     double fitval=par[0]*exp(par[3]*fterm);
00022     return fitval;
00023 }

double SpaceChargeCorrec ( double  m_theta,
double  mom,
int  Particle,
double  dEdx 
)

Definition at line 406 of file DedxCalibParameters.cxx.

References arg(), and cos().

Referenced by dedx_pid_exp_old().

00407 {
00408     const int    par_cand( 5 );
00409     const float  Charge_Mass[par_cand] = {0.00051100, 0.10566, 0.13957, 0.4937, 0.93827 };
00410     double       beta_G;
00411     double e_Par[5] = {143.349, 1.7315, 0.192616, 2.90437, 1.08248};
00412     double Beta_Gamma[22] ={0.373026, 0.479605, 0.586184, 0.692763, 0.799342, 782.779, 1565.56,
00413         2348.34,  17.2727,  18.1245,  1.43297,  2.14946,  12.1803, 13.6132, 6.62515,  10.4109,
00414         14.1967,  17.9825,  21.7683,  26.0274, 30.7596, 35.4919 };
00415     double K_par[22] ={4.64411e-05, 5.86544e-05, 8.05289e-05, 8.46981e-05, 8.92014e-05, 4.74517e-05,
00416         4.51684e-05, 5.32732e-05, 6.12803e-05, 6.14592e-05, 8.08608e-05, 6.73184e-05, 5.46448e-05,
00417         6.1377e-05,  6.57385e-05, 7.03053e-05, 6.61171e-05, 6.86824e-05, 6.246e-05,   7.25988e-05,
00418         7.11034e-05, 6.24924e-05 };
00419     double D_par[22] ={0.0871504, 0.0956379, 0.117193,  0.118647,  0.127203, 0.0566449, 0.0529198,
00420         0.0642525, 0.0764562, 0.081341, 0.0952263, 0.0987536, 0.0639901, 0.0845994,0.0777062,
00421         0.0823206, 0.0783874, 0.079537, 0.0815792, 0.0849875, 0.0824751,0.0776296 };
00422     double DSqr_par[22] = {0.00759519,  0.0091466,  0.0137341,  0.0140772,  0.0161807, 0.00320864,
00423         0.00280051, 0.00412839, 0.00584555, 0.00661636, 0.00906805, 0.00975227, 0.00409473,
00424         0.00715706, 0.00603826, 0.00677668, 0.00614458, 0.00632613, 0.00665516, 0.00722288,
00425         0.00680214, 0.00602635};
00426 
00427     beta_G = mom/Charge_Mass[Particle];
00428     if(beta_G <0.3) beta_G =0.3;
00429     double bet=beta_G/TMath::Sqrt(beta_G*beta_G+1);
00430     double fterm=TMath::Log(e_Par[2]+1/pow(beta_G,e_Par[4]));
00431     double fitval=e_Par[0]/pow(bet,e_Par[3])*(e_Par[1]-pow(bet,e_Par[3])-fterm);
00432     TGraphErrors *gr1 = new TGraphErrors(22,Beta_Gamma, K_par,0,0);
00433     TGraphErrors *gr2 = new TGraphErrors(22,Beta_Gamma, DSqr_par,0,0);
00434 
00435     double par[3];
00436     par[0] = fitval;
00437     par[1] = gr1->Eval(m_theta);
00438     par[2] = gr2->Eval(m_theta);
00439     Double_t y = fabs(cos(m_theta));
00440     double electron_par[3] ={334.032, 6.20658e-05, 0.00525673};
00441     double arg= TMath::Sqrt(y*y+ par[2]);
00442     //double cal_factor =par[0]*TMath::Exp(-(par[1]* par[0])/arg);
00443     double cal_factor =TMath::Exp(-(par[1]* par[0])/arg);
00444     double arg_electron = TMath::Sqrt(y*y + electron_par[2]);
00445     //double electron_factor = electron_par[0]*TMath::Exp(-(electron_par[1]* electron_par[0])/arg);
00446     double electron_factor = TMath::Exp(-(electron_par[1]* electron_par[0])/arg_electron);
00447     //cout<<"cal_factor = "<<cal_factor<<"         electron_factor = "<<electron_factor<<endl;
00448     double dedx_cal = dEdx/(cal_factor/electron_factor);
00449     //double dedx_cal = dEdx/cal_factor;
00450     //cout<<"m_theta= "<<m_theta<<"      y ="<<y<<"      beta_G  = "<<beta_G <<"     dEdx = "<<dEdx<<"     cal dedx = "<<dedx_cal<<endl;
00451     delete gr1;
00452     delete gr2;
00453     return dedx_cal; 
00454 }

double Vavilov ( double *  x,
double *  par 
)

Definition at line 41 of file DedxCalibParameters.cxx.

References vavden_(), and vavset_().

Referenced by DedxCalibWireGain::AnalyseHists(), DedxCalibLayerGain::AnalyseHists(), DedxCalibEAng::AnalyseHists(), and DedxCalibDocaEAng::AnalyseHists().

00042 {
00043     double kappa, beta2;
00044     int mode = 0;
00045     vavset_(&par[0], &par[1], &mode);
00046     double fitval = vavden_(&x[0]);
00047     return fitval;
00048 }


Variable Documentation

const double doca_norm[43] [static]

Initial value:

{
    0.585,   0.615,   0.63,   0.61,  0.59,   0.57,  0.565,   0.61,    0.8,  0.855,
    0.8,   0.855,  0.805,  0.845,   0.8,  0.845,  0.785,  0.825,  0.785,  0.815,
    0.765,   0.795,   0.82,  0.855,   0.8,   0.82,   0.86,  0.895,   0.77,  0.805,
    0.83,    0.87,   0.75,   0.78,   0.8,   0.82,    0.8,   0.815,  0.83,   0.87,
    0.77,   0.795,    0.8
}

Definition at line 73 of file DedxCalibParameters.h.

Referenced by DedxCorrecSvc::DocaSinCorrec(), and DedxCalibDocaEAng::FillHists().

const double Eangle_cut_bin[14] = {1, 1, 2, 6, 6, 2, 2, 2, 2, 6, 6, 2, 1, 1} [static]

Definition at line 87 of file DedxCalibParameters.h.

Referenced by DedxCorrecSvc::DocaSinCorrec(), DedxCalibDocaEAng::FillHists(), and DedxCalibDocaEAng::WriteHists().

const double Eangle_value_cut[15] [static]

Initial value:

{-0.25,      -0.06,      -0.04,      -0.03,      -0.02,      -0.01,      -0.005,     0,
    0.005,       0.01,       0.02,       0.03,       0.04,       0.06,        0.25
}

Definition at line 82 of file DedxCalibParameters.h.

Referenced by DedxCorrecSvc::DocaSinCorrec(), DedxCalibDocaEAng::FillHists(), and DedxCalibDocaEAng::WriteHists().

const double HV1_curvep0 = 500.0*0.1165

Definition at line 13 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_curvep1 = 9.404

Definition at line 14 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_curvep2 = 0.009811

Definition at line 15 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_curvep3 = 1.621

Definition at line 16 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_curvep4 = 1.19

Definition at line 17 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_index_nhit = 0.9525

Definition at line 19 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_index_sin = 0

Definition at line 18 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_sigmap0 = 65

Definition at line 20 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_sigmap1 = 57.08

Definition at line 21 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_sigmap2 = 60.03

Definition at line 22 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV1_sigmap3 = -2.747

Definition at line 23 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_curvep0 = 550.0*0.0182604

Definition at line 26 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_curvep1 = 35.0428

Definition at line 27 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_curvep2 = 1.24185e-09

Definition at line 28 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_curvep3 = 2.25831

Definition at line 29 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_curvep4 = 5.81573

Definition at line 30 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_index_nhit = 0.557516

Definition at line 32 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_index_sin = 0.341267

Definition at line 31 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_sigmap0 = 33.0

Definition at line 33 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_sigmap1 = 33.1897

Definition at line 34 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_sigmap2 = 29.3308

Definition at line 35 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double HV2_sigmap3 = -2.11828

Definition at line 36 of file DedxCalibParameters.h.

Referenced by dedx_pid_exp_old().

const double PT0HighCut = 5.0

Definition at line 40 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const double PT0LowCut = 0.05

Definition at line 41 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN0 = 0

Definition at line 3 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN1 = 0

Definition at line 4 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN2 = 5459

Definition at line 5 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN3 = 8093

Definition at line 6 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN4 = 9947

Definition at line 7 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN5 = 11397

Definition at line 8 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN6 = 23455

Definition at line 9 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const long int RUN7 = 25244

Definition at line 10 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const double VR0CUT = 1.0

Definition at line 38 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().

const double VZ0CUT = 10.0

Definition at line 39 of file DedxCalibParameters.h.

Referenced by DedxCalibEvent::genNtuple().


Generated on Tue Nov 29 23:16:43 2016 for BOSS_7.0.2 by  doxygen 1.4.7