more for weigths
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Feb 2009 20:17:41 +0000 (20:17 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Feb 2009 20:17:41 +0000 (20:17 +0000)
PWG2/FLOW/AliAnalysisTaskQCumulants.cxx
PWG2/FLOW/AliFlowAnalysisWithQCumulants.cxx
PWG2/FLOW/AliFlowAnalysisWithQCumulants.h
PWG2/FLOW/AliFlowEventSimpleMaker.cxx
PWG2/FLOW/AliFlowEventSimpleMaker.h
PWG2/FLOW/macros/runFlowAnalysis.C

index 9db89e7..6b4260b 100644 (file)
@@ -30,6 +30,7 @@
 #include "TFile.h"
 #include "TList.h"
 #include "TH1.h"
+#include "TGraph.h"
 #include "TProfile.h"
 #include "TProfile2D.h"
 #include "TProfile3D.h"
@@ -187,7 +188,7 @@ void AliAnalysisTaskQCumulants::CreateOutputObjects()
  
  //analyser
  fQCA = new AliFlowAnalysisWithQCumulants();
- fQCA->CreateOutputObjects();
+ fQCA->Init();
 
  if(fQCA->GetHistList()) 
  {
@@ -351,6 +352,13 @@ void AliAnalysisTaskQCumulants::Terminate(Option_t *)
   //average selected multiplicity (for int. flow) 
   TProfile *AvMult = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlowQC"));
   
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  //                        !!!! to be removed !!!!
+  //profiles containing the Q-vectors from all events 
+  TProfile *qvectorForEachEventX = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorForEachEventX"));
+  TProfile *qvectorForEachEventY = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorForEachEventY"));  
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+    
   //multi-particle correlations calculated from Q-vectors
   TProfile *QCorrelations = dynamic_cast<TProfile*>(fListHistos->FindObject("fQCorrelations"));
   
@@ -384,8 +392,7 @@ void AliAnalysisTaskQCumulants::Terminate(Option_t *)
   TProfile *binnedEta3p2n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin2n1n1nPOI"));
   TProfile *binnedEta3p1n1n2nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f3PerEtaBin1n1n2nPOI"));
   TProfile *binnedEta4p1n1n1n1nPOI = dynamic_cast<TProfile*>(fListHistos->FindObject("f4PerEtaBin1n1n1n1nPOI")); 
-  
-  
+    
   //average values of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, 3rd bin: <(Q_x)^2>, 4th bin: <(Q_y)^2>) 
   TProfile *QVectorComponents = dynamic_cast<TProfile*>(fListHistos->FindObject("fQvectorComponents"));
   
@@ -412,6 +419,11 @@ void AliAnalysisTaskQCumulants::Terminate(Option_t *)
   fQCA->SetCommonHistsResults8th(commonHistRes8th);
  
   fQCA->SetAverageMultiplicity(AvMult);
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  //             !!!! to be removed !!!!
+  fQCA->SetQvectorForEachEventX(qvectorForEachEventX);
+  fQCA->SetQvectorForEachEventY(qvectorForEachEventY);
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   fQCA->SetQCorrelations(QCorrelations);
   fQCA->SetQProduct(QProduct);
   fQCA->SetQVectorComponents(QVectorComponents);
index 9f5bb1a..6a8e541 100644 (file)
@@ -29,6 +29,7 @@
 #include "TChain.h"
 #include "TFile.h"
 #include "TList.h"
+#include "TGraph.h"
 #include "TParticle.h"
 #include "TRandom3.h"
 #include "TStyle.h"
@@ -36,6 +37,9 @@
 #include "TProfile2D.h" 
 #include "TProfile3D.h"
 #include "TMath.h"
+#include "TArrow.h"
+#include "TPaveLabel.h"
+#include "TCanvas.h"
 #include "AliFlowEventSimple.h"
 #include "AliFlowTrackSimple.h"
 #include "AliFlowAnalysisWithQCumulants.h"
@@ -70,6 +74,8 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  fDiffFlowResults2ndOrderQC(NULL),
  fDiffFlowResults4thOrderQC(NULL),
  fCovariances(NULL),
+ fQvectorForEachEventX(NULL),//to be removed
+ fQvectorForEachEventY(NULL),//to be removed
  fQCorrelations(NULL),
  fQProduct(NULL),
  fDirectCorrelations(NULL),
@@ -138,7 +144,14 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  fPtMax(0),
  fnBinsEta(0),
  fEtaMin(0),
- fEtaMax(0)
+ fEtaMax(0),
+ fEventCounter(0),
+ fUsePhiWeights(kFALSE),
+ fUsePtWeights(kFALSE),
+ fUseEtaWeights(kFALSE),
+ fPhiWeights(),
+ fPtWeights(),
+ fEtaWeights()
 {
  //constructor 
  fHistList = new TList(); 
@@ -150,6 +163,11 @@ AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
  fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
  fEtaMin   = AliFlowCommonConstants::GetEtaMin();           
  fEtaMax   = AliFlowCommonConstants::GetEtaMax();
+ //to be improved
+ fPhiWeights.Reset();
+ fPtWeights.Reset();
+ fEtaWeights.Reset();
 }
 
 AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
@@ -160,7 +178,7 @@ AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
 
 //================================================================================================================
 
-void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
+void AliFlowAnalysisWithQCumulants::Init()
 {
  //various output histograms
  //avarage multiplicity 
@@ -219,6 +237,17 @@ void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
  (fCovariances->GetXaxis())->SetBinLabel(6,"Cov(6,8)");
  fHistList->Add(fCovariances);
   
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ //                   !!!! to be removed !!!! 
+ //profile containing the x-components of Q-vectors from all events 
+ fQvectorForEachEventX = new TProfile("fQvectorForEachEventX","x-components of Q-vectors",44000,1,44000,"s");
+ fHistList->Add(fQvectorForEachEventX);
+ //profile containing the y-components of Q-vectors from all events 
+ fQvectorForEachEventY = new TProfile("fQvectorForEachEventY","y-components of Q-vectors",44000,1,44000,"s");
+ fHistList->Add(fQvectorForEachEventY);
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+    
  //multi-particle correlations calculated from Q-vectors
  fQCorrelations = new TProfile("fQCorrelations","multi-particle correlations from Q-vectors",32,0,32,"s");
  //fQCorrelations->SetXTitle("correlations");
@@ -301,7 +330,7 @@ void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
  fPtReq2nRP->SetXTitle("p_{t} [GeV]");
  fPtReq2nRP->SetYTitle("Im[D]");
  //fHistList->Add(fPtReq2nRP);
+
  //fPtImq2nRP
  fPtImq2nRP = new TProfile("fPtImq2nRP","Im[q_2n]",fnBinsPt,fPtMin,fPtMax,"s");
  fPtImq2nRP->SetXTitle("p_{t} [GeV]");
@@ -628,13 +657,39 @@ void AliFlowAnalysisWithQCumulants::CreateOutputObjects()
  f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
  f8pDistribution->SetYTitle("Counts");
  fHistList->Add(f8pDistribution);
-}//end of CreateOutputObjects()
+ //phi weights
+ //fHistList->Add(&fPhiWeights);
+ //pt weights
+ //fHistList->Add(&fPtWeights);
+ //eta weights
+ //fHistList->Add(&fEtaWeights);
+}//end of Init()
 
 //================================================================================================================
 
 void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
 {
- //running over data         
+ //running over data 
+ //set the weights:
+ if(fUsePhiWeights)
+ {
+  anEvent->SetUseWeightsPhi(fUsePhiWeights);
+  anEvent->SetPhiWeights(&fPhiWeights);
+ }
+ if(fUsePtWeights)
+ {
+  anEvent->SetUseWeightsPt(fUsePtWeights);
+  anEvent->SetPtWeights(&fPtWeights);
+ }
+ if(fUseEtaWeights)
+ {
+  anEvent->SetUseWeightsEta(fUseEtaWeights);
+  anEvent->SetEtaWeights(&fEtaWeights);
+ }
+  
  //get the total multiplicity nPrim of event:
  Int_t nPrim = anEvent->NumberOfTracks();//nPrim = RPs + POIs + rest  
 
@@ -653,7 +708,7 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  afvQvector1n.Set(0.,0.);
  afvQvector1n.SetMult(0);
  afvQvector1n=anEvent->GetQ(1*n); 
+
  afvQvector2n.Set(0.,0.);
  afvQvector2n.SetMult(0);
  afvQvector2n=anEvent->GetQ(2*n);                          
@@ -664,7 +719,17 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
  
  afvQvector4n.Set(0.,0.);
  afvQvector4n.SetMult(0);
- afvQvector4n=anEvent->GetQ(4*n);       
+ afvQvector4n=anEvent->GetQ(4*n); 
+            
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ //                        !!!! to be removed !!!!
+ fQvectorForEachEventX->Fill(1.*(++fEventCounter),afvQvector1n.X());
+ fQvectorForEachEventY->Fill(1.*(fEventCounter),afvQvector1n.Y()); 
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+                       
+                                  
+                                                        
  //---------------------------------------------------------------------------------------------------------
  
  //multiplicity of RP particles:
@@ -1872,7 +1937,48 @@ void AliFlowAnalysisWithQCumulants::Finish()
  //calculate the final results
  AliQCumulantsFunctions finalResults(fIntFlowResultsQC,fDiffFlowResults2ndOrderQC,fDiffFlowResults4thOrderQC,fCovariances,fAvMultIntFlowQC,fQvectorComponents,fQCorrelations, fQProduct,fDirectCorrelations,f2PerPtBin1n1nRP,f2PerPtBin2n2nRP,f3PerPtBin2n1n1nRP,f3PerPtBin1n1n2nRP,f4PerPtBin1n1n1n1nRP, f2PerEtaBin1n1nRP,f2PerEtaBin2n2nRP,f3PerEtaBin2n1n1nRP,f3PerEtaBin1n1n2nRP,f4PerEtaBin1n1n1n1nRP,f2PerPtBin1n1nPOI,f2PerPtBin2n2nPOI,f3PerPtBin2n1n1nPOI,f3PerPtBin1n1n2nPOI,f4PerPtBin1n1n1n1nPOI, f2PerEtaBin1n1nPOI,f2PerEtaBin2n2nPOI,f3PerEtaBin2n1n1nPOI,f3PerEtaBin1n1n2nPOI,f4PerEtaBin1n1n1n1nPOI,fCommonHists2nd,fCommonHists4th, fCommonHists6th, fCommonHists8th,fCommonHistsResults2nd, fCommonHistsResults4th,fCommonHistsResults6th,fCommonHistsResults8th);
 
- finalResults.Calculate();  
+ finalResults.Calculate(); 
+ /*
+   
+    
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ //                   !!!! to be removed !!!!  
+ TCanvas* qvectorPlot = new TCanvas("qvectorPlot","Q-vector Plot",1000,1000);
+ qvectorPlot->cd(1);
+ TH1D* style = new TH1D("style","Q-vectors",100,-244,244); 
+ (style->GetYaxis())->SetRangeUser(-244,244);
+ style->Draw();
+  
+ Int_t nBins=fQvectorForEachEventX->GetNbinsX();
+ Double_t qxxx=0.,qyyy=0.;
+ //cout<<"nBins = "<<nBins<<endl;   
+ //cout<<fQvectorForEachEventX->GetBinEntries(4)<<endl;    
+ //cout<<fQvectorForEachEventY->GetBinEntries(4)<<endl;     
+ for(Int_t b=1;b<nBins+1;b++)
+ {
+  if(fQvectorForEachEventX->GetBinEntries(b)==1 && fQvectorForEachEventY->GetBinEntries(b)==1)
+  {
+   qxxx=fQvectorForEachEventX->GetBinContent(b);
+   qyyy=fQvectorForEachEventY->GetBinContent(b);
+   //cout<<qxxx<<" "<<qyyy<<endl;
+   TArrow *qvector = new TArrow(0.0,0.0,qxxx,qyyy,0.0144,"|>");
+   qvector->SetAngle(40);
+   qvector->SetLineWidth(2);
+   qvector->Draw("");
+  }
+ }  
+ //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       
+
+ */        
+                           
 }
 
 //================================================================================================================
index 6edbb3c..45a57c4 100644 (file)
@@ -19,6 +19,7 @@
 class TObjArray;
 class TList;
 class TFile;
+class TGraph;
 
 class TH1;
 class TProfile;
@@ -37,7 +38,7 @@ class AliFlowAnalysisWithQCumulants{
   AliFlowAnalysisWithQCumulants();
   virtual ~AliFlowAnalysisWithQCumulants(); 
   
-  virtual void CreateOutputObjects();
+  virtual void Init();
   virtual void Make(AliFlowEventSimple* anEvent);
   virtual void Finish();
   virtual void WriteHistograms(TString outputFileName);
@@ -86,6 +87,12 @@ class AliFlowAnalysisWithQCumulants{
   void SetAverageMultiplicity(TProfile* const am) {this->fAvMultIntFlowQC = am;};
   TProfile* GetAverageMultiplicity() const {return this->fAvMultIntFlowQC;};
   
+  void SetQvectorForEachEventX(TProfile* const qvfeex) {this->fQvectorForEachEventX = qvfeex;};
+  TProfile* GetQvectorForEachEventX() const {return this->fQvectorForEachEventX;};
+
+  void SetQvectorForEachEventY(TProfile* const qvfeey) {this->fQvectorForEachEventY = qvfeey;};
+  TProfile* GetQvectorForEachEventY() const {return this->fQvectorForEachEventY;};
+        
   void SetQCorrelations(TProfile* const QCorr) {this->fQCorrelations = QCorr;};
   TProfile* GetQCorrelations() const {return this->fQCorrelations;};
   
@@ -157,6 +164,15 @@ class AliFlowAnalysisWithQCumulants{
   
   void SetDirectCorrelations(TProfile* const dc) {this->fDirectCorrelations = dc;};
   TProfile* GetDirectCorrelations() const {return this->fDirectCorrelations;};
+  
+  void SetPhiWeights(TH1F const phiW) { this->fPhiWeights = phiW; this->fUsePhiWeights = kTRUE;};
+  TH1F GetPhiWeights() const { return this->fPhiWeights;};
+  
+  void SetPtWeights(TH1D const ptW) { this->fPtWeights = ptW; ; this->fUsePtWeights = kTRUE;};
+  TH1D GetPtWeights() const { return this->fPtWeights;};
+  
+  void SetEtaWeights(TH1D const etaW) { this->fEtaWeights = etaW; ; this->fUseEtaWeights = kTRUE;};
+  TH1D GetEtaWeights() const { return this->fEtaWeights;};
 //----------------------------------------------------------------------------------------------------------------
  
  private:
@@ -174,6 +190,8 @@ class AliFlowAnalysisWithQCumulants{
   TH1D*               fDiffFlowResults4thOrderQC;       //differential flow results from 4th order Q-cumulant
   TH1D*               fCovariances;                     //final results for covariances: 1st bin: <2*4>-<2>*<4>, 2nd bin: <2*6>-<2>*<6>, ...
   
+  TProfile*                  fQvectorForEachEventX;     //profile containing the x-components of Q-vectors from all events (to be removed)  
+  TProfile*                  fQvectorForEachEventY;     //profile containing the y-components of Q-vectors from all events (to be removed)   
   TProfile*                  fQCorrelations;            //multi-particle correlations calculated from Q-vectors 
   TProfile*                  fQProduct;                 //average of products: 1st bin: <2*4>, 2nd bin: <2*6>, ...
   
@@ -220,8 +238,7 @@ class AliFlowAnalysisWithQCumulants{
   TProfile*                  fEtaReq2nPrimePOI;         //real part of q'-vector evaluated in harmonic 2n for each eta-bin
   TProfile*                  fEtaImq2nPrimePOI;         //imaginary part of q'-vector evaluated in harmonic 2n for each eta-bin
   TProfile*                  fmPrimePerEtaBin;          //number of particles selected both as POI and not as RP per each eta-bin
-  
-  
+   
   TProfile*                  fEtaReq1nPrimePrimePOI;    //real part of q''-vector evaluated in harmonic n for each eta-bin
   TProfile*                  fEtaImq1nPrimePrimePOI;    //imaginary part of q''-vector evaluated in harmonic n for each eta-bin
   TProfile*                  fEtaReq2nPrimePrimePOI;    //real part of q''-vector evaluated in harmonic 2n for each eta-bin
@@ -261,7 +278,15 @@ class AliFlowAnalysisWithQCumulants{
   
   Int_t                      fnBinsEta;                 //number of eta bins
   Double_t                   fEtaMin;                   //minimum eta   
-  Double_t                   fEtaMax;                   //maximum eta           
+  Double_t                   fEtaMax;                   //maximum eta
+  Int_t                      fEventCounter;             //counting the number of events    
+   
+  Bool_t                     fUsePhiWeights;            // phi weights
+  Bool_t                     fUsePtWeights;             // v_2(pt) weights
+  Bool_t                     fUseEtaWeights;            // v_2(eta) weights
+  TH1F                       fPhiWeights;               // histogram with phi weights
+  TH1D                       fPtWeights;                // histogram with v_2(pt) weights   
+  TH1D                       fEtaWeights;               // histogram with v_2(eta) weights    
                         
   ClassDef(AliFlowAnalysisWithQCumulants, 0);
 };
index 72311f3..8d062eb 100644 (file)
 
 ClassImp(AliFlowEventSimpleMaker)
 //----------------------------------------------------------------------- 
-AliFlowEventSimpleMaker::AliFlowEventSimpleMaker():
- fUseWeightsPhi(kFALSE),
- fUseWeightsPt(kFALSE),
- fUseWeightsEta(kFALSE),
- fPhiWeights(NULL),
- fPtWeights(NULL),   
- fEtaWeights(NULL)
+AliFlowEventSimpleMaker::AliFlowEventSimpleMaker()
 {
   //constructor
 }
@@ -55,27 +49,6 @@ AliFlowEventSimpleMaker::~AliFlowEventSimpleMaker()
   //destructor
 }
 
-//----------------------------------------------------------------------- 
-void AliFlowEventSimpleMaker::Init(TFile *file)
-{
- //initialize weights' histograms 
- if(file)
- {
-  if(fUseWeightsPhi)
-  {
-   file->GetObject("phi_weights",fPhiWeights);
-  }
-  if(fUseWeightsPt)
-  { 
-   file->GetObject("pt_weights",fPtWeights);
-  } 
-  if(fUseWeightsEta)
-  {
-   file->GetObject("eta_weights",fEtaWeights);
-  } 
- }//end of if(file)
-}
-
 //-----------------------------------------------------------------------   
 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput, AliFlowTrackSimpleCuts* intCuts, AliFlowTrackSimpleCuts* diffCuts)
 {
@@ -113,14 +86,6 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput, AliFlowT
   AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
   //cerr<<pEvent<<" pEvent "<<endl;
   
-  //needed if weights are used:
-  pEvent->SetUseWeightsPhi(fUseWeightsPhi);
-  pEvent->SetUseWeightsPt(fUseWeightsPt);
-  pEvent->SetUseWeightsEta(fUseWeightsEta);
-  pEvent->SetPhiWeights(fPhiWeights); 
-  pEvent->SetPtWeights(fPtWeights); 
-  pEvent->SetEtaWeights(fEtaWeights); 
-
   Int_t iN = iNumberOfInputTracks; // additional variable to artificially fix the number of tracks
   //  Int_t iN = 576; //multiplicity for chi=1.5
   //  Int_t iN = 256; //multiplicity for chi=1
index 1d1af7b..f57657f 100644 (file)
@@ -29,18 +29,6 @@ class AliFlowEventSimpleMaker {
   AliFlowEventSimpleMaker();             //constructor
   virtual ~AliFlowEventSimpleMaker();    //destructor
   
-  virtual void Init(TFile *file);
-  
-  //setters and getters
-  void SetUseWeightsPhi(Bool_t const uwPhi) { this->fUseWeightsPhi = uwPhi;};
-  Bool_t GetUseWeightsPhi() const { return this->fUseWeightsPhi;};
-  
-  void SetUseWeightsPt(Bool_t const uwPt) { this->fUseWeightsPt = uwPt;};
-  Bool_t GetUseWeightsPt() const { return this->fUseWeightsPt;};
-  
-  void SetUseWeightsEta(Bool_t const uwEta) { this->fUseWeightsEta = uwEta;};
-  Bool_t GetUseWeightsEta() const { return this->fUseWeightsEta;};
-  
   //TTree
   AliFlowEventSimple* FillTracks(TTree* anInput, AliFlowTrackSimpleCuts* intCuts, AliFlowTrackSimpleCuts* diffCuts);   //use own cut class
   //AliMCEvent
@@ -61,14 +49,7 @@ class AliFlowEventSimpleMaker {
  private:
   AliFlowEventSimpleMaker(const AliFlowEventSimpleMaker& anAnalysis);            //copy constructor
   AliFlowEventSimpleMaker& operator=(const AliFlowEventSimpleMaker& anAnalysis); //assignment operator
-  Bool_t fUseWeightsPhi;       // phi weights
-  Bool_t fUseWeightsPt;        // v_2(pt) weights
-  Bool_t fUseWeightsEta;       // v_2(eta) weights   
-  TH1F *fPhiWeights;           // histogram with phi weights
-  TH1D *fPtWeights;            // histogram with v_2(pt) weights   
-  TH1D *fEtaWeights;           // histogram with v_2(eta) weights
-          
+       
   ClassDef(AliFlowEventSimpleMaker,0)    // macro for rootcint
 };
  
index ec7b67b..f4ae78f 100644 (file)
@@ -73,17 +73,13 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   gSystem->Load("libPWG2flow.so");
   cerr<<"libPWG2flow.so loaded ..."<<endl;
   cout<<endl; 
-
-  //open the file with the weights: 
-  TFile *file = NULL;
-  if(useWeightsPhi||useWeightsPt||useWeightsEta)
-  {
-   file = TFile::Open("weightsForTheSecondRun.root", "READ");
-  }
   
   // flow event in AliRoot
   AliFlowEventSimpleMaker* fEventMaker = new AliFlowEventSimpleMaker();
-
+  
+  /*   
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  //                       !!!! to be removed
   // if weights are being used initialize the weight's histos in AliFlowEvenSimpleMaker:
   fEventMaker->SetUseWeightsPhi(useWeightsPhi);
   fEventMaker->SetUseWeightsPt(useWeightsPt);
@@ -92,6 +88,9 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   {
    fEventMaker->Init(file);
   }
+  //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+  */  
+  
   
   // In root
 
@@ -112,7 +111,7 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   // output histosgrams
   gROOT->LoadMacro("code/AliFlowCommonHist.cxx+");
   gROOT->LoadMacro("code/AliFlowCommonHistResults.cxx+");
-  gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");
+  gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");fPhiWeights
   gROOT->LoadMacro("code/AliFlowLYZHist2.cxx+");
 
   // functions needed for various methods
@@ -145,7 +144,7 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   gSystem->Load("libTree.so");
 
   //------------------------------------------------------------------------
-  //cuts
+  //cuts:
   AliFlowTrackSimpleCuts* cutsInt = new AliFlowTrackSimpleCuts();
   cutsInt->SetPtMax(ptMaxInt);
   cutsInt->SetPtMin(ptMinInt);
@@ -164,7 +163,22 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   cutsDiff->SetPhiMin(phiMinDiff);
   cutsDiff->SetPID(PIDDiff);
 
+  //weights:
+  //open the file with the weights: 
+  TFile *file = NULL;
+  TH1F *phiWeights = NULL;
+  TH1D *ptWeights = NULL;
+  TH1D *etaWeights = NULL;
   
+  if(useWeightsPhi||useWeightsPt||useWeightsEta)
+  {
+   file = TFile::Open("weightsForTheSecondRun.root", "READ");
+   if(useWeightsPhi) file->GetObject("phi_weights",phiWeights); 
+   if(useWeightsPt) file->GetObject("pt_weights",ptWeights); 
+   if(useWeightsEta) file->GetObject("eta_weights",etaWeights);    
+  }
+
+  //flow methods:  
   AliFlowAnalysisWithQCumulants    *qc    = NULL;
   AliFlowAnalysisWithCumulants     *gfc   = NULL;
   AliFittingQDistribution          *fqd   = NULL;
@@ -172,9 +186,7 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   AliFlowAnalysisWithLeeYangZeros  *lyz2  = NULL;
   AliFlowAnalysisWithLYZEventPlane *lyzep = NULL;
   AliFlowAnalysisWithScalarProduct *sp    = NULL;
-  AliFlowAnalysisWithMCEventPlane  *mcep  = NULL;
-   
-  //flow methods:
+  AliFlowAnalysisWithMCEventPlane  *mcep  = NULL;   
 
   //MCEP = monte carlo event plane
   if (MCEP) {
@@ -185,7 +197,10 @@ int runFlowAnalysis(Int_t aRuns = 44, const char*
   //QC = Q-cumulants  
   if(QC) { 
     AliFlowAnalysisWithQCumulants* qc = new AliFlowAnalysisWithQCumulants();
-    qc->CreateOutputObjects();
+    qc->Init();
+    if(useWeightsPhi) qc->SetPhiWeights(*phiWeights);
+    if(useWeightsPt) qc->SetPtWeights(*ptWeights);
+    if(useWeightsEta) qc->SetEtaWeights(*etaWeights);    
   }
   
   //GFC = Generating Function Cumulants