]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/AliLnSecondaries.h
B2 analysis code
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / AliLnSecondaries.h
1 #ifndef ALILNSECONDARIES_H
2 #define ALILNSECONDARIES_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // removal of secondaries using DCA distributions
8 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
9
10 #include <TObject.h>
11 #include <TString.h>
12
13 class TString;
14 class TH1D;
15 class TH2D;
16 class RooWorkspace;
17 class RooDataSet;
18 class RooRealVar;
19 class TF1;
20 class TFractionFitter;
21
22 class AliLnSecondaries: public TObject
23 {
24   public:
25         
26         AliLnSecondaries(const TString& particle, const TString& dataFilename, const TString& simuFilename, const TString& outputFilename, const TString& otag);
27         virtual ~AliLnSecondaries();
28         
29         const TString* GetOutputFilename() const { return &fOutputFilename; }
30         
31         Int_t Exec();
32         
33         void SetParticle(const TString& particle) { fParticle = particle; }
34         
35         void SetOutputTag(const TString& tag) { fOutputTag = tag; }
36         
37         void SetCorBins(Int_t lowbin, Int_t hibin) { fLowBin = lowbin; fHiBin = hibin; }
38         void SetDCAxyInterval(Double_t lowdca, Double_t hidca) { fMinDCAxy = lowdca; fMaxDCAxy = hidca; }
39         
40         void SetNBin(Int_t nbin) { fNbin = nbin; }
41         
42         void SetProcedure(Int_t prod) { fFracProc=prod; }
43         void SetMatDCAxyModel(Int_t model) { fMatDCAxyMod = model; }
44         void SetScalingFactors(Double_t mat, Double_t fd) { fScMat=mat; fScFd=fd; }
45         
46         enum { kTFractionFitter=0, kRooFit, kMonteCarlo };
47         enum { kGeantDCAxy=0, kFlatDCAxy, kGaussianDCAxy};
48         
49   private:
50  
51         AliLnSecondaries(const AliLnSecondaries& other);
52         AliLnSecondaries& operator=(const AliLnSecondaries& other);
53         
54         void GetFraction(TH1D* hPrimPt) const;
55         void GetFraction(TH1D* hPrimFracPt, TH1D* hSecFracPt, const TH2D* hDCAxyPt, const TH2D* hMCDCAxyPt, const TH2D* hPrimDCAxyPt, const TH2D* hSecDCAxyPt, const TString& secName) const;
56         void GetFraction(TH1D* hFracPt[3], const TH2D* hDCAxyPt, const TH2D* hMCDCAxyPt, const TH2D* hPrimDCAxyPt, const TH2D* hMatDCAxyPt, const TH2D* hFdwnDCAxyPt) const;
57         
58         Int_t GetTFFfractions(Double_t* frac, Double_t* err, TH1D* hData, TH1D* hPrim, TH1D* hMat, TH1D* hFdwn, Int_t ibin) const;
59         Int_t GetTFFfractions(Double_t* frac, Double_t* err, TH1D* hData, TH1D* hPrim, TH1D* hSec, Int_t ibin, const char* secName) const;
60         
61         void GetRooFitFractions(Double_t* frac, Double_t* err, const TH1D* hData, const TH1D* hPrim, const TH1D* hSec, Int_t ibin, const char* sec) const;
62         void GetRooFitFractions(Double_t* frac, Double_t* err, const TH1D* hData, const TH1D* hPrim, const TH1D* hMat, const TH1D* hFdwn, Int_t ibin) const;
63         
64         TH2D* GetFlatDCAxyPt(Double_t norm, const TH2D* hDCAxyPt, const TString& name) const;
65         //TH2D* GetGaussianDCAxyPt(Double_t norm, Double_t mean, Double_t sigma, const TH2D* hDCAxyPt, const char* name) const;
66         
67         TF1* GetMatFraction(const TString& name) const;
68         TF1* GetFdwnFraction(const TString& name) const;
69         
70         TH1D* ZeroClone(TH1D* h, const char* name) const;
71         void WriteTFFdebug(TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const;
72         
73   private:
74   
75         TString fParticle; // particle
76         
77         TString fDataFilename; // data filename
78         TString fSimuFilename; // simulation filename
79         TString fOutputFilename; // output filename
80         TString fOutputTag; // tag for the ouput
81         
82         Int_t fLowBin; // low bin for the corrections
83         Int_t fHiBin ; // high bin for the corrections
84         
85         Int_t fNbin; // for rebinning DCA distributions
86         
87         Double_t fMinDCAxy; // low DCAxy value
88         Double_t fMaxDCAxy; // high DCAxy value
89         
90         Int_t fFracProc;  // procedure for estimating the fractions
91         Int_t fMatDCAxyMod; // DCAxy model for secondaries from materials
92         
93         Double_t fScMat; // scaling factor for material fraction
94         Double_t fScFd; // scaling factor for feed-down fraction
95         
96         ClassDef(AliLnSecondaries,1)
97 };
98
99 #endif // ALILNSECONDARIES_H