From 6aa973b0d97f0dadded9eb97a58d84ad55533567 Mon Sep 17 00:00:00 2001 From: dgangadh Date: Mon, 2 Sep 2013 12:28:11 +0000 Subject: [PATCH] Coverity fix and FSI lookup fix --- .../Chaoticity/AliThreePionRadii.cxx | 87 +++++++++++-------- .../FEMTOSCOPY/Chaoticity/AliThreePionRadii.h | 7 +- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.cxx b/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.cxx index 33c6da5b05b..5cb2c63e540 100644 --- a/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.cxx +++ b/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.cxx @@ -29,6 +29,7 @@ #include "AliAODInputHandler.h" #include "AliAODMCParticle.h" #include "AliAODTracklets.h" + #include "AliThreePionRadii.h" #define PI 3.1415927 @@ -121,10 +122,16 @@ AliAnalysisTaskSE(), for(Int_t sc=0; scfTracks[i], (fEvt+en2)->fTracks[j])) { + if(!AcceptPair(&((fEvt)->fTracks[i]), &((fEvt+en2)->fTracks[j]))) { fPairSplitCut[0][i]->AddAt('1',j); ((TH1F*)fOutputList->FindObject("fRejectedPairs"))->Fill(qinv12); continue; @@ -1839,7 +1850,7 @@ void AliThreePionRadii::Exec(Option_t *) ArrangeQs(fillIndex3, key1, key2, key3, ch1, ch2, ch3, qinv12MC, qinv13MC, qinv23MC, 1, jj, firstQMC, secondQMC, thirdQMC); if(ch1==ch2 && ch1==ch3){// same charge - WInput = MCWeight3D(kTRUE, jj, 9, firstQMC, secondQMC, thirdQMC); + WInput = MCWeight3D(kTRUE, jj, 10, firstQMC, secondQMC, thirdQMC); if(jj==1) { ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1SC"))->Fill(q3MC, WInput); ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1SCden"))->Fill(q3MC); @@ -1849,10 +1860,10 @@ void AliThreePionRadii::Exec(Option_t *) } }else {// mixed charge if(bin1==bin2) { - WInput = MCWeight3D(kFALSE, jj, 9, firstQMC, secondQMC, thirdQMC); + WInput = MCWeight3D(kFALSE, jj, 10, firstQMC, secondQMC, thirdQMC); }else { - if(jj==1 || jj==5) WInput = MCWeight3D(kFALSE, jj, 9, thirdQMC, secondQMC, firstQMC);// thirdQMC is ss - else WInput = MCWeight3D(kFALSE, 6-jj, 9, thirdQMC, secondQMC, firstQMC); + if(jj==1 || jj==5) WInput = MCWeight3D(kFALSE, jj, 10, thirdQMC, secondQMC, firstQMC);// thirdQMC is ss + else WInput = MCWeight3D(kFALSE, 6-jj, 10, thirdQMC, secondQMC, firstQMC); } if(jj==1){ ((TH1D*)fOutputList->FindObject("fMCWeight3DTerm1MC"))->Fill(q3MC, WInput); @@ -1976,7 +1987,7 @@ void AliThreePionRadii::Exec(Option_t *) if(qinv12 < fQLowerCut) continue;// remove unwanted low-q pairs (also a type of track splitting cut) if(ch1 == ch2){ - if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { + if(!AcceptPair(&((fEvt)->fTracks[i]), &((fEvt+en2)->fTracks[j]))) { fPairSplitCut[1][i]->AddAt('1',j); continue; } @@ -2117,7 +2128,7 @@ void AliThreePionRadii::Exec(Option_t *) ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); if(ch1 == ch2){ - if(!AcceptPair((fEvt)->fTracks[i], (fEvt+en2)->fTracks[j])) { + if(!AcceptPair(&((fEvt)->fTracks[i]), &((fEvt+en2)->fTracks[j]))) { fPairSplitCut[2][i]->AddAt('1',j); continue; } @@ -2170,7 +2181,7 @@ void AliThreePionRadii::Exec(Option_t *) ch2 = Int_t(((fEvt+en2)->fTracks[j].fCharge + 1)/2.); if(ch1 == ch2){ - if(!AcceptPair((fEvt+en1)->fTracks[i], (fEvt+en2)->fTracks[j])) { + if(!AcceptPair(&((fEvt+en1)->fTracks[i]), &((fEvt+en2)->fTracks[j]))) { fPairSplitCut[3][i]->AddAt('1',j); continue; } @@ -2551,16 +2562,16 @@ void AliThreePionRadii::Terminate(Option_t *) } //________________________________________________________________________ -Bool_t AliThreePionRadii::AcceptPair(AliChaoticityTrackStruct first, AliChaoticityTrackStruct second) +Bool_t AliThreePionRadii::AcceptPair(AliChaoticityTrackStruct *first, AliChaoticityTrackStruct *second) { - if(fabs(first.fEta-second.fEta) > fMinSepPairEta) return kTRUE; + if(fabs(first->fEta-second->fEta) > fMinSepPairEta) return kTRUE; // propagate through B field to r=1m - Float_t phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.15/first.fPt);// 0.15 for D=1m + Float_t phi1 = first->fPhi - asin(first->fCharge*(0.1*fBfield)*0.15/first->fPt);// 0.15 for D=1m if(phi1 > 2*PI) phi1 -= 2*PI; if(phi1 < 0) phi1 += 2*PI; - Float_t phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.15/second.fPt);// 0.15 for D=1m + Float_t phi2 = second->fPhi - asin(second->fCharge*(0.1*fBfield)*0.15/second->fPt);// 0.15 for D=1m if(phi2 > 2*PI) phi2 -= 2*PI; if(phi2 < 0) phi2 += 2*PI; @@ -2573,10 +2584,10 @@ Bool_t AliThreePionRadii::AcceptPair(AliChaoticityTrackStruct first, AliChaotici // propagate through B field to r=1.6m - phi1 = first.fPhi - asin(first.fCharge*(0.1*fBfield)*0.24/first.fPt);// mine. 0.24 for D=1.6m + phi1 = first->fPhi - asin(first->fCharge*(0.1*fBfield)*0.24/first->fPt);// mine. 0.24 for D=1.6m if(phi1 > 2*PI) phi1 -= 2*PI; if(phi1 < 0) phi1 += 2*PI; - phi2 = second.fPhi - asin(second.fCharge*(0.1*fBfield)*0.24/second.fPt);// mine. 0.24 for D=1.6m + phi2 = second->fPhi - asin(second->fCharge*(0.1*fBfield)*0.24/second->fPt);// mine. 0.24 for D=1.6m if(phi2 > 2*PI) phi2 -= 2*PI; if(phi2 < 0) phi2 += 2*PI; @@ -2591,19 +2602,19 @@ Bool_t AliThreePionRadii::AcceptPair(AliChaoticityTrackStruct first, AliChaotici // - Int_t ncl1 = first.fClusterMap.GetNbits(); - Int_t ncl2 = second.fClusterMap.GetNbits(); + Int_t ncl1 = first->fClusterMap.GetNbits(); + Int_t ncl2 = second->fClusterMap.GetNbits(); Int_t sumCls = 0; Int_t sumSha = 0; Int_t sumQ = 0; Double_t shfrac = 0; Double_t qfactor = 0; for(Int_t imap = 0; imap < ncl1 && imap < ncl2; imap++) { - if (first.fClusterMap.TestBitNumber(imap) && second.fClusterMap.TestBitNumber(imap)) {// Both clusters - if (first.fSharedMap.TestBitNumber(imap) && second.fSharedMap.TestBitNumber(imap)) { // Shared + if (first->fClusterMap.TestBitNumber(imap) && second->fClusterMap.TestBitNumber(imap)) {// Both clusters + if (first->fSharedMap.TestBitNumber(imap) && second->fSharedMap.TestBitNumber(imap)) { // Shared sumQ++; sumCls+=2; sumSha+=2;} else {sumQ--; sumCls+=2;} } - else if (first.fClusterMap.TestBitNumber(imap) || second.fClusterMap.TestBitNumber(imap)) {// Non shared + else if (first->fClusterMap.TestBitNumber(imap) || second->fClusterMap.TestBitNumber(imap)) {// Non shared sumQ++; sumCls++;} } @@ -3090,10 +3101,10 @@ void AliThreePionRadii::SetFSICorrelations(Bool_t legoCase, TH1D *temp1DSS[10], //________________________________________________________________________ Float_t AliThreePionRadii::FSICorrelation2(Int_t charge1, Int_t charge2, Float_t qinv){ // returns 2-particle Coulomb correlations = K2 - Int_t qbinL = fFSI2SS[fFSIindex]->GetYaxis()->FindBin(qinv-fFSI2SS[fFSIindex]->GetYaxis()->GetBinWidth(1)/2.); + Int_t qbinL = fFSI2SS[fFSIindex]->GetXaxis()->FindBin(qinv-fFSI2SS[fFSIindex]->GetXaxis()->GetBinWidth(1)/2.); Int_t qbinH = qbinL+1; if(qbinL <= 0) return 1.0; - if(qbinH > fFSI2SS[fFSIindex]->GetNbinsY()) return 1.0; + if(qbinH > fFSI2SS[fFSIindex]->GetNbinsX()) return 1.0; Float_t slope=0; if(charge1==charge2){ diff --git a/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.h b/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.h index 3b92992d397..0e1821ea7d5 100644 --- a/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.h +++ b/PWGCF/FEMTOSCOPY/Chaoticity/AliThreePionRadii.h @@ -30,7 +30,6 @@ class AliESDpid; #include "AliESDpid.h" #include "AliAODPid.h" #include "AliChaoticityEventCollection.h" -#include "AliThreePionRadii.h" class AliThreePionRadii : public AliAnalysisTaskSE { public: @@ -92,7 +91,7 @@ class AliThreePionRadii : public AliAnalysisTaskSE { private: void ParInit(); - Bool_t AcceptPair(AliChaoticityTrackStruct, AliChaoticityTrackStruct); + Bool_t AcceptPair(AliChaoticityTrackStruct*, AliChaoticityTrackStruct*); Float_t GamovFactor(Int_t, Int_t, Float_t); void Shuffle(Int_t*, Int_t, Int_t); Short_t FillIndex2part(Short_t); @@ -127,9 +126,6 @@ class AliThreePionRadii : public AliAnalysisTaskSE { // histogram structures struct St6 { - TH1D *fExplicit3; //! - TH1D *fNormEx3; //! - // TH1D *fNorm3; //! TH3D *fTerms3; //! TH1D *fTermsQ3; //! @@ -139,7 +135,6 @@ class AliThreePionRadii : public AliAnalysisTaskSE { struct St5 { TH2D *fExplicit2; //! TH2D *fExplicit2QW; //! - TH3D *fExplicit2ThreeD; //! TProfile2D *fAvgP; //! TH2D *fIdeal; //! TH2D *fSmeared; //! -- 2.43.0