1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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
21 #ifndef ALIHFESPECTRUM_H
22 #define ALIHFESPECTRUM_H
34 class AliHFEcontainer;
38 class AliHFEspectrum : public TNamed{
46 kNonHFEBackgroundData = 5,
47 kMCContainerCharmMC = 6,
48 kMCContainerConversionMC = 7,
49 kMCContainerNonHFEMC = 8
52 AliHFEspectrum(const char* name);
56 Bool_t Init(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const AliHFEcontainer *v0hfecontainer=0x0, const AliHFEcontainer *bghfecontainer=0x0);
57 Bool_t Correct(Bool_t subtractcontamination=kTRUE);
58 Bool_t CorrectBeauty(Bool_t subtractcontamination=kTRUE);
60 AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE);
62 AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
63 AliCFDataGrid *CorrectParametrizedEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
65 TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0);
66 AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
68 TGraphErrors *Normalize(THnSparse * const spectrum,Int_t i = 0) const;
69 TGraphErrors *Normalize(AliCFDataGrid * const spectrum,Int_t i = 0) const;
70 TGraphErrors *NormalizeTH1N(TH1 *input,Int_t normalization) const;
71 void CorrectFromTheWidth(TH1D *h1) const;
73 void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
74 void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type);
75 void SetEfficiencyFunction(TF1 *efficiencyFunction) { fEfficiencyFunction = efficiencyFunction; };
76 void SetPbPbAnalysis(Bool_t isPbPb = kFALSE) { fBeamType=(Char_t) isPbPb; };
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; };
81 void SetMCEffStep(Int_t step) { fStepMC = step; };
82 void SetMCTruthStep(Int_t step) { fStepTrue = step; };
83 void SetStepToCorrect(Int_t step) { fStepData = step; };
84 void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; };
85 void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; };
86 void SetNbDimensions(Int_t nbDimensions) { fNbDimensions = nbDimensions; };
87 void SetChargeChoosen(Int_t chargechoosen) {fChargeChoosen = chargechoosen; };
88 void SetUnSetCorrelatedErrors(Bool_t unsetcorrelatederrors) {fUnSetCorrelatedErrors = unsetcorrelatederrors;};
89 void SetSmoothing(Bool_t setSmoothing) {fSetSmoothing = setSmoothing;};
91 void SetNCentralityBinAtTheEnd(Int_t nCentralityBinAtTheEnd) {fNCentralityBinAtTheEnd = nCentralityBinAtTheEnd; };
92 void SetLowHighBoundaryCentralityBinAtTheEnd(Int_t low, Int_t high, Int_t i) { fLowBoundaryCentralityBinAtTheEnd[i] = low; fHighBoundaryCentralityBinAtTheEnd[i] = high;};
94 void SetBeautyAnalysis() { fInclusiveSpectrum = kFALSE; };
95 void SetHadronEffbyIPcut(THnSparseF* hsHadronEffbyIPcut) { fHadronEffbyIPcut = hsHadronEffbyIPcut;};
96 void SetNonHFEBackground2ndMethod() { fNonHFEbgMethod2 = kTRUE; };
98 void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
99 void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
101 void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; };
103 void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; };
105 AliCFDataGrid* GetCharmBackground();
106 AliCFDataGrid* GetConversionBackground();
107 AliCFDataGrid* GetNonHFEBackground();
108 THnSparse* GetWeights();
110 void EnableIPanaHadronBgSubtract() { fIPanaHadronBgSubtract = kTRUE; };
111 void EnableIPanaCharmBgSubtract() { fIPanaCharmBgSubtract = kTRUE; };
112 void EnableIPanaConversionBgSubtract() { fIPanaConversionBgSubtract = kTRUE; };
113 void EnableIPanaNonHFEBgSubtract() { fIPanaNonHFEBgSubtract = kTRUE; };
117 AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt);
118 AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1,Int_t positivenegative=-1);
119 THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions) const;
120 TObject* GetSpectrum(const AliCFContainer * const c, Int_t step);
121 TObject* GetEfficiency(const AliCFContainer * const c, Int_t step, Int_t step0);
123 void AddTemporaryObject(TObject *cont);
124 void ClearObject(TObject *o);
126 TGraphErrors *NormalizeTH1(TH1 *input,Int_t i = 0) const;
130 AliHFEspectrum(const AliHFEspectrum &);
131 AliHFEspectrum &operator=(const AliHFEspectrum &);
133 TList *fCFContainers; // List of Correction Framework Containers
134 TList *fTemporaryObjects; // Emulate garbage collection
135 THnSparseF *fCorrelation; // Correlation Matrices
136 AliCFDataGrid *fBackground; // Background Grid
137 TF1 *fEfficiencyFunction; // Efficiency Function
139 THnSparseF *fWeightCharm; // Weight for charm bg
141 Bool_t fInclusiveSpectrum; // Inclusive Spectrum
142 Bool_t fDumpToFile; // Write Result in a file
144 Bool_t fUnSetCorrelatedErrors; // Unset correlated errors
145 Bool_t fSetSmoothing; // Set smoothing
147 Bool_t fIPanaHadronBgSubtract; // Hadron background subtraction
148 Bool_t fIPanaCharmBgSubtract; // Charm background subtraction
149 Bool_t fIPanaConversionBgSubtract; // Conversion background subtraction
150 Bool_t fIPanaNonHFEBgSubtract; // nonHFE except for conversion background subtraction
151 Bool_t fNonHFEbgMethod2; // switch for 2nd method to subtract non HFE background
153 Int_t fNbDimensions; // Number of dimensions for the correction
154 Int_t fNEvents[20]; // Number of Events
155 Int_t fNMCEvents; // Number of MC Events
156 Int_t fNMCbgEvents; // Number of BG MC Events
157 Int_t fStepMC; // MC step (for unfolding)
158 Int_t fStepTrue; // MC step of the final spectrum
159 Int_t fStepData; // Data Step (various applications)
160 Int_t fStepBeforeCutsV0; // Before cuts V0
161 Int_t fStepAfterCutsV0; // After cuts V0
162 Int_t fStepGuessedUnfolding; // Step for first guessed unfolding
163 Int_t fNumberOfIterations; // Number of iterations
164 Int_t fChargeChoosen; // Select positive or negative electrons
166 Int_t fNCentralityBinAtTheEnd; // Number of centrality class at the end
167 Int_t fLowBoundaryCentralityBinAtTheEnd[20]; // Boundary of the bins
168 Int_t fHighBoundaryCentralityBinAtTheEnd[20]; // Boundary of the bins
170 THnSparseF *fHadronEffbyIPcut;// container for hadron efficiency by IP cut
171 Char_t fBeamType; // beamtype; default -1; pp =0; PbPb=1
174 Int_t fDebugLevel; // Debug Level
176 ClassDef(AliHFEspectrum, 1)