]>
Commit | Line | Data |
---|---|---|
c04c80e6 | 1 | /************************************************************************** |
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 | // | |
21 | #ifndef ALIHFESPECTRUM_H | |
22 | #define ALIHFESPECTRUM_H | |
23 | ||
24 | #ifndef ROOT_TNamed | |
25 | #include <TNamed.h> | |
26 | #endif | |
27 | ||
28 | class TGraphErrors; | |
29 | class TObject; | |
30 | class TH1; | |
31 | class TList; | |
32 | class AliCFContainer; | |
3a72645a | 33 | class AliHFEcontainer; |
c04c80e6 | 34 | class AliCFDataGrid; |
35 | class AliCFEffGrid; | |
36 | ||
37 | class AliHFEspectrum : public TNamed{ | |
38 | public: | |
39 | enum CFContainer_t{ | |
3a72645a | 40 | kDataContainer = 0, |
41 | kBackgroundData = 1, | |
42 | kMCContainerMC = 2, | |
43 | kMCContainerESD = 3, | |
44 | kDataContainerV0 = 4 | |
c04c80e6 | 45 | }; |
3a72645a | 46 | |
c04c80e6 | 47 | AliHFEspectrum(const char* name); |
48 | ~AliHFEspectrum(); | |
3a72645a | 49 | |
c04c80e6 | 50 | |
3a72645a | 51 | Bool_t Init(AliHFEcontainer *datahfecontainer,AliHFEcontainer *mchfecontainer,AliHFEcontainer *v0hfecontainer=0x0); |
52 | Bool_t Correct(Bool_t subtractcontamination=kTRUE); | |
53 | ||
54 | AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE); | |
55 | ||
56 | AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0); | |
57 | ||
58 | TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0); | |
59 | AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0); | |
60 | ||
c04c80e6 | 61 | TGraphErrors *Normalize(THnSparse * const spectrum) const; |
62 | TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const; | |
3a72645a | 63 | |
c04c80e6 | 64 | void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; }; |
65 | void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type); | |
3a72645a | 66 | |
c04c80e6 | 67 | void SetNumberOfEvents(Int_t nEvents) { fNEvents = nEvents; } |
c04c80e6 | 68 | void SetMCEffStep(Int_t step) { fStepMC = step; }; |
69 | void SetMCTruthStep(Int_t step) { fStepTrue = step; }; | |
70 | void SetStepToCorrect(Int_t step) { fStepData = step; }; | |
3a72645a | 71 | void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; }; |
72 | void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; }; | |
73 | ||
c04c80e6 | 74 | void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; }; |
75 | void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; }; | |
3a72645a | 76 | |
c04c80e6 | 77 | void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; }; |
78 | ||
3a72645a | 79 | void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; }; |
c04c80e6 | 80 | |
81 | protected: | |
3a72645a | 82 | |
c04c80e6 | 83 | AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt); |
3a72645a | 84 | AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1); |
85 | THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions) const; | |
c04c80e6 | 86 | TObject* GetSpectrum(AliCFContainer * const c, Int_t step); |
87 | TObject* GetEfficiency(AliCFContainer * const c, Int_t step, Int_t step0); | |
88 | ||
89 | void AddTemporaryObject(TObject *cont); | |
90 | void ClearObject(TObject *o); | |
91 | ||
92 | void CorrectFromTheWidth(TH1D *h1) const; | |
93 | TGraphErrors *NormalizeTH1(TH1 *input) const; | |
94 | ||
95 | ||
96 | private: | |
97 | AliHFEspectrum(const AliHFEspectrum &); | |
98 | AliHFEspectrum &operator=(const AliHFEspectrum &); | |
99 | ||
100 | TList *fCFContainers; // List of Correction Framework Containers | |
101 | TList *fTemporaryObjects; // Emulate garbage collection | |
102 | THnSparseF *fCorrelation; // Correlation Matrices | |
103 | AliCFDataGrid *fBackground; // Background Grid | |
104 | ||
3a72645a | 105 | Bool_t fInclusiveSpectrum; // Inclusive Spectrum |
c04c80e6 | 106 | Bool_t fDumpToFile; // Write Result in a file |
107 | ||
3a72645a | 108 | Int_t fNbDimensions; // Number of dimensions for the correction |
c04c80e6 | 109 | Int_t fNEvents; // Number of Events |
110 | Int_t fStepMC; // MC step (for unfolding) | |
111 | Int_t fStepTrue; // MC step of the final spectrum | |
112 | Int_t fStepData; // Data Step (various applications) | |
3a72645a | 113 | Int_t fStepBeforeCutsV0; // Before cuts V0 |
114 | Int_t fStepAfterCutsV0; // After cuts V0 | |
c04c80e6 | 115 | Int_t fStepGuessedUnfolding; // Step for first guessed unfolding |
116 | Int_t fNumberOfIterations; // Number of iterations | |
117 | ||
3a72645a | 118 | Int_t fDebugLevel; // Debug Level |
c04c80e6 | 119 | |
120 | ClassDef(AliHFEspectrum, 1) | |
121 | }; | |
122 | #endif | |
123 |