o First Version of TRDnSigma implementation (Xianguo) o still requires some catching...
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtTrackMatchCorrections.h
1 #ifndef ALIANALYSISETTRACKMATCHCORRECTIONS_H
2 #define ALIANALYSISETTRACKMATCHCORRECTIONS_H
3
4
5 #include "TNamed.h"
6 #include "TF1.h"
7 #include "TH2F.h"
8
9 class AliAnalysisEtTrackMatchCorrections : public TNamed
10 {
11
12 public:
13
14 //! Default constructor
15     AliAnalysisEtTrackMatchCorrections();
16
17 //! Constructor
18     AliAnalysisEtTrackMatchCorrections(const TString name, const TF1 &chargedContr, const TF1 &neutralContr, const TF1 &gammaContr, const TF1 &secondaryContr, const TH2F &recoEff, Double_t meanCharged, Double_t meanNeutral, Double_t meanGammas, Double_t meanSecondary);
19
20 //! Copy constructor
21     AliAnalysisEtTrackMatchCorrections(const AliAnalysisEtTrackMatchCorrections &obj);
22
23 //! Destructor
24     virtual ~AliAnalysisEtTrackMatchCorrections();
25
26 //! Assignment operator
27     AliAnalysisEtTrackMatchCorrections& operator=(const AliAnalysisEtTrackMatchCorrections& other);
28
29 // Getters
30
31     TF1 ChargedContr() const {
32         return *fChargedContr;
33     }
34
35     TF1 NeutralContr() const {
36         return *fNeutralContr;
37     }
38
39     TF1 GammaContr() const {
40         return *fGammaContr;
41     }
42
43     TF1 SecondaryContr() const {
44         return *fSecondaryContr;
45     }
46
47     TH2F *TrackMatchingEfficiency() const {
48       return fRecoEff;
49     }
50     
51     Double_t ChargedContr(int mult) const {
52         return fChargedContr->Eval(mult)*fMeanCharged;
53     }
54
55     Double_t NeutralContr(int mult) const {
56         return fNeutralContr->Eval(mult)*fMeanNeutral;
57     }
58
59     Double_t GammaContr(int mult) const {
60         return -fGammaContr->Eval(mult)*fMeanGamma;
61     }
62
63     Double_t SecondaryContr(int mult) const {
64         return fSecondaryContr->Eval(mult)*fMeanSecondary;
65     }
66
67     Double_t TrackMatchingEfficiency(Float_t pT, Int_t cent) const;
68
69
70 // Setters
71
72     void SetChargedcontr(const TF1 &chargedContr) {
73         *fChargedContr = chargedContr;
74     }
75
76     void SetNeutralcontr(const TF1 &neutralContr) {
77         *fNeutralContr = neutralContr;
78     }
79
80     void SetGammacontr(const TF1 &gammaContr) {
81         *fGammaContr = gammaContr;
82     }
83
84     void SetSecondarycontr(const TF1 &secondaryContr) {
85         *fSecondaryContr = secondaryContr;
86     }
87
88     void SetReconstructionEfficiency(const TH2F &recoEff) {
89         *fRecoEff = recoEff;
90     }
91
92     void SetNeutronCorrection(Int_t cb, Double_t val){fNeutronCorrection[cb] = val;}
93     void SetHadronCorrection(Int_t cb, Double_t val){fHadronCorrection[cb] = val;}
94     void SetKaonCorrection(Int_t cb, Double_t val){fKaonCorrection[cb] = val;}
95     void SetSecondaryCorrection(Int_t cb, Double_t val){fSecondaryCorrection[cb] = val;}
96
97     Double_t GetNeutronCorrection(Int_t cb){if(cb>=0 && cb <20){return fNeutronCorrection[cb];}else{return 0.0;}}
98     Double_t GetHadronCorrection(Int_t cb){if(cb>=0 && cb <20){return fHadronCorrection[cb];}else{return 0.0;}}
99     Double_t GetKaonCorrection(Int_t cb){if(cb>=0 && cb <20){return fKaonCorrection[cb];}else{return 0.0;}}
100     Double_t GetSecondaryCorrection(Int_t cb){if(cb>=0 && cb <20){return fSecondaryCorrection[cb];}else{return 0.0;}}
101
102 private:
103
104     // ChargedContr
105     TF1 *fChargedContr;
106     // NeutralContr
107     TF1 *fNeutralContr;
108     // GammaContr
109     TF1 *fGammaContr;   
110     // SecondaryContr
111     TF1 *fSecondaryContr;
112
113     TH2F *fRecoEff;//Reconstruction efficiency, x axis = pT, y axis = multiplicity, z = efficiency
114     
115     // Mean deposited energy from charged particles
116     Double_t fMeanCharged;
117     // Mean deposited energy from neutral particles
118     Double_t fMeanNeutral;
119     // Mean deposited energy from gammas 
120     Double_t fMeanGamma;
121     // Mean deposited energy from secondaries 
122     Double_t fMeanSecondary;
123
124     Double_t fNeutronCorrection[20];//NeutronCorrection
125     Double_t fHadronCorrection[20];//NeutronCorrection
126     Double_t fKaonCorrection[20];//NeutronCorrection
127     Double_t fSecondaryCorrection[20];//NeutronCorrection
128
129     // Prohibited
130 //! Equality operator
131     bool operator==(const AliAnalysisEtTrackMatchCorrections &other) const;
132     ClassDef(AliAnalysisEtTrackMatchCorrections, 2);
133 };
134
135 #endif //ALIANALYSISETTRACKMATCHCORRECTIONS_H
136