]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/Nuclei/B2/AliLnSecondaries.h
Include fake tracks in efficiency and templates and remove correction
[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 templates
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) { fLowPtBin = lowbin; fHiPtBin = 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 SetAntiNucleusAsTemplate(Bool_t flag=1) { fANucTemplate = flag; }
44         void SetMatDCAxyModel(Int_t model) { fMatDCAxyMod = model; }
45         void SetScalingFactors(Double_t mat, Double_t fd) { fScMat=mat; fScFd=fd; }
46         
47         void SetAddFakeTracks(Bool_t flag=1) { fAddFakeTracks = flag; }
48         
49         enum { kTFractionFitter=0, kRooFit, kMonteCarlo };
50         enum { kGeantDCAxy=0, kFlatDCAxy};
51         
52   private:
53  
54         AliLnSecondaries(const AliLnSecondaries& other);
55         AliLnSecondaries& operator=(const AliLnSecondaries& other);
56         
57         void GetFraction(TH1D* hPrimPt) const;
58         void GetFraction(TH1D* hPrimFracPt, TH1D* hSecFracPt, const TH2D* hDCAxyPt, const TH2D* hMCDCAxyPt, const TH2D* hPrimDCAxyPt, const TH2D* hSecDCAxyPt, const TString& secName) const;
59         void GetFraction(TH1D* hFracPt[3], const TH2D* hDCAxyPt, const TH2D* hMCDCAxyPt, const TH2D* hPrimDCAxyPt, const TH2D* hMatDCAxyPt, const TH2D* hFdwnDCAxyPt) const;
60         
61         Int_t GetTFFfractions(Double_t* frac, Double_t* err, TH1D* hData, TH1D* hPrim, TH1D* hMat, TH1D* hFdwn, Int_t ibin) const;
62         Int_t GetTFFfractions(Double_t* frac, Double_t* err, TH1D* hData, TH1D* hPrim, TH1D* hSec, Int_t ibin, const TString& secName) const;
63         
64         void GetRooFitFractions(Double_t* frac, Double_t* err, const TH1D* hData, const TH1D* hPrim, const TH1D* hSec, Int_t ibin, const TString& secName) const;
65         void GetRooFitFractions(Double_t* frac, Double_t* err, const TH1D* hData, const TH1D* hPrim, const TH1D* hMat, const TH1D* hFdwn, Int_t ibin) const;
66         
67         TH2D* GetFlatDCAxyPt(Double_t norm, const TH2D* hDCAxyPt, const TString& name) const;
68         
69         TF1* GetMatFraction(const TString& name) const;
70         TF1* GetFdwnFraction(const TString& name) const;
71         
72         TH1D* ZeroClone(const TH1D* h, const TString& name) const;
73         void WriteTFFdebug(const TH1D* hData, TFractionFitter* fit, Int_t status, Int_t ibin, const char* contrib[], Double_t* frac, Int_t kmax) const;
74         
75   private:
76   
77         TString fParticle; // particle
78         
79         TString fDataFilename; // data filename
80         TString fSimuFilename; // simulation filename
81         TString fOutputFilename; // output filename
82         TString fOutputTag; // tag for the ouput
83         
84         Int_t fLowPtBin; // low pt bin for the corrections
85         Int_t fHiPtBin ; // high pt bin for the corrections
86         
87         Int_t fNbin; // for rebinning DCA distributions
88         
89         Double_t fMinDCAxy; // low DCAxy value
90         Double_t fMaxDCAxy; // high DCAxy value
91         
92         Int_t fFracProc;  // procedure for estimating the fractions
93         Int_t fMatDCAxyMod; // DCAxy model for secondaries from materials
94         Bool_t fANucTemplate; // enable antinucleus as template for primaries
95         
96         Double_t fScMat; // scaling factor for material fraction
97         Double_t fScFd; // scaling factor for feed-down fraction
98         
99         Bool_t fAddFakeTracks; // add fake tracks to the templates
100         
101         ClassDef(AliLnSecondaries,1)
102 };
103
104 #endif // ALILNSECONDARIES_H