]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/EVCHAR/AliCentralityGlauberFit.h
PWGPP-3, ATO-19 - Reduce size of the space points for alignment (Laser calibration...
[u/mrichter/AliRoot.git] / PWGPP / 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
e6f3f2fe 21class AliCentralityGlauberFit : public TObject {
22
23 public:
24
43b65140 25 AliCentralityGlauberFit(const char * filename);
87dea6ac 26 virtual ~AliCentralityGlauberFit() {}
27
7ac38be6 28 void AddHisto(TString name) { fHistnames.push_back(name); }
29 TH1F *GetGlauberHist() { return fGlauberHist; }
7ac38be6 30 TH1F *GetTempHist() { return fTempHist; }
31 void MakeFits();
3ca96d4d 32 void MakeFitsMinuitNBD(Double_t alpha=-1, Double_t mu=-1, Double_t k=-1);
7ac38be6 33 void SetAncestorMode(Int_t f) { fAncestor=f; }
34 void SetFastFitMode(Int_t f) { fFastFit=f; }
35 void SetGlauberParam(Int_t Nmu, Double_t mulow, Double_t muhigh, Int_t Nk, Double_t klow,
3ca96d4d 36 Double_t khigh, Int_t Nalpha, Double_t alphalow, Double_t alphahigh);
7ac38be6 37 void SetInputFile(TString filename) { fInrootfilename = filename; }
38 void SetInputNtuple(TString ntuplename) { fInntuplename = ntuplename; }
39 void SetAncFile(TString name) { fAncfilename = name; }
40 void SetNevents(Int_t f) { fNevents=f; }
41 void SetNtrials(Int_t f) { fNtrials=f; }
42 void SetOutputFile(TString filename) { fOutrootfilename = filename; }
43 void SetOutputNtuple(TString ntuplename) { fOutntuplename = ntuplename;}
44 void SetRangeToFit(Double_t multmin, Double_t multmax);
3ca96d4d 45 void SetRangeToScale(Double_t scalemin);
7ac38be6 46 void SetRebin(Int_t f) { fRebinFactor=f; }
47 void UseAverage(Bool_t f) { fUseAverage=f; }
48 void UseChi2(Bool_t f) { fUseChi2=f; }
e6f3f2fe 49
50 private:
7ac38be6 51 Int_t fNmu; // mu points
52 Double_t fMulow; // mu low
53 Double_t fMuhigh; // mu high
54 Int_t fNk; // k points
55 Double_t fKlow; // k low
56 Double_t fKhigh; // k high
57 Int_t fNalpha; // alpha points
58 Double_t fAlphalow; // alpha low
59 Double_t fAlphahigh; // alpha high
7ac38be6 60 Int_t fRebinFactor; // rebin factor
3ca96d4d 61 Double_t fScalemin; // mult min where to scale
7ac38be6 62 Double_t fMultmin; // mult min
63 Double_t fMultmax; // mult max
64 TNtuple *fGlauntuple; // glauber ntuple
65 Float_t fNpart; // number participants
66 Float_t fNcoll; // number collisions
67 Float_t fB; // impact parameter
68 Float_t fTaa; // taa
69 Float_t fEffi; // efficiency
70 TH1F *fhEffi; // efficiency histogram
71 TH1F *fTempHist; // Temporary pointer to data histo, to be used in minimization
72 TH1F *fGlauberHist; // Glauber histogram
73 Int_t fFastFit; // If 1 or 2 use cruder approximation to compute curve faster 1:NBD, 2:Gauss
74 Int_t fAncestor; // If 1 use Npart**alpha, if 2 use alpha*Npart + (1-alpha)*Ncoll
75 TF1 * fNBD; // NBD function
76 Bool_t fUseChi2; // If true, use chi2
77 Bool_t fUseAverage; // If true, use average
78 TH1F *fhAncestor; // histo for the ancestor distribution
79 Int_t fNevents; // Number of events to use in the glauber ntuple
80 Int_t fNtrials; // Number of trials to use for the average
81
82 TString fInrootfilename; // input root file
83 TString fInntuplename; // input Gauber ntuple
84 TString fOutrootfilename; // output root file
85 TString fOutntuplename; // output Glauber ntuple
86 TString fAncfilename; // ancestor file name
87 std::vector<TString> fHistnames; // histogram names
87dea6ac 88
3ca96d4d 89 Double_t CalculateChi2(TH1F *hDATA, TH1F *thistGlau);
7ac38be6 90 TH1F *GetTriggerEfficiencyFunction(TH1F *hist1, TH1F *hist2);
91 Double_t GetTriggerEfficiencyIntegral(TH1F *hist1, TH1F *hist2);
3ca96d4d 92 TH1F *GlauberHisto(Double_t mu, Double_t k, Double_t alpha, TH1F *hDATA, Bool_t save=kFALSE);
7ac38be6 93 TH1F *MakeAncestor(Double_t alpha);
3ca96d4d 94 Double_t NBD(Int_t n, Double_t mu, Double_t k) const;
7ac38be6 95 TH1F *NBDhist(Double_t mu, Double_t k);
96 TH1F *NormalizeHisto(TString hdistributionName);
97 void SaveHisto(TH1F *hist1,TH1F *hist2,TH1F *heffi, TFile *outrootfile);
87dea6ac 98
7ac38be6 99 static void MinuitFcnNBD(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
3ca96d4d 100 static Double_t NBDFunc(const Double_t *p, const Double_t * x);
87dea6ac 101
102 AliCentralityGlauberFit(const AliCentralityGlauberFit&);
103 AliCentralityGlauberFit &operator=(const AliCentralityGlauberFit&);
e6f3f2fe 104
e6f3f2fe 105 ClassDef(AliCentralityGlauberFit, 1)
106};
107#endif