]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEspectrum.h
Commented call to AliDebug
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEspectrum.h
1 #ifndef ALIHFESPECTRUM_H
2 #define ALIHFESPECTRUM_H
3
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 *                                                                        *
7 * Author: The ALICE Off-line Project.                                    *
8 * Contributors are mentioned in the code where appropriate.              *
9 *                                                                        *
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 **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
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
26 //
27 #ifndef ROOT_TNamed
28 #include <TNamed.h>
29 #endif
30
31 class TGraphErrors;
32 class TObject;
33 class TH1;
34 class TList;
35 class AliCFContainer;
36 class AliHFEcontainer;
37 class AliCFDataGrid;
38 class AliCFEffGrid;
39
40 class AliHFEspectrum : public TNamed{
41   public:
42     enum CFContainer_t{
43       kDataContainer  = 0,
44       kBackgroundData = 1,
45       kMCContainerMC = 2,
46       kMCContainerESD = 3,
47       kDataContainerV0 = 4
48     };
49    
50     AliHFEspectrum(const char* name);
51     ~AliHFEspectrum();
52     
53
54     Bool_t Init(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const AliHFEcontainer *v0hfecontainer=0x0);
55     Bool_t Correct(Bool_t subtractcontamination=kTRUE);
56    
57     AliCFDataGrid *SubtractBackground(Bool_t setBackground = kFALSE);
58     
59     AliCFDataGrid *CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
60    
61     TList *Unfold(AliCFDataGrid* const bgsubpectrum = 0x0);
62     AliCFDataGrid *CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum = 0x0);
63    
64     TGraphErrors *Normalize(THnSparse * const spectrum) const;
65     TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const;
66     
67     void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
68     void SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type);
69     
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; };
77
78     void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
79     void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
80     
81     void SetDumpToFile(Bool_t dumpToFile) { fDumpToFile=dumpToFile; }; 
82   
83     void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; };
84
85   protected:
86        
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);
92  
93     void AddTemporaryObject(TObject *cont);
94     void ClearObject(TObject *o);
95     
96     void CorrectFromTheWidth(TH1D *h1) const;
97     TGraphErrors *NormalizeTH1(TH1 *input) const;
98
99
100   private:
101     AliHFEspectrum(const AliHFEspectrum &);
102     AliHFEspectrum &operator=(const AliHFEspectrum &);
103  
104     TList *fCFContainers;         // List of Correction Framework Containers
105     TList *fTemporaryObjects;     // Emulate garbage collection
106     THnSparseF *fCorrelation;     // Correlation Matrices
107     AliCFDataGrid *fBackground;   // Background Grid
108
109     Bool_t fInclusiveSpectrum;     // Inclusive Spectrum
110     Bool_t fDumpToFile;           // Write Result in a file
111
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
121
122     Int_t fDebugLevel;            // Debug Level
123
124     ClassDef(AliHFEspectrum, 1) 
125 };
126 #endif
127