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