1 #ifndef ALIHFESPECTRUM_H
2 #define ALIHFESPECTRUM_H
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
8 * Contributors are mentioned in the code where appropriate. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
22 // Class for spectrum correction
23 // Subtraction of hadronic background, Unfolding of the data and
24 // Renormalization done here
25 // For more information see the implementation file
36 class AliHFEcontainer;
40 class AliHFEspectrum : public TNamed{
50 AliHFEspectrum(const char* name);
54 Bool_t Init(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const AliHFEcontainer *v0hfecontainer=0x0);
55 Bool_t Correct(Bool_t subtractcontamination=kTRUE);
57 AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE);
59 AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
61 TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0);
62 AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
64 TGraphErrors *Normalize(THnSparse * const spectrum) const;
65 TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const;
67 void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
68 void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type);
70 void SetNumberOfEvents(Int_t nEvents) { fNEvents = nEvents; }
71 void SetMCEffStep(Int_t step) { fStepMC = step; };
72 void SetMCTruthStep(Int_t step) { fStepTrue = step; };
73 void SetStepToCorrect(Int_t step) { fStepData = step; };
74 void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; };
75 void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; };
76 void SetNbDimensions(Int_t nbDimensions) { fNbDimensions = nbDimensions; };
78 void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
79 void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
81 void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; };
83 void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; };
87 AliCFContainer *GetContainer(AliHFEspectrum::CFContainer_t contt);
88 AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1);
89 THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions) const;
90 TObject* GetSpectrum(AliCFContainer * const c, Int_t step);
91 TObject* GetEfficiency(AliCFContainer * const c, Int_t step, Int_t step0);
93 void AddTemporaryObject(TObject *cont);
94 void ClearObject(TObject *o);
96 void CorrectFromTheWidth(TH1D *h1) const;
97 TGraphErrors *NormalizeTH1(TH1 *input) const;
101 AliHFEspectrum(const AliHFEspectrum &);
102 AliHFEspectrum &operator=(const AliHFEspectrum &);
104 TList *fCFContainers; // List of Correction Framework Containers
105 TList *fTemporaryObjects; // Emulate garbage collection
106 THnSparseF *fCorrelation; // Correlation Matrices
107 AliCFDataGrid *fBackground; // Background Grid
109 Bool_t fInclusiveSpectrum; // Inclusive Spectrum
110 Bool_t fDumpToFile; // Write Result in a file
112 Int_t fNbDimensions; // Number of dimensions for the correction
113 Int_t fNEvents; // Number of Events
114 Int_t fStepMC; // MC step (for unfolding)
115 Int_t fStepTrue; // MC step of the final spectrum
116 Int_t fStepData; // Data Step (various applications)
117 Int_t fStepBeforeCutsV0; // Before cuts V0
118 Int_t fStepAfterCutsV0; // After cuts V0
119 Int_t fStepGuessedUnfolding; // Step for first guessed unfolding
120 Int_t fNumberOfIterations; // Number of iterations
122 Int_t fDebugLevel; // Debug Level
124 ClassDef(AliHFEspectrum, 1)