o First Version of TRDnSigma implementation (Xianguo) o still requires some catching...
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtTrackMatchCorrections.cxx
CommitLineData
b2c10007 1
2
3#include "AliAnalysisEtTrackMatchCorrections.h"
4
5ClassImp(AliAnalysisEtTrackMatchCorrections);
6
7AliAnalysisEtTrackMatchCorrections::AliAnalysisEtTrackMatchCorrections() : TNamed("TMCorr","TMCorr")
02c62614 8 ,fChargedContr(new TF1)
9 ,fNeutralContr(new TF1)
10 ,fGammaContr(new TF1)
11 ,fSecondaryContr(new TF1)
6a152780 12 ,fRecoEff(0)
b2c10007 13 ,fMeanCharged(0)
14 ,fMeanNeutral(0)
15 ,fMeanGamma(0)
16 ,fMeanSecondary(0)
13ae94ec 17 // ,fNeutronCorrection(0)
18{
f71cec6c 19 //fNeutronCorrection = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
13ae94ec 20 for(int i=0;i<20;i++){
21 fNeutronCorrection[i] = 0.0;
22 fHadronCorrection[i] = 0.0;
23 fKaonCorrection[i] = 0.0;
24 fSecondaryCorrection[i] = 0.0;
25 }
26}
b2c10007 27
6a152780 28AliAnalysisEtTrackMatchCorrections::AliAnalysisEtTrackMatchCorrections(const TString name, const TF1 &chargedContr, const TF1 &neutralContr, const TF1 &gammaContr, const TF1 &secondaryContr, const TH2F &recoEff,
b2c10007 29 Double_t meanCharged, Double_t meanNeutral, Double_t meanGammas, Double_t meanSecondary) : TNamed(name,name)
6a152780 30 ,fChargedContr(new TF1(chargedContr))
31 ,fNeutralContr(new TF1(neutralContr))
32 ,fGammaContr(new TF1(gammaContr))
33 ,fSecondaryContr(new TF1(secondaryContr)) ,fRecoEff(new TH2F(recoEff))
34 //,fRecoEff(0)
35 ,fMeanCharged(meanCharged)
36 ,fMeanNeutral(meanNeutral)
37 ,fMeanGamma(meanGammas)
38 ,fMeanSecondary(meanSecondary)
f71cec6c 39{
11facf1a 40 for(int i=0;i<20;i++){
41 fNeutronCorrection[i] = 0.0;
42 fHadronCorrection[i] = 0.0;
43 fKaonCorrection[i] = 0.0;
44 fSecondaryCorrection[i] = 0.0;
45 }
f71cec6c 46}
b2c10007 47
48//! Copy constructor
49AliAnalysisEtTrackMatchCorrections::AliAnalysisEtTrackMatchCorrections(const AliAnalysisEtTrackMatchCorrections &obj) : TNamed(obj)
02c62614 50 ,fChargedContr(new TF1(*(obj.fChargedContr)))
51 ,fNeutralContr(new TF1(*(obj.fNeutralContr)))
52 ,fGammaContr(new TF1(*(obj.fGammaContr)))
53 ,fSecondaryContr(new TF1(*(obj.fSecondaryContr)))
6a152780 54 ,fRecoEff(new TH2F(*(obj.fRecoEff)))
b2c10007 55 ,fMeanCharged(obj.fMeanCharged)
56 ,fMeanNeutral(obj.fMeanNeutral)
57 ,fMeanGamma(obj.fMeanGamma)
58 ,fMeanSecondary(obj.fMeanSecondary)
59
f71cec6c 60{
61 for(int i=0;i<20;i++){
62 fNeutronCorrection[i] = obj.fNeutronCorrection[i];
63 fHadronCorrection[i] = obj.fHadronCorrection[i];
64 fKaonCorrection[i] = obj.fKaonCorrection[i];
65 fSecondaryCorrection[i] = obj.fSecondaryCorrection[i];
66 }
67}
b2c10007 68
69//! Destructor
70AliAnalysisEtTrackMatchCorrections::~AliAnalysisEtTrackMatchCorrections()
6a152780 71{
72// delete fChargedContr;
73// delete fNeutralContr;
74// delete fGammaContr;
75// delete fSecondaryContr;
76// delete fRecoEff;
77}
b2c10007 78
79//! Assignment operator
80AliAnalysisEtTrackMatchCorrections& AliAnalysisEtTrackMatchCorrections::operator=(const AliAnalysisEtTrackMatchCorrections &other)
81{
82 if (this != &other)
83 {
02c62614 84 *fChargedContr = *(other.fChargedContr);
85 *fNeutralContr = *(other.fNeutralContr);
86 *fGammaContr = *(other.fGammaContr);
6a152780 87 ; *fSecondaryContr = *(other.fSecondaryContr);
b2c10007 88 fMeanCharged = other.fMeanCharged;
89 fMeanNeutral = other.fMeanNeutral;
90 fMeanGamma = other.fMeanGamma;
91 fMeanSecondary = other.fMeanSecondary;
92
93 }
94 return *this;
95}
96
31c813d5 97Double_t AliAnalysisEtTrackMatchCorrections::TrackMatchingEfficiency(Float_t pT, Int_t cent) const{
6a152780 98 Double_t eff = 1.0;
43dd5a38 99 if(fRecoEff) eff = fRecoEff->GetBinContent(fRecoEff->GetXaxis()->FindBin(pT),fRecoEff->GetYaxis()->FindBin(cent));
6a152780 100 //cout <<"eff "<<eff<<endl;
43dd5a38 101 //cout <<"eff "<<eff<<" bin pT "<<fRecoEff->GetXaxis()->FindBin(pT)<<" bin centrality "<<fRecoEff->GetYaxis()->FindBin(cent)<<endl;
ac610b08 102 if(eff>1e-5){return eff;}
103 else{return 1.0;}
6a152780 104}