]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFECorrectSpectrumBase.h
Moving the signal function (synchronizing GSI svn and Aliroot ))
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFECorrectSpectrumBase.h
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
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 **************************************************************************/
15 //
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
20 //
21 #ifndef ALIHFECORRECTSPECTRUMBASE_H
22 #define ALIHFECORRECTSPECTRUMBASE_H
23
24 #ifndef ROOT_TNamed
25 #include <TNamed.h>
26 #endif
27
28 class TGraphErrors;
29 class TObject;
30 class TH1;
31 class TF1;
32 class TList;
33 class TObjArray;
34 class AliCFContainer;
35 class AliHFEcontainer;
36 class AliCFDataGrid;
37 class AliCFEffGrid;
38
39 class AliHFECorrectSpectrumBase : public TNamed{
40   public:
41     enum CFContainer_t{
42       kDataContainer = 0,
43       kBackgroundData = 1,
44       kMCContainerMC = 2,
45       kMCContainerESD = 3,
46       kMCContainerCharmMC = 4,
47       kMCWeightedContainerNonHFEESD = 5,
48       kMCWeightedContainerConversionESD = 6,
49       kDataContainerV0 = 7,
50       kMCWeightedContainerNonHFEESDSig = 8,
51       kMCWeightedContainerConversionESDSig = 9,
52       kPhotonicBackground = 10,
53       kNbCFContainers = 11
54     };
55
56     enum Chargetype_t{
57       kNegCharge = -1,
58       kPosCharge = 1,
59       kAllCharge = 0
60     };
61    
62     AliHFECorrectSpectrumBase(const char* name);
63     ~AliHFECorrectSpectrumBase();
64     
65
66     virtual Bool_t Init(const AliHFEcontainer */*datahfecontainer*/, const AliHFEcontainer */*mchfecontainer*/, const AliHFEcontainer */*bghfecontainer*/, const AliHFEcontainer */*v0hfecontainer*/,AliCFContainer */*photoniccontainerD*/) { return kTRUE;};
67     virtual Bool_t Correct(Bool_t /*subtractcontamination*/, Bool_t /*subtractphotonic*/) { return kTRUE;};
68    
69     TGraphErrors *Normalize(THnSparse * const spectrum) const;
70     TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const;
71     TGraphErrors *NormalizeTH1(TH1 *input) const;
72     void CorrectStatErr(AliCFDataGrid *backgroundGrid) const;
73     
74     void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
75     void SetContainer(AliCFContainer *cont, AliHFECorrectSpectrumBase::CFContainer_t type);
76     void SetEfficiencyFunction(TF1 *efficiencyFunction) { fEfficiencyFunction = efficiencyFunction; };
77     
78     void SetNumberOfEvents(Int_t nEvents) { fNEvents = nEvents; };
79     void SetMCEffStep(Int_t step) { fStepMC = step; };
80     void SetMCTruthStep(Int_t step) { fStepTrue = step; };
81     void SetStepToCorrect(Int_t step) { fStepData = step; };
82     void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; };
83     void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; };
84     void SetNbDimensions(Int_t nbDimensions);
85     void SetChargeChoosen(Chargetype_t chargechoosen) {fChargeChoosen = chargechoosen; };
86     void SetEtaRange(Double_t etamin, Double_t etamax) { fEtaRange[0] = etamin; fEtaRange[1] = etamax; fEtaSelected = kTRUE; }
87     void SetDim(Int_t dim0, Int_t dim1=0, Int_t dim2=0) { fDims[0] = dim0; fDims[1] = dim1; fDims[2] = dim2; };
88     void SetSmoothing(Bool_t setSmoothing) {fSetSmoothing = setSmoothing;};
89     void SetTestOneBinCentrality(Double_t centralitymin, Double_t centralitymax) { fTestCentralityLow = centralitymin; fTestCentralityHigh = centralitymax;}
90     void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
91     void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
92     
93     
94
95  protected:
96     AliHFECorrectSpectrumBase(const AliHFECorrectSpectrumBase &ref);
97     AliHFECorrectSpectrumBase &operator=(const AliHFECorrectSpectrumBase &ref);
98     virtual void Copy(TObject &o) const;
99     AliCFContainer *GetContainer(AliHFECorrectSpectrumBase::CFContainer_t contt);
100     AliCFContainer *GetSlicedContainer(AliCFContainer *cont, Int_t ndim, Int_t *dimensions,Int_t source=-1,Chargetype_t charge=kAllCharge,Int_t centralitylow=-1, Int_t centralityhigh=-1, Bool_t doCentralityProjection = kTRUE);
101     THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions,Chargetype_t charge=kAllCharge,Int_t centralitylow=-1, Int_t centralityhigh=-1, Bool_t doCentralityProjection = kTRUE) const;
102     TObject* GetSpectrum(const AliCFContainer * const c, Int_t step);
103     TObject* GetEfficiency(const AliCFContainer * const c, Int_t step, Int_t step0);
104
105     TObjArray *fCFContainers;     // List of Correction Framework Containers
106     THnSparseF *fCorrelation;     // Correlation Matrices
107     TF1 *fEfficiencyFunction;     // Efficiency Function
108    
109     Bool_t fEtaSelected;              // Switch for eta selection
110     Bool_t fSetSmoothing;             // Set smoothing
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     Chargetype_t fChargeChoosen;         // Select positive or negative electrons
122
123     Int_t  fDims[3];               // For 2D corrections
124
125     Double_t fEtaRange[2];        // Eta range 
126     Double_t fEtaRangeNorm[2];    // Eta range used in the normalization
127
128     Int_t fTestCentralityLow;     // To test one bin in centrality only
129     Int_t fTestCentralityHigh;    // To test one bin in centrality only
130       
131
132
133   private:
134    
135  
136    
137     ClassDef(AliHFECorrectSpectrumBase, 1) 
138 };
139 #endif
140