From 00731146a16b99a37f49517d2af6fc622f16befa Mon Sep 17 00:00:00 2001 From: snelling Date: Tue, 17 Jun 2008 09:29:32 +0000 Subject: [PATCH] spring cleanup --- PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx | 87 +++++++++---------- PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h | 28 +++--- 2 files changed, 49 insertions(+), 66 deletions(-) diff --git a/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx b/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx index 2e11ba54645..8471b93cb74 100644 --- a/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx +++ b/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx @@ -42,13 +42,9 @@ ClassImp(AliFlowAnalysisWithMCEventPlane) //----------------------------------------------------------------------- AliFlowAnalysisWithMCEventPlane::AliFlowAnalysisWithMCEventPlane(): - fQ(NULL), fQsum(NULL), fQ2sum(0), fEventNumber(0), - fMult(0), - fNbins(0), - fTrack(NULL), fDebug(kFALSE), fHistFileName(0), fHistFile(0), @@ -60,10 +56,6 @@ ClassImp(AliFlowAnalysisWithMCEventPlane) { // Constructor. - // fQ.Set(0.,0.); // flow vector - // fQsum.Set(0.,0.); // flow vector sum - - fQ = new AliFlowVector; // flow vector fQsum = new TVector2; // flow vector sum } @@ -74,7 +66,6 @@ ClassImp(AliFlowAnalysisWithMCEventPlane) AliFlowAnalysisWithMCEventPlane::~AliFlowAnalysisWithMCEventPlane() { //destructor - delete fQ; delete fQsum; } @@ -85,9 +76,9 @@ void AliFlowAnalysisWithMCEventPlane::Init() { //Define all histograms cout<<"---Analysis with the real MC Event Plane---"<SetXTitle("Pt"); fHistProFlow->SetYTitle("v2 (%)"); @@ -110,7 +101,7 @@ void AliFlowAnalysisWithMCEventPlane::Init() { //----------------------------------------------------------------------- -void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t fRP) { +void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t aRP) { //Calculate v2 from the MC reaction plane if (anEvent) { @@ -119,31 +110,31 @@ void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t fCommonHists->FillControlHistograms(anEvent); //get the Q vector from the FlowEvent - *fQ = anEvent->GetQ(); - //cout<<"fQ.Mod() = " << fQ.Mod() << endl; + AliFlowVector vQ = anEvent->GetQ(); + //cout<<"vQ.Mod() = " << vQ.Mod() << endl; //for chi calculation: - *fQsum += *fQ; + *fQsum += vQ; //cout<<"fQsum.Mod() = "<Mod2(); + fQ2sum += vQ.Mod2(); cout<<"fQ2sum = "<Fill(fRP); + fHistRP->Fill(aRP); //calculate flow //loop over the tracks of the event - Int_t fNumberOfTracks = anEvent->NumberOfTracks(); - for (Int_t i=0;iNumberOfTracks(); + for (Int_t i=0;iGetTrack(i) ; - if (fTrack){ - if (fTrack->UseForDifferentialFlow()) { - Double_t fPhi = fTrack->Phi(); - //if (fPhi<0.) fPhi+=2*TMath::Pi(); + AliFlowTrackSimple* pTrack = anEvent->GetTrack(i) ; + if (pTrack){ + if (pTrack->UseForDifferentialFlow()) { + Double_t dPhi = pTrack->Phi(); + //if (dPhi<0.) dPhi+=2*TMath::Pi(); //calculate flow v2: - Double_t fv2 = TMath::Cos(2*(fPhi-fRP)); - Double_t fPt = fTrack->Pt(); + Double_t dv2 = TMath::Cos(2*(dPhi-aRP)); + Double_t dPt = pTrack->Pt(); //fill histogram - fHistProFlow->Fill(fPt,100*fv2); + fHistProFlow->Fill(dPt,100*dv2); } }//track selected }//loop over tracks @@ -159,35 +150,35 @@ void AliFlowAnalysisWithMCEventPlane::Finish() { //*************make histograms etc. if (fDebug) cout<<"AliFlowAnalysisWithMCEventPlane::Terminate()"<GetfHistPtDiff(); - Double_t fV = 0.; - Double_t fErrV = 0.; - Double_t fSum = 0.; - for(Int_t b=0;bGetBinContent(b); - fErrdifcomb = fHistProFlow->GetBinError(b); + dv2pro = fHistProFlow->GetBinContent(b); + dErrdifcomb = fHistProFlow->GetBinError(b); //fill TH1D - fCommonHistsRes->FillDifferentialFlow(b, fv2pro, fErrdifcomb); + fCommonHistsRes->FillDifferentialFlow(b, dv2pro, dErrdifcomb); if (fHistPtDiff){ //integrated flow - Double_t fYield = fHistPtDiff->GetBinContent(b); - fV += fv2pro/100*fYield ; - fSum += fYield; + Double_t dYield = fHistPtDiff->GetBinContent(b); + dV += dv2pro/100*dYield ; + dSum += dYield; //error on integrated flow - fErrV += fYield*fYield*(fErrdifcomb/100)*(fErrdifcomb/100); + dErrV += dYield*dYield*(dErrdifcomb/100)*(dErrdifcomb/100); } } } - fV /= fSum; //because pt distribution should be normalised - fErrV /= fSum*fSum; - fErrV = TMath::Sqrt(fErrV); - cout<<"fV is "<FillIntegratedFlow(fV,fErrV); + dV /= dSum; //because pt distribution should be normalised + dErrV /= dSum*dSum; + dErrV = TMath::Sqrt(dErrV); + cout<<"dV is "<FillIntegratedFlow(dV,dErrV); // write to file fHistFile->Write(); diff --git a/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h b/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h index ea98a104c91..594acf5ff79 100644 --- a/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h +++ b/PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h @@ -40,7 +40,7 @@ class AliFlowAnalysisWithMCEventPlane { virtual ~AliFlowAnalysisWithMCEventPlane(); //destructor void Init(); //defines variables and histograms - void Make(AliFlowEventSimple* anEvent, Double_t fRP); //calculates variables and fills histograms + void Make(AliFlowEventSimple* anEvent, Double_t aRP); //calculates variables and fills histograms void Finish(); //saves histograms void SetDebug(Bool_t kt) { this->fDebug = kt ; } @@ -55,34 +55,26 @@ class AliFlowAnalysisWithMCEventPlane { private: - AliFlowAnalysisWithMCEventPlane(const AliFlowAnalysisWithMCEventPlane& aAnalysis); - AliFlowAnalysisWithMCEventPlane& operator=(const AliFlowAnalysisWithMCEventPlane& aAnalysis); + AliFlowAnalysisWithMCEventPlane(const AliFlowAnalysisWithMCEventPlane& aAnalysis); //copy constructor + AliFlowAnalysisWithMCEventPlane& operator=(const AliFlowAnalysisWithMCEventPlane& aAnalysis); //assignment operator #ifndef __CINT__ - // AliFlowVector fQ; // flow vector - // TVector2 fQsum; // flow vector sum - AliFlowVector* fQ; // flow vector - TVector2* fQsum; // flow vector sum - Double_t fQ2sum; // flow vector sum squared + TVector2* fQsum; // flow vector sum + Double_t fQ2sum; // flow vector sum squared #endif /*__CINT__*/ - Int_t fEventNumber; // event counter - Int_t fMult; // multiplicity - Int_t fNbins; // number of bins - - AliFlowTrackSimple* fTrack ; //! - + Int_t fEventNumber; // event counter Bool_t fDebug ; //! flag for lyz analysis: more print statements TString fHistFileName; //! TFile* fHistFile; //! - AliFlowCommonHist* fCommonHists; //! - AliFlowCommonHistResults* fCommonHistsRes; //! + AliFlowCommonHist* fCommonHists; // + AliFlowCommonHistResults* fCommonHistsRes; // - TProfile* fHistProFlow; //! - TH1F* fHistRP; //! + TProfile* fHistProFlow; // + TH1F* fHistRP; // ClassDef(AliFlowAnalysisWithMCEventPlane,0) // macro for rootcint }; -- 2.43.0