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
33 class AliHFEcontainer;
37 class AliHFEspectrum : public TNamed{
47 AliHFEspectrum(const char* name);
51 Bool_t Init(AliHFEcontainer *datahfecontainer,AliHFEcontainer *mchfecontainer,AliHFEcontainer *v0hfecontainer=0x0);
52 Bool_t Correct(Bool_t subtractcontamination=kTRUE);
54 AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE);
56 AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
58 TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0);
59 AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
61 TGraphErrors *Normalize(THnSparse * const spectrum) const;
62 TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const;
64 void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
65 void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type);
67 void SetNumberOfEvents(Int_t nEvents) { fNEvents = nEvents; }
68 void SetMCEffStep(Int_t step) { fStepMC = step; };
69 void SetMCTruthStep(Int_t step) { fStepTrue = step; };
70 void SetStepToCorrect(Int_t step) { fStepData = step; };
71 void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; };
72 void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; };
74 void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
75 void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
77 void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; };
79 void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; };
83 AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt);
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;
86 TObject* GetSpectrum(AliCFContainer * const c, Int_t step);
87 TObject* GetEfficiency(AliCFContainer * const c, Int_t step, Int_t step0);
89 void AddTemporaryObject(TObject *cont);
90 void ClearObject(TObject *o);
92 void CorrectFromTheWidth(TH1D *h1) const;
93 TGraphErrors *NormalizeTH1(TH1 *input) const;
97 AliHFEspectrum(const AliHFEspectrum &);
98 AliHFEspectrum &operator=(const AliHFEspectrum &);
100 TList *fCFContainers; // List of Correction Framework Containers
101 TList *fTemporaryObjects; // Emulate garbage collection
102 THnSparseF *fCorrelation; // Correlation Matrices
103 AliCFDataGrid *fBackground; // Background Grid
105 Bool_t fInclusiveSpectrum; // Inclusive Spectrum
106 Bool_t fDumpToFile; // Write Result in a file
108 Int_t fNbDimensions; // Number of dimensions for the correction
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)
113 Int_t fStepBeforeCutsV0; // Before cuts V0
114 Int_t fStepAfterCutsV0; // After cuts V0
115 Int_t fStepGuessedUnfolding; // Step for first guessed unfolding
116 Int_t fNumberOfIterations; // Number of iterations
118 Int_t fDebugLevel; // Debug Level
120 ClassDef(AliHFEspectrum, 1)