]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix product method with <M> and better error messages macros
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Jun 2009 17:47:35 +0000 (17:47 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Jun 2009 17:47:35 +0000 (17:47 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx
PWG2/FLOW/macros/AddTaskFlow.C
PWG2/FLOW/macros/runFlowAnalysis.C
PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C

index d8730d40b28a0517cdd0af0f7003b83fd7e61056..14ecb243339c8f417b61cc71f3f460a13d8c5a6c 100644 (file)
@@ -589,6 +589,10 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto
   SetEventNumber((int)fCommonHists->GetHistMultOrig()->GetEntries());
   //cout<<"number of events processed is "<<fEventNumber<<endl; 
 
+  //Get multiplicity for RP selection
+  Double_t dMultRP = fCommonHists->GetHistMultRP()->GetMean();
+  if (fDebug) cout<<"The average multiplicity is "<<dMultRP<<endl;  
+
   //set the sum of Q vectors
   fQsum->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 = "<<dv<<" and dvplus = "<<dvplus<< " and dvmin = "<<dvmin<<endl;
             
        //fill the histograms
@@ -629,7 +644,8 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto
 
     //get average value of fVtheta = fV
     dV /=iNtheta;
-           
+    if (!fUseSum) { if (dMultRP!=0.){dV /=dMultRP;}} //scale with multiplicity for PRODUCT
+
     //sigma2 and chi 
     Double_t  dSigma2 = 0;
     Double_t  dChi= 0;
@@ -650,7 +666,7 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto
        cout<<"     Lee-Yang Zeroes PRODUCT      "<<endl;}
       cout<<endl;
       cout<<"Chi = "<<dChi<<endl;
-      cout<<endl;
+      //cout<<endl;
     }
           
     // recalculate statistical errors on integrated flow
@@ -821,6 +837,7 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto
 
     //calculate the average of fVtheta = fV
     dV /= iNtheta;
+    if (!fUseSum) { if (dMultRP!=0.) { dV /=dMultRP; }} //scale by the multiplicity for PRODUCT
     if (dV==0.) { cout<<"dV = 0! Leaving LYZ analysis."<<endl; return kFALSE; }
 
     //sigma2 and chi (for statistical error calculations)
@@ -869,7 +886,7 @@ void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHisto
       cout<<endl;
       cout<<"Chi = "<<dChi<<endl;
       cout<<"dV = "<<dV<<" +- "<<dVErr<<endl;
-      cout<<endl;
+      //cout<<endl;
     }
             
     //copy content of profile into TH1D and add error and fill the AliFlowCommonHistResults
@@ -1269,7 +1286,8 @@ TComplex AliFlowAnalysisWithLeeYangZeros::GetGrtheta(AliFlowEventSimple* const a
   
   TComplex cG = TComplex::One();
   Double_t dOrder =  2.;
-  Double_t dWgt = 1./anEvent->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;
index 851d03807aa4d1d86caf873681880ba8e9832a2e..115158aa8da71180eb0f688f6b3bfa161468b4fa 100644 (file)
@@ -100,7 +100,7 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
     cout<<"The input file is "<<inputFileNameLYZ2SUM.Data()<<endl;
     TFile* fInputFileLYZ2SUM = new TFile(inputFileNameLYZ2SUM.Data(),"READ");
     if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->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 "<<inputFileNameLYZ2PROD.Data()<<endl;
     TFile* fInputFileLYZ2PROD = new TFile(inputFileNameLYZ2PROD.Data(),"READ");
     if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->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 "<<inputFileNameLYZEP.Data()<<endl;
     TFile* fInputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ");
     if(!fInputFileLYZEP || fInputFileLYZEP->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);
   }
index 9d2b2c883a2a44efbbc9d1164198d4fc2baaa925..e558fe5a19ba70c897869f3980e06f50b5a9b402 100644 (file)
@@ -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 { 
index 0ec1980f0fe63a84d643264b28cd9c455dedf559..eb9051cf3c33216ea7fab85045cafda4c14e8ad3 100644 (file)
@@ -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 {