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 ALIHFECORRECTSPECTRUMBASE_H
22 #define ALIHFECORRECTSPECTRUMBASE_H
35 class AliHFEcontainer;
39 class AliHFECorrectSpectrumBase : public TNamed{
46 kMCContainerCharmMC = 4,
47 kMCWeightedContainerNonHFEESD = 5,
48 kMCWeightedContainerConversionESD = 6,
50 kMCWeightedContainerNonHFEESDSig = 8,
51 kMCWeightedContainerConversionESDSig = 9,
52 kPhotonicBackground = 10,
62 AliHFECorrectSpectrumBase(const char* name);
63 ~AliHFECorrectSpectrumBase();
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;};
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;
74 void SetCorrelation(THnSparseF * const correlation) {fCorrelation = correlation; };
75 void SetContainer(AliCFContainer *cont, AliHFECorrectSpectrumBase::CFContainer_t type);
76 void SetEfficiencyFunction(TF1 *efficiencyFunction) { fEfficiencyFunction = efficiencyFunction; };
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; };
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);
105 TObjArray *fCFContainers; // List of Correction Framework Containers
106 THnSparseF *fCorrelation; // Correlation Matrices
107 TF1 *fEfficiencyFunction; // Efficiency Function
109 Bool_t fEtaSelected; // Switch for eta selection
110 Bool_t fSetSmoothing; // Set smoothing
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
123 Int_t fDims[3]; // For 2D corrections
125 Double_t fEtaRange[2]; // Eta range
126 Double_t fEtaRangeNorm[2]; // Eta range used in the normalization
128 Int_t fTestCentralityLow; // To test one bin in centrality only
129 Int_t fTestCentralityHigh; // To test one bin in centrality only
137 ClassDef(AliHFECorrectSpectrumBase, 1)