From 5b40431dea3d0b7e50a48a6c89ecdb27fb2ae14c Mon Sep 17 00:00:00 2001 From: snelling Date: Wed, 3 Jun 2009 17:47:35 +0000 Subject: [PATCH] fix product method with and better error messages macros --- .../AliFlowAnalysisWithLeeYangZeros.cxx | 37 ++++++++++++++----- PWG2/FLOW/macros/AddTaskFlow.C | 14 +++---- PWG2/FLOW/macros/runFlowAnalysis.C | 16 ++++---- PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C | 16 ++++---- 4 files changed, 51 insertions(+), 32 deletions(-) diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx index d8730d40b28..14ecb243339 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx @@ -589,6 +589,10 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto SetEventNumber((int)fCommonHists->GetHistMultOrig()->GetEntries()); //cout<<"number of events processed is "<GetHistMultRP()->GetMean(); + if (fDebug) cout<<"The average multiplicity is "<Set(fHistQsumforChi->GetBinContent(1),fHistQsumforChi->GetBinContent(2)); SetQ2sum(fHistQsumforChi->GetBinContent(3)); @@ -614,10 +618,21 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto Double_t dVmin = -1.; if (dR0+dBinsize!=0.) {dVplus = dJ01/(dR0+dBinsize);} if (dR0-dBinsize!=0.) {dVmin = dJ01/(dR0-dBinsize);} - //convert V to v (normally v = V/M, but here V=v because the Q-vector is scaled by 1/M) - dv = dVtheta; - Double_t dvplus = dVplus; - Double_t dvmin = dVmin; + //convert V to v + Double_t dvplus = -1.; + Double_t dvmin= -1.; + if (fUseSum){ + //for SUM: V=v because the Q-vector is scaled by 1/M + dv = dVtheta; + dvplus = dVplus; + dvmin = dVmin; } + else { + //for PRODUCT: v=V/M + if (dMultRP!=0.){ + dv = dVtheta/dMultRP; + dvplus = dVplus/dMultRP; + dvmin = dVmin/dMultRP; }} + if (fDebug) cout<<"dv = "<GetEventNSelTracksRP(); //weight with the multiplicity + Double_t dWgt = 1.; + //Double_t dWgt = 1./anEvent->GetEventNSelTracksRP(); //weight with the multiplicity Int_t iNumberOfTracks = anEvent->NumberOfTracks(); @@ -1306,7 +1324,8 @@ TComplex AliFlowAnalysisWithLeeYangZeros::GetDiffFlow(AliFlowEventSimple* const TComplex cdGr0(0.,0.); Double_t dOrder = 2.; Double_t dWgt = 1.; - + //Double_t dWgt = 1./anEvent->GetEventNSelTracksRP(); //weight with the multiplicity + Int_t iNumberOfTracks = anEvent->NumberOfTracks(); Int_t iNtheta = AliFlowLYZConstants::kTheta; diff --git a/PWG2/FLOW/macros/AddTaskFlow.C b/PWG2/FLOW/macros/AddTaskFlow.C index 851d03807aa..115158aa8da 100644 --- a/PWG2/FLOW/macros/AddTaskFlow.C +++ b/PWG2/FLOW/macros/AddTaskFlow.C @@ -100,7 +100,7 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA, cout<<"The input file is "<IsZombie()) { - cerr << " ERROR: NO First Run SUM file... " << endl ; + cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; break; } else { @@ -117,7 +117,7 @@ if (LYZ2PROD){ cout<<"The input file is "<IsZombie()) { - cerr << " ERROR: NO First Run PROD file... " << endl ; + cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; break; } else { @@ -135,7 +135,7 @@ if (LYZ2PROD){ cout<<"The input file is "<IsZombie()) { - cerr << " ERROR: NO Second Run file... " << endl ; + cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; break; } else { @@ -173,7 +173,7 @@ if (LYZ2PROD){ AliCFTrackKineCuts* mcKineCuts1 = new AliCFTrackKineCuts("mcKineCuts1","MC-level kinematic cuts"); mcKineCuts1->SetPtRange(ptmin1,ptmax1); mcKineCuts1->SetRapidityRange(ymin1,ymax1); - mcKineCuts1->SetChargeMC(charge1); + //mcKineCuts1->SetChargeMC(charge1); if (QA) { mcKineCuts1->SetQAOn(qaRP); } @@ -181,7 +181,7 @@ if (LYZ2PROD){ AliCFTrackKineCuts* mcKineCuts2 = new AliCFTrackKineCuts("mcKineCuts2","MC-level kinematic cuts"); mcKineCuts2->SetPtRange(ptmin2,ptmax2); mcKineCuts2->SetRapidityRange(ymin2,ymax2); - mcKineCuts2->SetChargeMC(charge2); + //mcKineCuts2->SetChargeMC(charge2); if (QA) { mcKineCuts2->SetQAOn(qaPOI); } @@ -218,7 +218,7 @@ if (LYZ2PROD){ AliCFTrackKineCuts *recKineCuts1 = new AliCFTrackKineCuts("recKineCuts1","rec-level kine cuts"); recKineCuts1->SetPtRange(ptmin1,ptmax1); recKineCuts1->SetRapidityRange(ymin1,ymax1); - recKineCuts1->SetChargeRec(charge1); + //recKineCuts1->SetChargeRec(charge1); if (QA) { recKineCuts1->SetQAOn(qaRP); } @@ -226,7 +226,7 @@ if (LYZ2PROD){ AliCFTrackKineCuts *recKineCuts2 = new AliCFTrackKineCuts("recKineCuts2","rec-level kine cuts"); recKineCuts2->SetPtRange(ptmin2,ptmax2); recKineCuts2->SetRapidityRange(ymin2,ymax2); - recKineCuts2->SetChargeRec(charge2); + //recKineCuts2->SetChargeRec(charge2); if (QA) { recKineCuts2->SetQAOn(qaPOI); } diff --git a/PWG2/FLOW/macros/runFlowAnalysis.C b/PWG2/FLOW/macros/runFlowAnalysis.C index 9d2b2c883a2..e558fe5a19b 100644 --- a/PWG2/FLOW/macros/runFlowAnalysis.C +++ b/PWG2/FLOW/macros/runFlowAnalysis.C @@ -7,15 +7,15 @@ // RUN SETTINGS //flow analysis method can be: (set to kTRUE or kFALSE) Bool_t SP = kTRUE; -Bool_t LYZ1SUM = kFALSE; -Bool_t LYZ1PROD = kFALSE; +Bool_t LYZ1SUM = kTRUE; +Bool_t LYZ1PROD = kTRUE; Bool_t LYZ2SUM = kFALSE; Bool_t LYZ2PROD = kFALSE; -Bool_t LYZEP = kTRUE; +Bool_t LYZEP = kFALSE; Bool_t GFC = kTRUE; Bool_t QC = kTRUE; -Bool_t FQD = kTRUE; -Bool_t MCEP = kTRUE; //does not work yet 24/12/08 +Bool_t FQD = kFALSE; +Bool_t MCEP = kFALSE; //does not work yet 24/12/08 //-------------------------------------------------------------------------------------- // Weights @@ -207,7 +207,7 @@ int runFlowAnalysis(Int_t mode=mLocal, Int_t aRuns = 10, const char* TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis.root" ; TFile* inputFileLYZ2SUM = new TFile(inputFileNameLYZ2SUM.Data(),"READ"); if(!inputFileLYZ2SUM || inputFileLYZ2SUM->IsZombie()) { - cerr << " ERROR: NO First Run SUM file... " << endl ; + cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; break; } else { @@ -228,7 +228,7 @@ int runFlowAnalysis(Int_t mode=mLocal, Int_t aRuns = 10, const char* TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis.root" ; TFile* inputFileLYZ2PROD = new TFile(inputFileNameLYZ2PROD.Data(),"READ"); if(!inputFileLYZ2PROD || inputFileLYZ2PROD->IsZombie()) { - cerr << " ERROR: NO First Run PROD file... " << endl ; + cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; break; } else { @@ -251,7 +251,7 @@ int runFlowAnalysis(Int_t mode=mLocal, Int_t aRuns = 10, const char* TString inputFileNameLYZEP = "outputLYZ2SUManalysis.root" ; TFile* inputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ"); if(!inputFileLYZEP || inputFileLYZEP->IsZombie()) { - cerr << " ERROR: NO Second Run file... " << endl ; + cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; break; } else { diff --git a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C index 0ec1980f0fe..eb9051cf3c3 100644 --- a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C +++ b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C @@ -7,15 +7,15 @@ // RUN SETTINGS // flow analysis method can be: (set to kTRUE or kFALSE) Bool_t SP = kTRUE; -Bool_t LYZ1SUM = kFALSE; -Bool_t LYZ1PROD = kFALSE; +Bool_t LYZ1SUM = kTRUE; +Bool_t LYZ1PROD = kTRUE; Bool_t LYZ2SUM = kFALSE; Bool_t LYZ2PROD = kFALSE; -Bool_t LYZEP = kTRUE; +Bool_t LYZEP = kFALSE; Bool_t GFC = kTRUE; Bool_t QC = kTRUE; -Bool_t FQD = kTRUE; -Bool_t MCEP = kTRUE; +Bool_t FQD = kFALSE; +Bool_t MCEP = kFALSE; //-------------------------------------------------------------------------------------- // Weights @@ -208,7 +208,7 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=10) TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis.root" ; TFile* inputFileLYZ2SUM = new TFile(inputFileNameLYZ2SUM.Data(),"READ"); if(!inputFileLYZ2SUM || inputFileLYZ2SUM->IsZombie()) { - cerr << " ERROR: NO First Run SUM file... " << endl ; + cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; break; } else { @@ -229,7 +229,7 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=10) TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis.root" ; TFile* inputFileLYZ2PROD = new TFile(inputFileNameLYZ2PROD.Data(),"READ"); if(!inputFileLYZ2PROD || inputFileLYZ2PROD->IsZombie()) { - cerr << " ERROR: NO First Run PROD file... " << endl ; + cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; break; } else { @@ -253,7 +253,7 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=10) TString inputFileNameLYZEP = "outputLYZ2SUManalysis.root" ; TFile* inputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ"); if(!inputFileLYZEP || inputFileLYZEP->IsZombie()) { - cerr << " ERROR: NO Second Run file... " << endl ; + cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; break; } else { -- 2.43.0