3 #ifndef ALIMULTIPLICITYCORRECTION_H
4 #define ALIMULTIPLICITYCORRECTION_H
9 // class that contains the correction matrix and the functions for
10 // correction the multiplicity spectrum
24 class AliMultiplicityCorrection : public TNamed {
26 enum EventType { kTrVtx = 0, kMB, kINEL };
27 enum RegularizationType { kNone = 0, kPol0, kPol1, kCurvature, kEntropy };
29 AliMultiplicityCorrection();
30 AliMultiplicityCorrection(const Char_t* name, const Char_t* title);
31 virtual ~AliMultiplicityCorrection();
33 virtual Long64_t Merge(TCollection* list);
35 void FillMeasured(Float_t vtx, Int_t measured05, Int_t measured10, Int_t measured15, Int_t measured20);
36 void FillGenerated(Float_t vtx, Bool_t triggered, Bool_t vertex, Int_t generated05, Int_t generated10, Int_t generated15, Int_t generated20, Int_t generatedAll);
38 void FillCorrection(Float_t vtx, Int_t generated05, Int_t generated10, Int_t generated15, Int_t generated20, Int_t generatedAll, Int_t measured05, Int_t measured10, Int_t measured15, Int_t measured20);
40 Bool_t LoadHistograms(const Char_t* dir);
41 void SaveHistograms();
42 void DrawHistograms();
43 void DrawComparison(const char* name, Int_t inputRange, Bool_t fullPhaseSpace, Bool_t normalizeESD, TH1* mcHist);
45 void ApplyMinuitFit(Int_t inputRange, Bool_t fullPhaseSpace, Bool_t check = kFALSE);
46 void ApplyMinuitFitAll();
47 void SetRegularizationParameters(RegularizationType type, Float_t weight) { fRegularizationType = type; fRegularizationWeight = weight; };
49 void ApplyBayesianMethod(Int_t inputRange, Bool_t fullPhaseSpace, EventType eventType, Float_t regPar = 0.07);
51 void ApplyGaussianMethod(Int_t inputRange, Bool_t fullPhaseSpace);
53 void ApplyLaszloMethod(Int_t inputRange, Bool_t fullPhaseSpace, EventType eventType);
55 TH2F* GetMultiplicityESD(Int_t i) { return fMultiplicityESD[i]; }
56 TH2F* GetMultiplicityVtx(Int_t i) { return fMultiplicityVtx[i]; }
57 TH2F* GetMultiplicityMB(Int_t i) { return fMultiplicityMB[i]; }
58 TH2F* GetMultiplicityINEL(Int_t i) { return fMultiplicityINEL[i]; }
59 TH2F* GetMultiplicityMC(Int_t i, EventType eventType);
60 TH3F* GetCorrelation(Int_t i) { return fCorrelation[i]; }
62 void SetMultiplicityESD(Int_t i, TH2F* hist) { fMultiplicityESD[i] = hist; }
63 void SetMultiplicityVtx(Int_t i, TH2F* hist) { fMultiplicityVtx[i] = hist; }
64 void SetMultiplicityMB(Int_t i, TH2F* hist) { fMultiplicityMB[i] = hist; }
65 void SetMultiplicityINEL(Int_t i, TH2F* hist) { fMultiplicityINEL[i] = hist; }
66 void SetCorrelation(Int_t i, TH3F* hist) { fCorrelation[i] = hist; }
68 void SetGenMeasFromFunc(TF1* inputMC, Int_t id);
69 TH2F* CalculateMultiplicityESD(TH1* inputMC, Int_t correlationMap, Bool_t normalized = kFALSE);
71 TH1F* GetMultiplicityESDCorrected(Int_t i) { return fMultiplicityESDCorrected[i]; }
73 static void NormalizeToBinWidth(TH1* hist);
74 static void NormalizeToBinWidth(TH2* hist);
76 void GetComparisonResults(Float_t& mc, Float_t& residuals);
79 enum { kESDHists = 4, kMCHists = 5, kCorrHists = 8 };
81 static const Int_t fgMaxParams; // number of fit params
83 static Double_t RegularizationPol0(Double_t *params);
84 static Double_t RegularizationPol1(Double_t *params);
85 static Double_t RegularizationTotalCurvature(Double_t *params);
86 static Double_t RegularizationEntropy(Double_t *params);
88 static void MinuitFitFunction(Int_t&, Double_t*, Double_t& chi2, Double_t *params, Int_t);
90 void SetupCurrentHists(Int_t inputRange, Bool_t fullPhaseSpace, EventType eventType);
92 Float_t BayesCovarianceDerivate(Float_t matrixM[251][251], TH2* hResponse, TH1* fCurrentEfficiency, Int_t k, Int_t i, Int_t r, Int_t u);
94 static TH1* fCurrentESD; // static variable to be accessed by MINUIT
95 static TH1* fCurrentCorrelation; // static variable to be accessed by MINUIT
96 static TH1* fCurrentEfficiency; // static variable to be accessed by MINUIT
98 static TMatrixF* fCorrelationMatrix; // contains fCurrentCorrelation in matrix form
99 static TMatrixF* fCorrelationCovarianceMatrix; // contains the errors of fCurrentESD
100 static TVectorF* fCurrentESDVector; // contains fCurrentESD
102 static RegularizationType fRegularizationType; // regularization that is used during Chi2 method
103 static Float_t fRegularizationWeight; // factor for regularization term
105 TH2F* fMultiplicityESD[kESDHists]; // multiplicity histogram: vtx vs multiplicity; array: |eta| < 0.5, 1, 1.5, 2 (0..3)
106 TH2F* fMultiplicityVtx[kMCHists]; // multiplicity histogram of events that have a reconstructed vertex : vtx vs multiplicity; array: |eta| < 0.5, 1, 1.5, 2, inf (0..4)
107 TH2F* fMultiplicityMB[kMCHists]; // multiplicity histogram of triggered events : vtx vs multiplicity; array: |eta| < 0.5, 1, 1.5, 2, inf (0..4)
108 TH2F* fMultiplicityINEL[kMCHists]; // multiplicity histogram of all (inelastic) events : vtx vs multiplicity; array: |eta| < 0.5, 1, 1.5, 2, inf (0..4)
110 TH3F* fCorrelation[kCorrHists]; // vtx vs. (gene multiplicity (trig+vtx)) vs. (meas multiplicity); array: |eta| < 0.5, 1, 1.5, 2 (0..3 and 4..7), the first corrects to the eta range itself, the second to full phase space
111 TH1F* fMultiplicityESDCorrected[kCorrHists]; // corrected histograms
113 Float_t fLastChi2MC; // last Chi2 between MC and unfolded ESD (calculated in DrawComparison)
114 Float_t fLastChi2Residuals; // last Chi2 of the ESD and the folded unfolded ESD (calculated in DrawComparison)
117 AliMultiplicityCorrection(const AliMultiplicityCorrection&);
118 AliMultiplicityCorrection& operator=(const AliMultiplicityCorrection&);
120 ClassDef(AliMultiplicityCorrection, 1);