9 #include "AliHighPtDeDxBase.h"
14 class DeDxFitInfo : public TObject
19 void Print(Option_t* option="") const;
32 TString calibFileName;
34 ClassDef(DeDxFitInfo, 1); // Help class
38 //_____________________________________________________________________________
41 DeDxFitInfo::DeDxFitInfo():
51 // default constructor
52 for(Int_t i = 0; i < 5; i++) {
58 //_________________________________________________________
59 void DeDxFitInfo::Print(Option_t* option) const
62 cout << "Option: " << option << endl;
64 cout << ClassName() << " : " << GetName() << endl
65 << "MIP: " << MIP << endl
66 << "Plateau: " << plateau << endl
67 << "OptionDeDx: " << optionDeDx << endl
68 << "nDeDxPar: " << nDeDxPar << endl;
69 for(Int_t i = 0; i < nDeDxPar; i++) {
71 cout << "parDeDx[" << i << "] = " << parDeDx[i] << endl;
73 cout << "OptionSigma: " << optionSigma << endl
74 << "nSigmaPar: " << nSigmaPar << endl;
75 for(Int_t i = 0; i < nSigmaPar; i++) {
77 cout << "parSigma[" << i << "] = " << parSigma[i] << endl;
80 if(calibFileName.IsNull()) {
81 cout << "No eta calibration file." << endl;
83 cout << "Eta calibration file: " << calibFileName.Data() << endl;
87 //_____________________________________________________________________________
90 AliHighPtDeDxBase* GetObject(TFile* file, Int_t filter, Bool_t phiCut,
91 Int_t run, const Char_t* baseName="filter",
92 const Char_t* endName=0);
94 TFile* FindFileFresh(const Char_t* fileName);
95 TFile* FindFile(const Char_t* fileName);
96 void CutHistogram(TH1* hist, Double_t xMin, Double_t xMax);
97 void SetHistError(TH1* hist, Double_t error);
98 void CreateDir(const Char_t* dirName);
100 //___________________________________________________________________________
101 AliHighPtDeDxBase* GetObject(TFile* file, Int_t filter, Bool_t phiCut, Int_t run,
102 const Char_t* baseName, const Char_t* endName)
104 TString objectName(baseName);
106 objectName += filter;
108 objectName += "phicut";
114 objectName += endName;
116 cout << "Getting object: " << objectName.Data() << endl;
118 return (AliHighPtDeDxBase*)(file->Get(objectName.Data()));
121 //______________________________________________________________________
122 TFile* FindFileFresh(const Char_t* fileName)
125 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fileName);
131 file = TFile::Open(fileName, "READ");
134 cout << "File : " << fileName << " was not found" << endl;
139 //______________________________________________________________________
140 TFile* FindFile(const Char_t* fileName)
143 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(fileName);
148 file = TFile::Open(fileName, "READ");
151 cout << "File : " << fileName << " was not found" << endl;
156 //______________________________________________________________________
157 void CutHistogram(TH1* hist, Double_t xMin, Double_t xMax)
159 const Int_t n = hist->GetNbinsX();
161 for(Int_t bin = 1; bin <= n; bin++) {
163 Float_t x = hist->GetXaxis()->GetBinCenter(bin);
165 hist->SetBinContent(bin, 0);
166 hist->SetBinError(bin, 0);
167 } else if(x > xMax) {
168 hist->SetBinContent(bin, 0);
169 hist->SetBinError(bin, 0);
175 //______________________________________________________________________
176 void SetHistError(TH1* hist, Double_t error)
178 const Int_t n = hist->GetNbinsX();
180 for(Int_t bin = 1; bin <= n; bin++) {
182 // Float_t x = hist->GetXaxis()->GetBinCenter(bin);
183 hist->SetBinError(bin, error);
187 //______________________________________________________________________
188 void CreateDir(const Char_t* dirName)
190 TString pwd(gSystem->pwd());
191 gSystem->cd(pwd.Data());
193 if(gSystem->cd(dirName)) {
194 gSystem->cd(pwd.Data());
196 gSystem->mkdir(dirName, kTRUE); // kTRUE means recursive