StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StdEdxPull.cxx
1 #include "Bichsel.h"
2 #include "StdEdxModel.h"
3 #include "StdEdxPull.h"
4 //________________________________________________________________________________
5 Double_t StdEdxPull::EvalPred(Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) {
6  Double_t dedx_expected = 0;
7  if (! fit) { // I70
8  Double_t dx2 = 1;
9  if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.);
10  dedx_expected = 1.e-6*charge*charge*Bichsel::Instance()->GetI70M(TMath::Log10(betagamma),dx2);
11  } else if ( fit == 1) { // Ifit
12  // dedx_expected = 1.e-6*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(betagamma),dx2));
13  Double_t par[4] = {TMath::Log10(betagamma), 1., (Double_t) charge, mass};
14  dedx_expected = 1.e-6*TMath::Exp(StdEdxModel::instance()->zMP(par,&par[1]));
15  } else { // dNdx_eff
16  // dedx_expected = StdEdxModel::instance()->dNdx(betagamma,charge);
17  dedx_expected = StdEdxModel::instance()->dNdxEff(betagamma,charge, mass);
18  }
19  return dedx_expected;
20 }
21 //________________________________________________________________________________
22 Double_t StdEdxPull::EvalDeV(Double_t dEdx, Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) {
23  return TMath::Log(dEdx/EvalPred(betagamma, fit, charge, mass));
24 }
25 //________________________________________________________________________________
26 Double_t StdEdxPull::Eval(Double_t dEdx, Double_t dEdxError, Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) {
27  return (dEdxError > 0) ? EvalDeV(dEdx, betagamma, fit, charge, mass)/dEdxError : -999;
28 }
29 //________________________________________________________________________________
30 Double_t StdEdxPull::EvalPred2(Double_t betagamma, Double_t dx2, UChar_t fit, Int_t charge) {
31  Double_t dedx_expected = 0;
32  if (! fit) { // I70
33  if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.);
34  dedx_expected = 1.e-6*charge*charge*Bichsel::Instance()->GetI70M(TMath::Log10(betagamma),dx2);
35  } else if ( fit == 1) { // Ifit
36  dedx_expected = 1.e-6*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(betagamma),dx2));
37  } else { // dNdx_eff
38  dedx_expected = StdEdxModel::instance()->dNdx(betagamma,charge);
39  }
40  return dedx_expected;
41 }
42 //________________________________________________________________________________
43 Double_t StdEdxPull::EvalDeV2(Double_t dEdx, Double_t betagamma, Double_t dx2, UChar_t fit, Int_t charge) {
44  return TMath::Log(dEdx/EvalPred2(betagamma, dx2, fit, charge));
45 }
46 //________________________________________________________________________________
47 Double_t StdEdxPull::Eval2(Double_t dEdx, Double_t dEdxError, Double_t betagamma, Double_t dx2, UChar_t fit, Int_t charge) {
48  return (dEdxError > 0) ? EvalDeV2(dEdx, betagamma, dx2, fit, charge)/dEdxError : -999;
49 }