1 #ifndef ALICENTRALITYBYFUNCTION_H
2 #define ALICENTRALITYBYFUNCTION_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6 /* Origin: Alberica Toia, CERN, Alberica.Toia@cern.ch */
8 ///////////////////////////////////////////////////////////////////////////////
10 // class to determine centrality percentiles from 2D distributions //
12 ///////////////////////////////////////////////////////////////////////////////
23 class AliCentralityByFunction : public TObject {
27 AliCentralityByFunction();
28 virtual ~AliCentralityByFunction() {}
30 void SetPercentileFile(TString filename) { foutrootfilename = filename; }
31 void SetPercentileCrossSection(Float_t xsec) { fpercentXsec = xsec; }
32 void SetFitFunction(TString distribution, TString func, Double_t xmin, Double_t xmax);
33 void AddHisto(TString name) { fhistnames.push_back(name); }
34 void MakePercentiles(TString infilename);
37 AliCentralityByFunction(const AliCentralityByFunction&);
38 AliCentralityByFunction& operator=(const AliCentralityByFunction&);
40 TFile *finrootfile; // input root file
41 TString foutrootfilename; // output root file name
42 TFile *foutrootfile; // output root file
43 std::vector<TString> fhistnames; // hist names
44 Float_t fpercentXsec; // percentile cross section
45 std::map<TString, TString> fitfunc; // mapping from distribution to fit function name
46 std::map<TString, TF1 *> fitter; // mapping from fit function name to corresponding TF1
48 TH1D *FitHisto(TString hdistributionName);
49 TH1D *MakePercentHisto(TH2D *hist);
51 ClassDef(AliCentralityByFunction, 1)