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