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(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const 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; };
73 void SetNbDimensions(Int_t nbDimensions) { fNbDimensions = nbDimensions; };
75 void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
76 void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
78 void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; };
80 void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; };
84 AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt);
85 AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1);
86 THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions) const;
87 TObject* GetSpectrum(AliCFContainer * const c, Int_t step);
88 TObject* GetEfficiency(AliCFContainer * const c, Int_t step, Int_t step0);
90 void AddTemporaryObject(TObject *cont);
91 void ClearObject(TObject *o);
93 void CorrectFromTheWidth(TH1D *h1) const;
94 TGraphErrors *NormalizeTH1(TH1 *input) const;
98 AliHFEspectrum(const AliHFEspectrum &);
99 AliHFEspectrum &operator=(const AliHFEspectrum &);
101 TList *fCFContainers; // List of Correction Framework Containers
102 TList *fTemporaryObjects; // Emulate garbage collection
103 THnSparseF *fCorrelation; // Correlation Matrices
104 AliCFDataGrid *fBackground; // Background Grid
106 Bool_t fInclusiveSpectrum; // Inclusive Spectrum
107 Bool_t fDumpToFile; // Write Result in a file
109 Int_t fNbDimensions; // Number of dimensions for the correction
110 Int_t fNEvents; // Number of Events
111 Int_t fStepMC; // MC step (for unfolding)
112 Int_t fStepTrue; // MC step of the final spectrum
113 Int_t fStepData; // Data Step (various applications)
114 Int_t fStepBeforeCutsV0; // Before cuts V0
115 Int_t fStepAfterCutsV0; // After cuts V0
116 Int_t fStepGuessedUnfolding; // Step for first guessed unfolding
117 Int_t fNumberOfIterations; // Number of iterations
119 Int_t fDebugLevel; // Debug Level
121 ClassDef(AliHFEspectrum, 1)