]>
Commit | Line | Data |
---|---|---|
8c1c76e9 | 1 | /************************************************************************** |
c04c80e6 | 2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | // | |
16 | // Class for spectrum correction | |
17 | // Subtraction of hadronic background, Unfolding of the data and | |
18 | // Renormalization done here | |
19 | // For more information see the implementation file | |
20 | // | |
c2690925 | 21 | #ifndef ALIHFESPECTRUM_H |
22 | #define ALIHFESPECTRUM_H | |
23 | ||
c04c80e6 | 24 | #ifndef ROOT_TNamed |
25 | #include <TNamed.h> | |
26 | #endif | |
27 | ||
28 | class TGraphErrors; | |
29 | class TObject; | |
30 | class TH1; | |
c2690925 | 31 | class TF1; |
c04c80e6 | 32 | class TList; |
33 | class AliCFContainer; | |
3a72645a | 34 | class AliHFEcontainer; |
c04c80e6 | 35 | class AliCFDataGrid; |
36 | class AliCFEffGrid; | |
37 | ||
38 | class AliHFEspectrum : public TNamed{ | |
39 | public: | |
40 | enum CFContainer_t{ | |
3a72645a | 41 | kDataContainer = 0, |
42 | kBackgroundData = 1, | |
43 | kMCContainerMC = 2, | |
44 | kMCContainerESD = 3, | |
8c1c76e9 | 45 | kMCContainerCharmMC = 4, |
46 | kMCWeightedContainerNonHFEESD =5, | |
47 | kMCWeightedContainerConversionESD = 6, | |
48 | kDataContainerV0 = 7 | |
49 | }; | |
3a72645a | 50 | |
c04c80e6 | 51 | AliHFEspectrum(const char* name); |
52 | ~AliHFEspectrum(); | |
3a72645a | 53 | |
c04c80e6 | 54 | |
c2690925 | 55 | Bool_t Init(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const AliHFEcontainer *v0hfecontainer=0x0, const AliHFEcontainer *bghfecontainer=0x0); |
3a72645a | 56 | Bool_t Correct(Bool_t subtractcontamination=kTRUE); |
c2690925 | 57 | Bool_t CorrectBeauty(Bool_t subtractcontamination=kTRUE); |
3a72645a | 58 | |
59 | AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE); | |
60 | ||
61 | AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0); | |
c2690925 | 62 | AliCFDataGrid *CorrectParametrizedEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0); |
3a72645a | 63 | |
64 | TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0); | |
65 | AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0); | |
66 | ||
c2690925 | 67 | TGraphErrors *Normalize(THnSparse * const spectrum,Int_t i = 0) const; |
68 | TGraphErrors *Normalize(AliCFDataGrid * const spectrum,Int_t i = 0) const; | |
69 | TGraphErrors *NormalizeTH1N(TH1 *input,Int_t normalization) const; | |
70 | void CorrectFromTheWidth(TH1D *h1) const; | |
8c1c76e9 | 71 | void CorrectStatErr(AliCFDataGrid *backgroundGrid) const; |
3a72645a | 72 | |
c04c80e6 | 73 | void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; }; |
74 | void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type); | |
c2690925 | 75 | void SetEfficiencyFunction(TF1 *efficiencyFunction) { fEfficiencyFunction = efficiencyFunction; }; |
76 | void SetPbPbAnalysis(Bool_t isPbPb = kFALSE) { fBeamType=(Char_t) isPbPb; }; | |
3a72645a | 77 | |
c2690925 | 78 | void SetNumberOfEvents(Int_t nEvents,Int_t i = 0) { fNEvents[i] = nEvents; }; |
79 | void SetNumberOfMCEvents(Int_t nEvents) { fNMCEvents = nEvents; }; | |
80 | void SetNumberOfMC2Events(Int_t nEvents) { fNMCbgEvents = nEvents; }; | |
c04c80e6 | 81 | void SetMCEffStep(Int_t step) { fStepMC = step; }; |
82 | void SetMCTruthStep(Int_t step) { fStepTrue = step; }; | |
83 | void SetStepToCorrect(Int_t step) { fStepData = step; }; | |
3a72645a | 84 | void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; }; |
85 | void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; }; | |
bf892a6a | 86 | void SetNbDimensions(Int_t nbDimensions) { fNbDimensions = nbDimensions; }; |
c2690925 | 87 | void SetChargeChoosen(Int_t chargechoosen) {fChargeChoosen = chargechoosen; }; |
8c1c76e9 | 88 | void SetEtaRange(Double_t etamin, Double_t etamax) { fEtaRange[0] = etamin; fEtaRange[1] = etamax; fEtaSelected = kTRUE; } |
c2690925 | 89 | void SetUnSetCorrelatedErrors(Bool_t unsetcorrelatederrors) {fUnSetCorrelatedErrors = unsetcorrelatederrors;}; |
e156c3bb | 90 | void SetSmoothing(Bool_t setSmoothing) {fSetSmoothing = setSmoothing;}; |
c2690925 | 91 | |
92 | void SetNCentralityBinAtTheEnd(Int_t nCentralityBinAtTheEnd) {fNCentralityBinAtTheEnd = nCentralityBinAtTheEnd; }; | |
93 | void SetLowHighBoundaryCentralityBinAtTheEnd(Int_t low, Int_t high, Int_t i) { fLowBoundaryCentralityBinAtTheEnd[i] = low; fHighBoundaryCentralityBinAtTheEnd[i] = high;}; | |
94 | ||
95 | void SetBeautyAnalysis() { fInclusiveSpectrum = kFALSE; }; | |
96 | void SetHadronEffbyIPcut(THnSparseF* hsHadronEffbyIPcut) { fHadronEffbyIPcut = hsHadronEffbyIPcut;}; | |
97 | void SetNonHFEBackground2ndMethod() { fNonHFEbgMethod2 = kTRUE; }; | |
8c1c76e9 | 98 | void SetNonHFEmode(Int_t mode){ fNonHFEmode = mode; }; |
3a72645a | 99 | |
c04c80e6 | 100 | void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; }; |
101 | void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; }; | |
3a72645a | 102 | |
c04c80e6 | 103 | void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; }; |
104 | ||
3a72645a | 105 | void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; }; |
c04c80e6 | 106 | |
c2690925 | 107 | AliCFDataGrid* GetCharmBackground(); |
108 | AliCFDataGrid* GetConversionBackground(); | |
109 | AliCFDataGrid* GetNonHFEBackground(); | |
8c1c76e9 | 110 | THnSparse* GetCharmWeights(); |
111 | THnSparse* GetBeautyIPEff(); | |
112 | THnSparse* GetCharmEff(); | |
113 | THnSparse* GetPIDxIPEff(Int_t source); | |
c2690925 | 114 | |
115 | void EnableIPanaHadronBgSubtract() { fIPanaHadronBgSubtract = kTRUE; }; | |
116 | void EnableIPanaCharmBgSubtract() { fIPanaCharmBgSubtract = kTRUE; }; | |
117 | void EnableIPanaConversionBgSubtract() { fIPanaConversionBgSubtract = kTRUE; }; | |
118 | void EnableIPanaNonHFEBgSubtract() { fIPanaNonHFEBgSubtract = kTRUE; }; | |
119 | ||
c04c80e6 | 120 | protected: |
3a72645a | 121 | |
c04c80e6 | 122 | AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt); |
c2690925 | 123 | AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1,Int_t positivenegative=-1); |
3a72645a | 124 | THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions) const; |
c2690925 | 125 | TObject* GetSpectrum(const AliCFContainer * const c, Int_t step); |
126 | TObject* GetEfficiency(const AliCFContainer * const c, Int_t step, Int_t step0); | |
c04c80e6 | 127 | |
128 | void AddTemporaryObject(TObject *cont); | |
129 | void ClearObject(TObject *o); | |
130 | ||
c2690925 | 131 | TGraphErrors *NormalizeTH1(TH1 *input,Int_t i = 0) const; |
c04c80e6 | 132 | |
133 | ||
134 | private: | |
135 | AliHFEspectrum(const AliHFEspectrum &); | |
136 | AliHFEspectrum &operator=(const AliHFEspectrum &); | |
137 | ||
138 | TList *fCFContainers; // List of Correction Framework Containers | |
139 | TList *fTemporaryObjects; // Emulate garbage collection | |
140 | THnSparseF *fCorrelation; // Correlation Matrices | |
141 | AliCFDataGrid *fBackground; // Background Grid | |
c2690925 | 142 | TF1 *fEfficiencyFunction; // Efficiency Function |
143 | ||
144 | THnSparseF *fWeightCharm; // Weight for charm bg | |
c04c80e6 | 145 | |
3a72645a | 146 | Bool_t fInclusiveSpectrum; // Inclusive Spectrum |
c04c80e6 | 147 | Bool_t fDumpToFile; // Write Result in a file |
148 | ||
8c1c76e9 | 149 | Bool_t fEtaSelected; // Switch for eta selection |
c2690925 | 150 | Bool_t fUnSetCorrelatedErrors; // Unset correlated errors |
e156c3bb | 151 | Bool_t fSetSmoothing; // Set smoothing |
c2690925 | 152 | |
153 | Bool_t fIPanaHadronBgSubtract; // Hadron background subtraction | |
154 | Bool_t fIPanaCharmBgSubtract; // Charm background subtraction | |
155 | Bool_t fIPanaConversionBgSubtract; // Conversion background subtraction | |
156 | Bool_t fIPanaNonHFEBgSubtract; // nonHFE except for conversion background subtraction | |
157 | Bool_t fNonHFEbgMethod2; // switch for 2nd method to subtract non HFE background | |
8c1c76e9 | 158 | Int_t fNonHFEmode; // choose NonHFE background level (upper, lower, central) |
c2690925 | 159 | |
3a72645a | 160 | Int_t fNbDimensions; // Number of dimensions for the correction |
c2690925 | 161 | Int_t fNEvents[20]; // Number of Events |
162 | Int_t fNMCEvents; // Number of MC Events | |
163 | Int_t fNMCbgEvents; // Number of BG MC Events | |
c04c80e6 | 164 | Int_t fStepMC; // MC step (for unfolding) |
165 | Int_t fStepTrue; // MC step of the final spectrum | |
166 | Int_t fStepData; // Data Step (various applications) | |
3a72645a | 167 | Int_t fStepBeforeCutsV0; // Before cuts V0 |
168 | Int_t fStepAfterCutsV0; // After cuts V0 | |
c04c80e6 | 169 | Int_t fStepGuessedUnfolding; // Step for first guessed unfolding |
170 | Int_t fNumberOfIterations; // Number of iterations | |
c2690925 | 171 | Int_t fChargeChoosen; // Select positive or negative electrons |
172 | ||
8c1c76e9 | 173 | Double_t fEtaRange[2]; // Eta range |
174 | ||
c2690925 | 175 | Int_t fNCentralityBinAtTheEnd; // Number of centrality class at the end |
176 | Int_t fLowBoundaryCentralityBinAtTheEnd[20]; // Boundary of the bins | |
177 | Int_t fHighBoundaryCentralityBinAtTheEnd[20]; // Boundary of the bins | |
178 | ||
179 | THnSparseF *fHadronEffbyIPcut;// container for hadron efficiency by IP cut | |
8c1c76e9 | 180 | TH1D *fConversionEff; // conversion IP cut eff |
181 | TH1D *fNonHFEEff; // nonhfe IP cut eff | |
182 | Char_t fBeamType; // beamtype; default -1; pp =0; PbPb=1 | |
c2690925 | 183 | |
c04c80e6 | 184 | |
3a72645a | 185 | Int_t fDebugLevel; // Debug Level |
c04c80e6 | 186 | |
187 | ClassDef(AliHFEspectrum, 1) | |
188 | }; | |
189 | #endif | |
190 |