StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Bichsel.cxx
1 #include "Riostream.h"
2 #include "Bichsel.h"
3 #include <assert.h>
4 using namespace std;
5 ClassImp(Bichsel)
6 TString Bichsel::m_Tags[kTotal] = {"P10","Bi","PAI"};
7 dEdxParameterization *Bichsel::m_dEdxParameterizations[kTotal] = {0,0,0};
8 Bichsel* Bichsel::fgBichsel = 0;
9 //________________________________________________________________________________
10 Bichsel::Bichsel(const Char_t *tag, Int_t keep3D) : m_Type(-1), m_Tag(tag), m_dEdxParameterization(0) {
11 
12  for (Int_t k = 0; k < kTotal; k++) if (m_Tag.Contains(m_Tags[k].Data(),TString::kIgnoreCase)) {m_Type = k; break;}
13  assert(m_Type >= 0);
14  if (! m_dEdxParameterizations[m_Type])
15  m_dEdxParameterizations[m_Type] = new dEdxParameterization(m_Tag.Data(), keep3D);
16  m_dEdxParameterization = m_dEdxParameterizations[m_Type];
17  fgBichsel = this;
18 }
19 //________________________________________________________________________________
20 Bichsel *Bichsel::Instance(const Char_t *tag, Int_t keep3D) {
21  if (!fgBichsel) new Bichsel(tag, keep3D);
22  return fgBichsel;
23 }
24 //________________________________________________________________________________
25 void Bichsel::Clean() {
26  for (Int_t k = 0; k < kTotal; k++)
27  if (m_dEdxParameterizations[k]) {
28  delete m_dEdxParameterizations[k];
29  m_dEdxParameterizations[k] = 0;
30  }
31 }
32 //________________________________________________________________________________
33 void Bichsel::Print() {
34  cout << "Bichsel:: " << m_Tag << endl;
35  if (m_dEdxParameterization) m_dEdxParameterization->Print();
36 }
37 // $Id: Bichsel.cxx,v 1.15 2015/12/24 00:16:25 fisyak Exp $
38 // $Log: Bichsel.cxx,v $
39 // Revision 1.15 2015/12/24 00:16:25 fisyak
40 // Add TpcRS model and macros
41 //
Bichsel(const Char_t *tag="P10", Int_t keep3D=0)
last instance
Definition: Bichsel.cxx:10