1 #ifndef ALICENTRALITYGLAUBERFIT_H
2 #define ALICENTRALITYGLAUBERFIT_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 1D distributions //
12 ///////////////////////////////////////////////////////////////////////////////
21 class AliCentralityGlauberFit : public TObject {
25 AliCentralityGlauberFit(const char * filename);
26 virtual ~AliCentralityGlauberFit() {}
28 void AddHisto(TString name) { fHistnames.push_back(name); }
29 TH1F *GetGlauberHist() { return fGlauberHist; }
31 void SetGlauberParam(Int_t Nk, Double_t klow, Double_t khigh, Int_t Nalpha, Double_t alphalow, Double_t alphahigh,
32 Int_t Nsigma, Double_t sigmalow, Double_t sigmahigh, Int_t Nbog, Double_t boglow, Double_t boghigh,
33 Int_t Ngamma, Double_t gammalow, Double_t gammahigh, Int_t Nsigmap, Double_t sigmaplow, Double_t sigmaphigh);
34 void SetNParam(double a, double b, double c, double d);
35 void SetInputFile(TString filename) { fInrootfilename = filename; }
36 void SetInputNtuple(TString ntuplename) { fInntuplename = ntuplename; }
37 void SetNevents(Int_t f) { fNevents=f; }
38 void SetOutputFile(TString filename) { fOutrootfilename = filename; }
39 void SetOutputNtuple(TString ntuplename) { fOutntuplename = ntuplename;}
40 void SetRangeToFit(Double_t multmin, Double_t multmax);
41 void SetRangeToScale(Double_t scalemin);
42 void SetRebin(Int_t f) { fRebinFactor=f; }
43 void UseChi2(Bool_t f) { fUseChi2=f; }
44 void SetSaturation(Bool_t saturation) {fApplySaturation = saturation;}
45 void SetSaturationParams(Int_t ngray=15, Int_t nblack=28) {fnGraySaturation=ngray; fnBlackSaturation=nblack;}
46 void SetIsZN() {fIsZN=kTRUE;}
47 void SetIsZP() {fIsZN=kFALSE;}
48 void SetNTrials(int ntrials) {fNTrials=ntrials;}
49 void SetChi2Min(double chi2min) {fChi2Min=chi2min;}
52 Int_t fNk; // k points
53 Double_t fKlow; // k low
54 Double_t fKhigh; // k high
55 Int_t fNalpha; // alpha points
56 Double_t fAlphalow; // alpha low
57 Double_t fAlphahigh; // alpha high
58 Int_t fNsigma; // sigma points
59 Double_t fSigmalow; // sigma low
60 Double_t fSigmahigh; // sigma high
61 Int_t fNbog; // bog points
62 Double_t fBoglow; // bog low
63 Double_t fBoghigh; // bog high
64 Int_t fNgamma; // gamma points
65 Double_t fgammalow; // gamma low
66 Double_t fgammahigh; // gamma high
67 Int_t fNsigmap; // sigmap points
68 Double_t fsigmaplow; // sigmap low
69 Double_t fsigmaphigh; // sigmap high
70 Int_t fRebinFactor; // rebin factor
71 Double_t fScalemin; // mult min where to scale
72 Double_t fMultmin; // mult min
73 Double_t fMultmax; // mult max
74 TNtuple *fGlauntuple; // glauber ntuple
75 Float_t fNpart; // number participants
76 Float_t fNcoll; // number collisions
77 Float_t fB; // impact parameter
79 TH1F *fTempHist; // Temporary pointer to data histo, to be used in minimization
80 TH1F *fGlauberHist; // Glauber histogram
81 Bool_t fUseChi2; // If true, use chi2
82 Int_t fNevents; // Number of events to use in the glauber ntuple
83 Bool_t fApplySaturation;
84 Int_t fnGraySaturation;
85 Int_t fnBlackSaturation;
87 Float_t fSDprobability[40];
88 Double_t fParamnSlow[4];
92 TString fInrootfilename; // input root file
93 TString fInntuplename; // input Gauber ntuple
94 TString fOutrootfilename; // output root file
95 TString fOutntuplename; // output Glauber ntuple
96 TString fAncfilename; // ancestor file name
97 std::vector<TString> fHistnames; // histogram names
99 Double_t CalculateChi2(TH1F *hDATA, TH1F *thistGlau);
100 TH1F *GlauberHisto(Double_t k, Double_t alpha, Double_t sigma, Double_t bog, Double_t gamma, Double_t sigmap,
101 TH1F *hDATA, Bool_t save=kFALSE);
102 void SaveHisto(TH1F *hist1,TH1F *hist2, TFile *outrootfile);
103 void MakeSlowNucleons(Int_t fNcoll, Double_t &nbn, Double_t &ngn,Double_t &nbp, Double_t &ngp);
104 void MakeSlowNucleons2(Int_t fNcoll, Double_t bog, Double_t gamma,
105 Double_t &nbn, Double_t &ngn,Double_t &nbp, Double_t &ngp, Double_t &lcp);
106 void MakeSlowNucleons2s(Float_t fNcoll, Double_t bog, Double_t gamma, Double_t sigmap,
107 Double_t &nbn, Double_t &ngn,Double_t &nbp, Double_t &ngp, Double_t &lcp);
108 Double_t ConvertToEnergy(Double_t T);
109 Double_t Maxwell(Double_t m, Double_t p, Double_t T);
111 AliCentralityGlauberFit(const AliCentralityGlauberFit&);
112 AliCentralityGlauberFit &operator=(const AliCentralityGlauberFit&);
114 ClassDef(AliCentralityGlauberFit, 4)