]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFECorrectSpectrumBase.h
Update of hfe code
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFECorrectSpectrumBase.h
CommitLineData
959ea9d8 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
28class TGraphErrors;
29class TObject;
30class TH1;
31class TF1;
32class TList;
33class TObjArray;
34class AliCFContainer;
35class AliHFEcontainer;
36class AliCFDataGrid;
37class AliCFEffGrid;
38
39class 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 };
51
52 enum Chargetype_t{
53 kNegCharge = -1,
54 kPosCharge = 1,
55 kAllCharge = 0
56 };
57
58 AliHFECorrectSpectrumBase(const char* name);
59 ~AliHFECorrectSpectrumBase();
60
61
62 virtual Bool_t Init(const AliHFEcontainer */*datahfecontainer*/, const AliHFEcontainer */*mchfecontainer*/, const AliHFEcontainer */*v0hfecontainer*/, const AliHFEcontainer */*bghfecontainer*/) { return kTRUE;};
63 virtual Bool_t Correct(Bool_t /*subtractcontamination*/) { return kTRUE;};
64
65 TGraphErrors *Normalize(THnSparse * const spectrum) const;
66 TGraphErrors *Normalize(AliCFDataGrid * const spectrum) const;
67 TGraphErrors *NormalizeTH1(TH1 *input) const;
68 void CorrectFromTheWidth(TH1D *h1) const;
69 void CorrectStatErr(AliCFDataGrid *backgroundGrid) const;
70
71 void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
72 void SetContainer(AliCFContainer *cont, AliHFECorrectSpectrumBase::CFContainer_t type);
73 void SetEfficiencyFunction(TF1 *efficiencyFunction) { fEfficiencyFunction = efficiencyFunction; };
74
75 void SetNumberOfEvents(Int_t nEvents) { fNEvents = nEvents; };
76 void SetMCEffStep(Int_t step) { fStepMC = step; };
77 void SetMCTruthStep(Int_t step) { fStepTrue = step; };
78 void SetStepToCorrect(Int_t step) { fStepData = step; };
79 void SetStepBeforeCutsV0(Int_t step) { fStepBeforeCutsV0 = step; };
80 void SetStepAfterCutsV0(Int_t step) { fStepAfterCutsV0 = step; };
81 void SetNbDimensions(Int_t nbDimensions) { fNbDimensions = nbDimensions; };
82 void SetChargeChoosen(Chargetype_t chargechoosen) {fChargeChoosen = chargechoosen; };
83 void SetEtaRange(Double_t etamin, Double_t etamax) { fEtaRange[0] = etamin; fEtaRange[1] = etamax; fEtaSelected = kTRUE; }
84 void SetSmoothing(Bool_t setSmoothing) {fSetSmoothing = setSmoothing;};
85 void SetTestOneBinCentrality(Double_t centralitymin, Double_t centralitymax) { fTestCentralityLow = centralitymin; fTestCentralityHigh = centralitymax;}
86 void SetStepGuessedUnfolding(Int_t stepGuessedUnfolding) { fStepGuessedUnfolding = stepGuessedUnfolding; };
87 void SetNumberOfIteration(Int_t numberOfIteration) { fNumberOfIterations = numberOfIteration; };
88
89
90
91 protected:
92 AliHFECorrectSpectrumBase(const AliHFECorrectSpectrumBase &ref);
93 AliHFECorrectSpectrumBase &operator=(const AliHFECorrectSpectrumBase &ref);
94 virtual void Copy(TObject &o) const;
95 AliCFContainer *GetContainer(AliHFECorrectSpectrumBase::CFContainer_t contt);
96 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);
97 THnSparseF *GetSlicedCorrelation(THnSparseF *correlationmatrix,Int_t nDim, Int_t *dimensions,Chargetype_t charge=kAllCharge,Int_t centralitylow=-1, Int_t centralityhigh=-1) const;
98 TObject* GetSpectrum(const AliCFContainer * const c, Int_t step);
99 TObject* GetEfficiency(const AliCFContainer * const c, Int_t step, Int_t step0);
100
101 TObjArray *fCFContainers; // List of Correction Framework Containers
102 THnSparseF *fCorrelation; // Correlation Matrices
103 TF1 *fEfficiencyFunction; // Efficiency Function
104
105 Bool_t fEtaSelected; // Switch for eta selection
106 Bool_t fSetSmoothing; // Set smoothing
107
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
117 Chargetype_t fChargeChoosen; // Select positive or negative electrons
118
119 Double_t fEtaRange[2]; // Eta range
120 Double_t fEtaRangeNorm[2]; // Eta range used in the normalization
121
122 Int_t fTestCentralityLow; // To test one bin in centrality only
123 Int_t fTestCentralityHigh; // To test one bin in centrality only
124
125
126
127 private:
128
129
130
131 ClassDef(AliHFECorrectSpectrumBase, 1)
132};
133#endif
134