Cosmetics
[u/mrichter/AliRoot.git] / PWG2 / EVCHAR / AliCentralityGlauberFit.h
CommitLineData
e6f3f2fe 1#ifndef ALICENTRALITYGLAUBERFIT_H
2#define ALICENTRALITYGLAUBERFIT_H
3
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 */
7
8///////////////////////////////////////////////////////////////////////////////
9// //
10// class to determine centrality percentiles from 1D distributions //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
d20baea6 14#include <vector>
87dea6ac 15#include <TObject.h>
16#include <TString.h>
d20baea6 17
87dea6ac 18class TNtuple;
19class TFile;
20
21//using namespace std;
d20baea6 22
e6f3f2fe 23
24class AliCentralityGlauberFit : public TObject {
25
26 public:
27
d20baea6 28 AliCentralityGlauberFit(const char * filename="../centrality/files/GlauberMC_PbPb_ntuple_sigma64_mind4_r662_a546.root");
87dea6ac 29 virtual ~AliCentralityGlauberFit() {}
30
31 void SetOutputFile(TString filename) { foutrootfilename = filename; }
32 void AddHisto(TString name) { fhistnames.push_back(name); }
33 void MakeFits(TString infilename);
34 void MakeFitsMinuitNBD(TString infilename);
35 Float_t GetPercentileCrossSection() { return fPercentXsec; }
36 void SetGlauberParam(Int_t Nmu, Float_t mulow, Float_t muhigh, Int_t Nk, Float_t klow,
37 Float_t khigh, Int_t Nalpha, Float_t alphalow, Float_t alphahigh,
38 Int_t Neff, Float_t efflow, Float_t effhigh);
39 void SetRangeToFit(Float_t multmin, Float_t multmax);
40 void SetRebin(Int_t f) { fRebinFactor=f; }
41 TH1D *GetTempHist() { return fTempHist; }
42 TH1D *GetGlauberHist() { return fGlauberHist; }
d20baea6 43 static void MinuitFcnNBD(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
e6f3f2fe 44
45 private:
87dea6ac 46 Int_t fNmu; // mu points
47 Float_t fMulow; // mu low
48 Float_t fMuhigh; // mu high
49 Int_t fNk; // k points
50 Float_t fKlow; // k low
51 Float_t fKhigh; // k high
52 Int_t fNalpha; // alpha points
53 Float_t fAlphalow; // alpha low
54 Float_t fAlphahigh; // alpha high
55 Int_t fNeff; // eff points
56 Float_t fEfflow; // eff low
57 Float_t fEffhigh; // eff high
58 Int_t fRebinFactor; // rebin factor
59 Float_t fMultmin; // mult min
60 Float_t fMultmax; // mult max
61 TNtuple *fGlauntuple; // glauber ntuple
62 Float_t fNpart; // number participants
63 Float_t fNcoll; // number collisions
64 Float_t fB; // impact parameter
65 Float_t fTaa; // taa
66 Float_t fEffi; // efficiency
67 TH1D *fhEffi; // efficiency histogram
68 TH1D *fTempHist; // Temporary pointer to data histo, to be used in minimization
69 TH1D *fGlauberHist; // Glauber histogram
70 Int_t fFastFit; // If true, use cruder approximation to compute curve faster
71 TF1 * fNBD; // NBD function
72 Bool_t fUseChi2; // If true, use chi2
73
74 TFile *finrootfile; // input root file
75 TString foutrootfilename; // output root file
76 std::vector<TString> fhistnames; // histogram names
77 Float_t fPercentXsec; // cross section
78
79 TH1D *NormalizeHisto(TString hdistributionName);
80 TH1D *GlauberHisto(Float_t mu, Float_t k, Float_t eff, Float_t alpha, TH1D *hDATA, Bool_t save=kFALSE);
81 Float_t CalculateChi2(TH1D *hDATA, TH1D *thistGlau, Float_t eff);
82 TH1D *GetTriggerEfficiencyFunction(TH1D *hist1, TH1D *hist2);
83 Float_t GetTriggerEfficiencyIntegral(TH1D *hist1, TH1D *hist2);
d20baea6 84 static Double_t NBDFunc(Double_t *p, Double_t * x);
e6f3f2fe 85 Double_t NBD(Int_t n, Double_t mu, Double_t k);
87dea6ac 86 TH1D *NBDhist(Double_t mu, Double_t k);
87 void SaveHisto(TH1D *hist1,TH1D *hist2,TH1D *heffi, TFile *outrootfile);
88
89 AliCentralityGlauberFit(const AliCentralityGlauberFit&);
90 AliCentralityGlauberFit &operator=(const AliCentralityGlauberFit&);
e6f3f2fe 91
e6f3f2fe 92 ClassDef(AliCentralityGlauberFit, 1)
93};
94#endif