00001 #include "Riostream.h"
00002 #include "Bichsel.h"
00003 #include <assert.h>
00004
00005 ClassImp(Bichsel)
00006 TString Bichsel::m_Tags[kTotal] = {"P10","Bi","PAI"};
00007 dEdxParameterization *Bichsel::m_dEdxParameterizations[kTotal] = {0,0,0};
00008 Bichsel* Bichsel::fgBichsel = 0;
00009
00010 Bichsel::Bichsel(const Char_t *tag, Int_t keep3D) : m_Type(-1), m_Tag(tag), m_dEdxParameterization(0) {
00011
00012 for (Int_t k = 0; k < kTotal; k++) if (m_Tag.Contains(m_Tags[k].Data(),TString::kIgnoreCase)) {m_Type = k; break;}
00013 assert(m_Type >= 0);
00014 if (! m_dEdxParameterizations[m_Type])
00015 m_dEdxParameterizations[m_Type] = new dEdxParameterization(m_Tag.Data(), keep3D);
00016 m_dEdxParameterization = m_dEdxParameterizations[m_Type];
00017 fgBichsel = this;
00018 }
00019
00020 Bichsel *Bichsel::Instance(const Char_t *tag, Int_t keep3D) {
00021 if (!fgBichsel) new Bichsel(tag, keep3D);
00022 return fgBichsel;
00023 }
00024
00025 void Bichsel::Clean() {
00026 for (Int_t k = 0; k < kTotal; k++)
00027 if (m_dEdxParameterizations[k]) {
00028 delete m_dEdxParameterizations[k];
00029 m_dEdxParameterizations[k] = 0;
00030 }
00031 }
00032 #if 0
00033
00034 Double_t Bichsel::GetI70(Double_t log10bg, Double_t log2dx, Int_t kase) {
00035 Double_t Value = m_dEdxParameterization->GetI70(log10bg,log2dx,kase);
00036 #ifdef TOFCORRECTION
00037 Value *= TMath::Exp(TofCorrection(log10bg));
00038 #endif
00039 return Value;
00040 }
00041
00042 Double_t Bichsel::TofCorrection(Double_t log10bg) {
00043 static const Double_t par[6] = {
00044 1.33408e-01,
00045 -4.30665e-01,
00046 1.29081e-01,
00047 -9.94174e-02,
00048 1.70633e-02,
00049 -1.03019e-03,
00050 };
00051 Double_t poverm = TMath::Power(10.,log10bg);
00052 Double_t beta2Inv = 1. + 1./(poverm*poverm);
00053 Double_t value = par[0] + TMath::Log(beta2Inv)*(par[1]+par[2]*TMath::Log(beta2Inv)) +
00054 TMath::Log(poverm)*(par[3] + TMath::Log(poverm)*(par[4] + TMath::Log(poverm)*par[5]));
00055 return value;
00056 }
00057 #endif
00058
00059 void Bichsel::Print() {
00060 cout << "Bichsel:: " << m_Tag << endl;
00061 if (m_dEdxParameterization) m_dEdxParameterization->Print();
00062 }