]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added a new methods (fitting of Q vector distribution)
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Nov 2008 12:35:57 +0000 (12:35 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Nov 2008 12:35:57 +0000 (12:35 +0000)
PWG2/CMake_libPWG2flow.txt
PWG2/FLOW/AliAnalysisTaskFittingQDistribution.cxx [new file with mode: 0644]
PWG2/FLOW/AliAnalysisTaskFittingQDistribution.h [new file with mode: 0644]
PWG2/FLOW/AliFittingFunctionsForQDistribution.cxx [new file with mode: 0644]
PWG2/FLOW/AliFittingFunctionsForQDistribution.h [new file with mode: 0644]
PWG2/FLOW/AliFittingQDistribution.cxx [new file with mode: 0644]
PWG2/FLOW/AliFittingQDistribution.h [new file with mode: 0644]
PWG2/FLOW/macros/runAliAnalysisTaskFlow.C
PWG2/FLOW/macros/runProofFlow.C
PWG2/PWG2flowLinkDef.h
PWG2/libPWG2flow.pkg

index 0468bf41bebb5be6c1b6f5cbcf7b3fdcbeae02d2..3252a73db9ffd9f3d8c22638e83e6ce07a362518 100644 (file)
@@ -27,6 +27,9 @@ set(SRCS
       FLOW/AliAnalysisTaskLeeYangZeros.cxx
       FLOW/AliCumulantsFunctions.cxx
       FLOW/AliQCumulantsFunctions.cxx
+      FLOW/AliAnalysisTaskFittingQDistribution.cxx
+      FLOW/AliFittingFunctionsForQDistribution.cxx
+      FLOW/AliFittingQDistribution.cxx
 )
 
 # fill list of header files from list of source files
diff --git a/PWG2/FLOW/AliAnalysisTaskFittingQDistribution.cxx b/PWG2/FLOW/AliAnalysisTaskFittingQDistribution.cxx
new file mode 100644 (file)
index 0000000..04d9619
--- /dev/null
@@ -0,0 +1,351 @@
+/*************************************************************************
+* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *f
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  * 
+**************************************************************************/
+
+/**************************************
+ *    analysis task for fitting       * 
+ *         q-distribution             *
+ *                                    * 
+ * authors: Naomi van der Kolk        *
+ *           (kolk@nikhef.nl)         *  
+ *          Raimond Snellings         *
+ *           (snelling@nikhef.nl)     * 
+ *          Ante Bilandzic            *
+ *           (anteb@nikhef.nl)        * 
+ * ***********************************/
+#include "Riostream.h"
+#include "TChain.h"
+#include "TTree.h"
+#include "TFile.h"
+#include "TList.h"
+#include "TH1.h"
+#include "TProfile.h"
+
+#include "AliAnalysisTask.h"
+#include "AliAnalysisDataSlot.h"
+#include "AliAnalysisDataContainer.h"
+#include "AliAnalysisManager.h"
+
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+
+#include "AliAODEvent.h"
+#include "AliAODInputHandler.h"
+
+#include "AliMCEventHandler.h"
+#include "AliMCEvent.h"
+
+#include "../../CORRFW/AliCFManager.h"
+
+#include "AliAnalysisTaskFittingQDistribution.h"
+#include "AliFlowEventSimpleMaker.h"
+#include "AliFittingQDistribution.h"
+#include "AliFlowCommonConstants.h"
+#include "AliFlowCommonHistResults.h"
+#include "AliFittingFunctionsForQDistribution.h"
+
+ClassImp(AliAnalysisTaskFittingQDistribution)
+
+//================================================================================================================
+
+AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const char *name, Bool_t on): 
+ AliAnalysisTask(name,""), 
+ fESD(NULL),
+ fAOD(NULL),
+ fFQDA(NULL),//Fitting Q_Distribution Analysis (FQDA) object
+ fEventMaker(NULL),
+ fAnalysisType("ESD"), 
+ fCFManager1(NULL),
+ fCFManager2(NULL),
+ fListHistos(NULL),
+ fQAInt(NULL),
+ fQADiff(NULL),
+ fQA(on)
+{
+ //constructor
+ cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const char *name)"<<endl;
+ // Define input and output slots here
+ // Input slot #0 works with a TChain
+ DefineInput(0, TChain::Class());
+  
+ // Output slot #0 writes into a TList container
+ DefineOutput(0, TList::Class());  
+ if(on) 
+ {
+  DefineOutput(1, TList::Class());
+  DefineOutput(2, TList::Class()); 
+ }         
+}
+
+AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(): 
+ fESD(NULL),
+ fAOD(NULL), 
+ fFQDA(NULL),//Fitting q-distribution Analysis (FQDA) object
+ fEventMaker(NULL),
+ fAnalysisType("ESD"),
+ fCFManager1(NULL),
+ fCFManager2(NULL),
+ fListHistos(NULL),  
+ fQAInt(NULL),
+ fQADiff(NULL),
+ fQA(kFALSE)
+{
+ //dummy constructor
+ cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution()"<<endl;
+}
+
+//================================================================================================================
+
+void AliAnalysisTaskFittingQDistribution::ConnectInputData(Option_t *) 
+{
+ //connect ESD or AOD (called once)
+ cout<<"AliAnalysisTaskFittingQDistribution::ConnectInputData(Option_t *)"<<endl;
+
+ TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
+ if (!tree) 
+ {
+  Printf("ERROR: Could not read chain from input slot 0");
+ } 
+ else 
+ {
+ //disable all branches and enable only the needed ones
+  if (fAnalysisType == "MC") {
+     // we want to process only MC
+      tree->SetBranchStatus("*", kFALSE);
+
+      AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+      if (!esdH) {
+       Printf("ERROR: Could not get ESDInputHandler");
+      } else {
+       fESD = esdH->GetEvent();
+      }
+    }
+    else if (fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1"  ) {
+      tree->SetBranchStatus("*", kFALSE);
+      tree->SetBranchStatus("Tracks.*", kTRUE);
+
+      AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+      if (!esdH) {
+       Printf("ERROR: Could not get ESDInputHandler");
+      } else
+       fESD = esdH->GetEvent();
+    }
+    else if (fAnalysisType == "AOD") {
+      AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+      if (!aodH) {
+       Printf("ERROR: Could not get AODInputHandler");
+      }
+      else {
+       fAOD = aodH->GetEvent();
+      }
+    }
+    else {
+      Printf("Wrong analysis type: Only ESD, ESDMC0, ESDMC1, AOD and MC types are allowed!");
+
+    }
+  }
+}
+
+//================================================================================================================
+
+void AliAnalysisTaskFittingQDistribution::CreateOutputObjects() 
+{
+ //called at every worker node to initialize
+ cout<<"AliAnalysisTaskFittingQDistribution::CreateOutputObjects()"<<endl;
+
+ //OpenFile(0);
+
+ if(!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1" || fAnalysisType == "MC")) 
+ {
+  cout<<"WRONG ANALYSIS TYPE! only ESD, ESDMC0, ESDMC1, AOD and MC are allowed."<<endl;
+  exit(1);
+ }
+ //event maker
+ fEventMaker = new AliFlowEventSimpleMaker();
+  
+ //analyser
+ fFQDA = new AliFittingQDistribution();
+ fFQDA->CreateOutputObjects();
+
+ if(fFQDA->GetHistList()) 
+ {
+  fListHistos = fFQDA->GetHistList();
+  //fListHistos->Print();
+ }
+ else 
+ {
+  Printf("ERROR: Could not retrieve histogram list"); 
+ }
+ //PostData(0,fListHistos);
+}
+
+//================================================================================================================
+
+void AliAnalysisTaskFittingQDistribution::Exec(Option_t *) 
+{
+ //main loop (called for each event)
+ if (fAnalysisType == "MC") {
+    // Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler
+    // This handler can return the current MC event
+
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
+    fCFManager1->SetEventInfo(mcEvent);
+    fCFManager2->SetEventInfo(mcEvent);
+
+    //fitting q-distribution 
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent,fCFManager1,fCFManager2);
+    fFQDA->Make(fEvent);
+    delete fEvent;
+  }
+  else if (fAnalysisType == "ESD") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    //fitting q-distribution
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,fCFManager1,fCFManager2);
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+    fFQDA->Make(fEvent);
+    delete fEvent;
+  }
+  else if (fAnalysisType == "ESDMC0") {
+    if (!fESD) {
+      Printf("ERROR: fESD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+    
+    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+    if (!eventHandler) {
+      Printf("ERROR: Could not retrieve MC event handler");
+      return;
+    }
+
+    AliMCEvent* mcEvent = eventHandler->MCEvent();
+    if (!mcEvent) {
+      Printf("ERROR: Could not retrieve MC event");
+      return;
+    }
+
+    fCFManager1->SetEventInfo(mcEvent);
+    fCFManager2->SetEventInfo(mcEvent);
+
+    //fitting q-distribution 
+    AliFlowEventSimple* fEvent=NULL;
+    if (fAnalysisType == "ESDMC0") { 
+      fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 0); //0 = kine from ESD, 1 = kine from MC
+    } else if (fAnalysisType == "ESDMC1") {
+      fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 1); //0 = kine from ESD, 1 = kine from MC
+    }
+    fFQDA->Make(fEvent);
+    delete fEvent;
+    //delete mcEvent;
+  }
+  
+  else if (fAnalysisType == "AOD") {
+    if (!fAOD) {
+      Printf("ERROR: fAOD not available");
+      return;
+    }
+    Printf("There are %d tracks in this event", fAOD->GetNumberOfTracks());
+
+    // analysis 
+    //For the moment don't use CF //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD,fCFManager1,fCFManager2);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);
+    fFQDA->Make(fEvent);
+    delete fEvent;
+  }
+  
+  PostData(0,fListHistos); 
+  if(fQA) 
+  {
+   PostData(1,fQAInt);
+   PostData(2,fQADiff); 
+  }
+}
+
+//================================================================================================================
+
+void AliAnalysisTaskFittingQDistribution::Terminate(Option_t *) 
+{  
+ //accessing the output list
+ fListHistos = (TList*)GetOutputData(0);
+ //fListHistos->Print();
+ if(fListHistos)
+ {         
+  //profile with avarage selected multiplicity for int. flow 
+  TProfile *AvMult = dynamic_cast<TProfile*>(fListHistos->FindObject("fAvMultIntFlowFQD"));
+  
+  //q-distribution
+  TH1D *qDist = dynamic_cast<TH1D*>(fListHistos->FindObject("fQDistributionFQD"));
+  
+  //histograms to store the final results (integrated flow)
+  TH1D *intFlowResults = dynamic_cast<TH1D*>(fListHistos->FindObject("fIntFlowResultsFQD"));
+  
+  AliFittingFunctionsForQDistribution finalFitting(AvMult,qDist,intFlowResults);
+         
+  finalFitting.Calculate();  
+ }
+ else
+ {
+  cout<<"histogram list pointer is empty"<<endl;
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PWG2/FLOW/AliAnalysisTaskFittingQDistribution.h b/PWG2/FLOW/AliAnalysisTaskFittingQDistribution.h
new file mode 100644 (file)
index 0000000..69139ec
--- /dev/null
@@ -0,0 +1,93 @@
+/* 
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
+ * See cxx source for full Copyright notice 
+ * $Id$ 
+ */
+
+/**************************************
+ *    analysis task for fitting       * 
+ *         q-distribution             *
+ *                                    * 
+ * authors: Naomi van der Kolk        *
+ *           (kolk@nikhef.nl)         *  
+ *          Raimond Snellings         *
+ *           (snelling@nikhef.nl)     * 
+ *          Ante Bilandzic            *
+ *           (anteb@nikhef.nl)        * 
+ * ***********************************/
+
+#ifndef AliAnalysisTaskFittingQDistribution_H
+#define AliAnalysisTaskFittingQDistribution_H
+
+#include "TString.h"
+#include "AliAnalysisTask.h"
+
+class AliESDEvent;
+class AliAODEvent;
+class AliCFManager;
+class AliFittingQDistribution;
+class AliFlowEventSimpleMaker;
+class TFile;
+
+//================================================================================================================
+
+class AliAnalysisTaskFittingQDistribution : public AliAnalysisTask{
+ public:
+  AliAnalysisTaskFittingQDistribution();
+  AliAnalysisTaskFittingQDistribution(const char *name, Bool_t QAon = kFALSE);
+  virtual ~AliAnalysisTaskFittingQDistribution(){}; 
+  
+  virtual void   ConnectInputData(Option_t *);
+  virtual void   CreateOutputObjects();
+  virtual void   Exec(Option_t *option);
+  virtual void   Terminate(Option_t *);
+  
+  void           SetAnalysisType(TString type) {this->fAnalysisType = type;}
+  TString GetAnalysisType() const {return this->fAnalysisType;}
+  
+  void SetCFManager1(AliCFManager* cfmgr) {this->fCFManager1 = cfmgr;} 
+  AliCFManager* GetCFManager1()           {return this->fCFManager1;}
+  void SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr;} 
+  AliCFManager* GetCFManager2()           {return this->fCFManager2;} 
+  void          SetQAList1(TList* list)   {this->fQAInt = list; }
+  TList*        GetQAList1()              {return this->fQAInt; }
+  void          SetQAList2(TList* list)   {this->fQADiff = list; }
+  TList*        GetQAList2()              {return this->fQADiff; }
+  void          SetQAOn(Bool_t kt)        {this->fQA = kt; }
+  Bool_t        GetQAOn()                 {return this->fQA; }
+ private:
+  AliAnalysisTaskFittingQDistribution(const AliAnalysisTaskFittingQDistribution& aatfqd);
+  AliAnalysisTaskFittingQDistribution& operator=(const AliAnalysisTaskFittingQDistribution& aatfqd);
+
+  AliESDEvent *fESD;                      // ESD object
+  AliAODEvent* fAOD;                      // AOD object
+  AliFittingQDistribution* fFQDA;         // Fitting q-distribution Analysis (FQDA) object
+  AliFlowEventSimpleMaker* fEventMaker;   // FlowEventSimple maker object
+  TString fAnalysisType;                  // string to select which kind of input to analyse (ESD, AOD or MC)
+  AliCFManager* fCFManager1;              // correction framework manager
+  AliCFManager* fCFManager2;              // correction framework manager
+  TList  *fListHistos;                    // collection of output 
+     
+  TList*        fQAInt;                   // QA histogram list
+  TList*        fQADiff;                  // QA histogram list
+
+  Bool_t fQA;                             // flag to set the filling of the QA histograms                                                 
+                                                           
+  ClassDef(AliAnalysisTaskFittingQDistribution, 1); 
+};
+
+//================================================================================================================
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PWG2/FLOW/AliFittingFunctionsForQDistribution.cxx b/PWG2/FLOW/AliFittingFunctionsForQDistribution.cxx
new file mode 100644 (file)
index 0000000..de7e2d3
--- /dev/null
@@ -0,0 +1,149 @@
+/*************************************************************************
+* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  * 
+**************************************************************************/
+
+/******************************** 
+ * integrated flow estimate by  *
+ *   fitting q-distribution     * 
+ *                              *
+ * author: Ante Bilandzic       * 
+ *          (anteb@nikhef.nl)   *
+ *                              *
+ * based on the macro written   *
+ *     by Sergei Voloshin       *                        
+ *******************************/ 
+
+#define AliFittingFunctionsForQDistribution_cxx
+
+#include "Riostream.h"
+#include "AliFlowCommonConstants.h"
+#include "TChain.h"
+#include "TFile.h"
+#include "TList.h"
+#include "TParticle.h"
+
+#include "TProfile.h"
+#include "TF1.h"
+#include "TAxis.h"
+#include "TH1.h"
+#include "TH1D.h"
+#include "TF1.h"
+#include "TMath.h"
+
+#include "AliFlowEventSimple.h"
+#include "AliFlowTrackSimple.h"
+#include "AliFittingQDistribution.h"
+#include "AliFlowCommonConstants.h"
+#include "AliFittingFunctionsForQDistribution.h"
+
+ClassImp(AliFittingFunctionsForQDistribution)
+
+//================================================================================================================_
+
+AliFittingFunctionsForQDistribution::AliFittingFunctionsForQDistribution():  
+ fAvMultFQD(NULL),
+ fQDistributionFQD(NULL), 
+ fIntFlowResFQD(NULL)
+{
+ //default constructor 
+}
+
+AliFittingFunctionsForQDistribution::~AliFittingFunctionsForQDistribution()
+{
+ //destructor
+}
+
+AliFittingFunctionsForQDistribution::AliFittingFunctionsForQDistribution(TProfile *AvMult, TH1D *QDistribution, TH1D *intFlowRes):
+ fAvMultFQD(AvMult),
+ fQDistributionFQD(QDistribution),
+ fIntFlowResFQD(intFlowRes)
+{
+ //custom constructor 
+}
+  
+//================================================================================================================
+
+void AliFittingFunctionsForQDistribution::Calculate()
+{
+ //fitting q-distribution
+ Int_t n=2;//harmonic (to be improved)
+ Double_t AvM = fAvMultFQD->GetBinContent(1);
+ Int_t nEvts = (Int_t)(fAvMultFQD->GetBinEntries(1));
+
+ Double_t qmin=(fQDistributionFQD->GetXaxis())->GetXmin();  
+ Double_t qmax=(fQDistributionFQD->GetXaxis())->GetXmax(); 
+ Double_t bin=fQDistributionFQD->GetBinWidth(4);//assuming that all bins have the same width 
+ Double_t ent=fQDistributionFQD->GetEntries();
+ Double_t norm=bin*ent;//assuming that all bins have the same width
+
+ TF1 *fittingFun = new TF1("fittingFun","[2]*(x/[1])*exp(-(x*x+[0]*[0])/(2.*[1]))*TMath::BesselI0(x*[0]/[1])",qmin,qmax); 
+ fittingFun->SetParNames("V","sigma","norm");
+ fittingFun->SetParameters(0.1*pow(AvM,0.5),0.5,norm);
+ fittingFun->SetParLimits(0,0.,10.);//to be improved (limits)
+ fittingFun->SetParLimits(1,0.0,5.5);//to be improved (limits)
+ fittingFun->FixParameter(2,norm); 
+
+ fQDistributionFQD->Fit("fittingFun","NQ","",qmin,qmax);
+ Double_t v=0.,errorv=0.,sigma2=0.,errorsigma2=0.;
+ if(AvM)
+ { 
+  v = fittingFun->GetParameter(0)/pow(AvM,0.5);
+  errorv = fittingFun->GetParError(0)/pow(AvM,0.5);
+ }
+ sigma2 = fittingFun->GetParameter(1);
+ errorsigma2 = fittingFun->GetParError(1);
+ cout<<" "<<endl;
+ cout<<"************************************"<<endl;
+ cout<<"************************************"<<endl;
+ cout<<"    integrated flow by fitting"<<endl;
+ cout<<"         q-distribution:      "<<endl;
+ cout<<""<<endl;
+ cout<<" v_"<<n<<"{FQD} = "<<v<<" +/- "<<errorv<<endl;
+ cout<<" sigma^2  = "<<sigma2<<" +/- "<<errorsigma2<<endl; 
+ //cout<<"vm       = "<<v*pow(AvM,0.5)<<endl;
+ cout<<" "<<endl;
+ cout<<"    nEvts = "<<nEvts<<", AvM = "<<AvM<<endl; 
+ cout<<"************************************"<<endl;
+ cout<<"************************************"<<endl;
+ fIntFlowResFQD->SetBinContent(1,v);
+ fIntFlowResFQD->SetBinError(1,errorv);
+ cout<<" "<<endl;
+
+ //fQDistributionFQD->Draw("");
+ //fittingFun->Draw("SAME");
+
+}//end of Calculate()
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PWG2/FLOW/AliFittingFunctionsForQDistribution.h b/PWG2/FLOW/AliFittingFunctionsForQDistribution.h
new file mode 100644 (file)
index 0000000..48200b6
--- /dev/null
@@ -0,0 +1,58 @@
+/* 
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
+ * See cxx source for full Copyright notice 
+ * $Id$ 
+ */
+
+/******************************** 
+ * integrated flow estimate by  *
+ *   fitting q-distribution     * 
+ *                              *
+ * author: Ante Bilandzic       * 
+ *          (anteb@nikhef.nl)   *
+ *                              *
+ * based on the macro written   *
+ *     by Sergei Voloshin       *                        
+ *******************************/ 
+
+#ifndef AliFittingFunctionsForQDistribution_H
+#define AliFittingFunctionsForQDistribution_H
+
+#include "AliFlowCommonConstants.h"
+
+class TH1;
+class TProfile;
+
+class TObjArray;
+class TList;
+class TFile;
+
+//================================================================================================================
+
+class AliFittingFunctionsForQDistribution{
+ public:
+  AliFittingFunctionsForQDistribution();
+  virtual ~AliFittingFunctionsForQDistribution();
+  AliFittingFunctionsForQDistribution(TProfile *AvMult, TH1D *QDistribution, TH1D *intFlowRes);
+  void Calculate();
+
+ private:
+  AliFittingFunctionsForQDistribution(const AliFittingFunctionsForQDistribution& fun);
+  AliFittingFunctionsForQDistribution& operator=(const AliFittingFunctionsForQDistribution& fun);
+  
+  TProfile *fAvMultFQD;         //avarage selected multiplicity for int. flow
+  TH1D     *fQDistributionFQD;  //q-distribution
+  TH1D     *fIntFlowResFQD;     //integrated flow final result
+
+  ClassDef(AliFittingFunctionsForQDistribution, 0);
+};
+
+//================================================================================================================
+
+#endif
+
+
+
+
+
diff --git a/PWG2/FLOW/AliFittingQDistribution.cxx b/PWG2/FLOW/AliFittingQDistribution.cxx
new file mode 100644 (file)
index 0000000..6acdaba
--- /dev/null
@@ -0,0 +1,166 @@
+/*************************************************************************
+* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  * 
+**************************************************************************/
+
+/******************************** 
+ * integrated flow estimate by  *
+ *   fitting q-distribution     * 
+ *                              *
+ * author: Ante Bilandzic       * 
+ *          (anteb@nikhef.nl)   *
+ *******************************/ 
+
+#define AliFittingQDistribution_cxx
+
+#include "Riostream.h"
+#include "AliFlowCommonConstants.h"
+#include "AliFlowCommonHist.h"
+#include "AliFlowCommonHistResults.h"
+#include "TChain.h"
+#include "TFile.h"
+#include "TList.h" 
+#include "TParticle.h"
+#include "TProfile.h"
+#include "AliFlowEventSimple.h"
+#include "AliFlowTrackSimple.h"
+#include "AliFittingQDistribution.h"
+
+class TH1;
+class TGraph;
+class TPave;
+class TLatex;
+class TMarker;
+class TObjArray;
+class TList;
+class TCanvas;
+class TSystem;
+class TROOT;
+class AliFlowVector;
+class TVector;
+
+//================================================================================================================
+
+ClassImp(AliFittingQDistribution)
+
+AliFittingQDistribution::AliFittingQDistribution():  
+ fTrack(NULL),
+ fHistList(NULL),
+ fAvMultIntFlowFQD(NULL),
+ fIntFlowResultsFQD(NULL),
+ fCommonHists(NULL),
+ fQDistributionFQD(NULL)
+{
+ //constructor 
+ fHistList = new TList(); 
+}
+
+AliFittingQDistribution::~AliFittingQDistribution()
+{
+ //desctructor
+ delete fHistList; 
+}
+
+//================================================================================================================
+
+void AliFittingQDistribution::CreateOutputObjects()
+{
+ //various output histograms
+ //avarage multiplicity 
+ fAvMultIntFlowFQD = new TProfile("fAvMultIntFlowFQD","Average Multiplicity",1,0,1,"s");
+ fAvMultIntFlowFQD->SetXTitle("");
+ fAvMultIntFlowFQD->SetYTitle("");
+ fAvMultIntFlowFQD->SetLabelSize(0.06);
+ fAvMultIntFlowFQD->SetMarkerStyle(25);
+ fAvMultIntFlowFQD->SetLabelOffset(0.01);
+ (fAvMultIntFlowFQD->GetXaxis())->SetBinLabel(1,"Average Multiplicity");
+ fHistList->Add(fAvMultIntFlowFQD);
+ //final result for integrated flow 
+ fIntFlowResultsFQD = new TH1D("fIntFlowResultsFQD","Integrated Flow By Fitting q-distribution",1,0,1);
+ fIntFlowResultsFQD->SetXTitle("");
+ fIntFlowResultsFQD->SetYTitle("");
+ fIntFlowResultsFQD->SetMarkerStyle(25);
+ fIntFlowResultsFQD->SetLabelSize(0.06);
+ fAvMultIntFlowFQD->SetLabelOffset(0.02);
+ (fIntFlowResultsFQD->GetXaxis())->SetBinLabel(1,"v_{n}");
+ fHistList->Add(fIntFlowResultsFQD);
+ //q-distribution 
+ fQDistributionFQD = new TH1D("fQDistributionFQD","q-distribution",100,0,10);
+ fQDistributionFQD->SetXTitle("q_{n}=Q_{n}/#sqrt{M}");
+ fQDistributionFQD->SetYTitle("Counts");
+ fHistList->Add(fQDistributionFQD);
+  
+ //common control histograms
+ fCommonHists = new AliFlowCommonHist("FittingQDistribution");
+ fHistList->Add(fCommonHists->GetHistList());  
+}//end of CreateOutputObjects()
+
+//================================================================================================================
+
+void AliFittingQDistribution::Make(AliFlowEventSimple* anEvent)
+{
+ //Int_t nPrim = anEvent->NumberOfTracks();//total multiplicity
+  
+ Int_t n=2;//harmonic (to be improved)  
+   
+ //fill the common control histograms
+ fCommonHists->FillControlHistograms(anEvent);   
+
+ //calculating Q-vector of event
+ AliFlowVector fQVector;
+ fQVector.Set(0.,0.);
+ fQVector.SetMult(0);
+ fQVector=anEvent->GetQ(n);                                                                                  
+                                                                                                                                                                      
+ //multiplicity
+ fAvMultIntFlowFQD->Fill(0.,fQVector.GetMult(),1.);
+ //q = Q/sqrt(M)
+ Double_t q=0.;
+ if(fQVector.GetMult()!=0)
+ {
+  q = fQVector.Mod()/sqrt(fQVector.GetMult());
+  fQDistributionFQD->Fill(q,1.);
+ }  
+}
+
+//================================================================================================================
+
+void AliFittingQDistribution::Finish()
+{
+ //not needed for the time being...
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PWG2/FLOW/AliFittingQDistribution.h b/PWG2/FLOW/AliFittingQDistribution.h
new file mode 100644 (file)
index 0000000..a656599
--- /dev/null
@@ -0,0 +1,67 @@
+/* 
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
+ * See cxx source for full Copyright notice 
+ * $Id$ 
+ */
+
+/******************************** 
+ * integrated flow estimate by  *
+ *   fitting q-distribution     * 
+ *                              *
+ * author: Ante Bilandzic       * 
+ *          (anteb@nikhef.nl)   *
+ *******************************/ 
+#ifndef AliFittingQDistribution_H
+#define AliFittingQDistribution_H
+
+#include "AliFlowCommonConstants.h"
+
+class TObjArray;
+class TList;
+class TFile;
+
+class TH1;
+class TProfile;
+
+class AliFlowEventSimple;
+class AliFlowTrackSimple;
+class AliFlowCommonHist;
+class AliFlowCommonHistResults;
+class AliFlowVector;
+
+//================================================================================================================
+
+class AliFittingQDistribution{
+ public:
+  AliFittingQDistribution();
+  virtual ~AliFittingQDistribution(); 
+  
+  virtual void CreateOutputObjects();
+  virtual void Make(AliFlowEventSimple* anEvent);
+  virtual void Finish();
+  
+  TList* GetHistList() const {return this->fHistList;}      //output histogram list
+ private:
+  AliFittingQDistribution(const AliFittingQDistribution& afqd);
+  AliFittingQDistribution& operator=(const AliFittingQDistribution& afqd);
+  AliFlowTrackSimple* fTrack;                               //track
+  
+  TList*             fHistList;         //list to hold all output histograms
+  TProfile*          fAvMultIntFlowFQD;    //avarage selected multiplicity
+  TH1D*              fIntFlowResultsFQD;   //integrated flow final results
+  AliFlowCommonHist* fCommonHists;      //common control histograms
+  TH1D*              fQDistributionFQD;            //q-distribution
+      
+  ClassDef(AliFittingQDistribution, 0);
+};
+
+//================================================================================================================
+
+#endif
+
+
+
+
+
index bb9a6baa8d36fc613b2398f8bc5dd61e3d535b8e..5a2e00ce18e4ee319be39d91a90374bd3b486511 100644 (file)
@@ -14,6 +14,7 @@ void LookupWrite(TChain* chain, const char* target) ;
 // LYZEP = Lee Yang Zeroes Event Plane   (for PbPb)     
 // GFC   = Generating Function Cumulants (for PbPb)  
 // QC    = Q-cumulants                   (for PbPb)  
+// FQD   = Fitting q-distribution        (for PbPb) 
 // MCEP  = Flow calculated from the real MC event plane (for PbPb only!)        
 //      
 // The LYZ analysis should be done in the following order;      
@@ -43,6 +44,7 @@ Bool_t LYZ2  = kFALSE;
 Bool_t LYZEP = kFALSE;
 Bool_t GFC   = kTRUE;
 Bool_t QC    = kTRUE;
+Bool_t FQD   = kTRUE;
 Bool_t MCEP  = kFALSE;
 
 
@@ -80,7 +82,14 @@ const Int_t minclustersTPC2 = 50;
 const Int_t maxnsigmatovertex2 = 3;
 
 
-void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice2/ante/ab2", Int_t offset = 0) 
+void runAliAnalysisTaskFlow(Int_t nRuns = 44, const Char_t* dataDir="/data/alice2/ante/ab2", Int_t offset = 0) 
+
+//void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice2/kolk/Therminator_midcentral", Int_t offset = 0) 
+
+
+//void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice2/LHyquid3_rot", Int_t offset = 0) 
+
+//void runAliAnalysisTaskFlow(Int_t nRuns = 4, const Char_t* dataDir="/data/alice2/ante/AOD", Int_t offset = 0) 
   //void runAliAnalysisTaskFlowMore(Int_t nRuns = 3, const Char_t* dataDir="/data/alice1/kolk/TherminatorNov08", Int_t offset = 0) 
   //void runAliAnalysisTaskFlowMore(Int_t nRuns = 1, const Char_t* dataDir="/data/alice1/kolk/AOD", Int_t offset = 0)
   //void runAliAnalysisTaskFlowMore(Int_t nRuns = 3, const Char_t* dataDir="/data/alice1/kolk/testCrashIfNoKine", Int_t offset = 0)
@@ -142,6 +151,9 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (QC) {
       TList* qaIntQC = new TList();
       TList* qaDiffQC = new TList(); }
+    if (FQD) {
+      TList* qaIntFQD = new TList();
+      TList* qaDiffFQD = new TList(); }
     if (MCEP) {
       TList* qaIntMCEP = new TList();
       TList* qaDiffMCEP = new TList(); }
@@ -159,6 +171,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ mcKineCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcKineCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcKineCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcKineCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcKineCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -172,7 +185,8 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZ2) { mcKineCuts2->SetQAOn(qaDiffLYZ2); }
     if (LYZEP){ mcKineCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcKineCuts2->SetQAOn(qaDiffGFC); }
-    if (QC)   { mcKineCuts2->SetQAOn(qaDiffQC); }    
+    if (QC)   { mcKineCuts2->SetQAOn(qaDiffQC); } 
+    if (FQD)  { mcKineCuts2->SetQAOn(qaDiffFQD); }    
     if (MCEP) { mcKineCuts2->SetQAOn(qaDiffMCEP); }
   }
 
@@ -186,6 +200,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ mcGenCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcGenCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcGenCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcGenCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcGenCuts1->SetQAOn(qaIntMCEP); }
   }
 
@@ -199,6 +214,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ mcGenCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcGenCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { mcGenCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { mcGenCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { mcGenCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -213,6 +229,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ mcAccCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcAccCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcAccCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcAccCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcAccCuts1->SetQAOn(qaIntMCEP); }
   }
 
@@ -225,7 +242,8 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZ2) { mcAccCuts2->SetQAOn(qaDiffLYZ2); }
     if (LYZEP){ mcAccCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcAccCuts2->SetQAOn(qaDiffGFC); }
-    if (QC)   { mcAccCuts2->SetQAOn(qaDiffQC); }    
+    if (QC)   { mcAccCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { mcAccCuts2->SetQAOn(qaDiffFQD); }    
     if (MCEP) { mcAccCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -241,6 +259,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recKineCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recKineCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recKineCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recKineCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recKineCuts1->SetQAOn(qaIntMCEP); }
   }
 
@@ -255,6 +274,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recKineCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recKineCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recKineCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recKineCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recKineCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -268,6 +288,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recQualityCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recQualityCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recQualityCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recQualityCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recQualityCuts1->SetQAOn(qaIntMCEP); }
   }
 
@@ -281,6 +302,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recQualityCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recQualityCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recQualityCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recQualityCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recQualityCuts2->SetQAOn(qaDiffMCEP); }
   }
 
@@ -293,6 +315,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recIsPrimaryCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recIsPrimaryCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recIsPrimaryCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recIsPrimaryCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recIsPrimaryCuts1->SetQAOn(qaIntMCEP); }
   }
 
@@ -305,6 +328,7 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (LYZEP){ recIsPrimaryCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recIsPrimaryCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recIsPrimaryCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recIsPrimaryCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recIsPrimaryCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -361,6 +385,9 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     if (QC)  { 
       cutPID1->SetQAOn(qaIntQC); 
       cutPID2->SetQAOn(qaDiffQC); }
+    if (FQD)  { 
+      cutPID1->SetQAOn(qaIntFQD); 
+      cutPID2->SetQAOn(qaDiffFQD); }
     if (MCEP) { 
       cutPID1->SetQAOn(qaIntMCEP); 
       cutPID2->SetQAOn(qaDiffMCEP); }
@@ -546,6 +573,17 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
       taskQC->SetQAList2(qaDiffQC); }
     mgr->AddTask(taskQC);
   }
+  if (FQD){
+    if (QA) { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kTRUE);}
+    else { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE);}
+    taskFQD->SetAnalysisType(type);
+    taskFQD->SetCFManager1(cfmgr1);
+    taskFQD->SetCFManager2(cfmgr2);
+    if (QA) { 
+      taskFQD->SetQAList1(qaIntFQD);
+      taskFQD->SetQAList2(qaDiffFQD); }
+    mgr->AddTask(taskFQD);
+  }
   if (MCEP){
     if (QA) { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kTRUE);}
     else { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kFALSE);}
@@ -618,6 +656,14 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     AliAnalysisDataContainer *coutputQC = 
       mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
   }
+  
+  if(FQD) {
+    TString outputFQD = "outputFQDanalysis";
+    outputFQD+= type;
+    outputFQD+= ".root";
+    AliAnalysisDataContainer *coutputFQD = 
+      mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
+  } 
 
   if(MCEP) {
     TString outputMCEP = "outputMCEPanalysis";
@@ -706,6 +752,19 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
       AliAnalysisDataContainer *coutputQA2QC = 
        mgr->CreateContainer("QAdiffQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffQC);
     }
+    if(FQD) { 
+      TString qaNameIntFQD = "QAforInt_FQD_";
+      qaNameIntFQD += type;
+      qaNameIntFQD += ".root";
+      AliAnalysisDataContainer *coutputQA1FQD = 
+       mgr->CreateContainer("QAintFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFQD);
+      
+      TString qaNameDiffFQD = "QAforDiff_FQD_";
+      qaNameDiffFQD += type;
+      qaNameDiffFQD += ".root";
+      AliAnalysisDataContainer *coutputQA2FQD = 
+       mgr->CreateContainer("QAdiffFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFQD);
+    }
     if(MCEP) {
       TString qaNameIntMCEP = "QAforInt_MCEP_";
       qaNameIntMCEP += type;
@@ -762,7 +821,13 @@ void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/data/alice
     mgr->ConnectOutput(taskQC,0,coutputQC);
     if (QA) { mgr->ConnectOutput(taskQC,1,coutputQA1QC);
     mgr->ConnectOutput(taskQC,2,coutputQA2QC); }
-  }  
+  }
+  if (FQD)   { 
+    mgr->ConnectInput(taskFQD,0,cinput1); 
+    mgr->ConnectOutput(taskFQD,0,coutputFQD);
+    if (QA) { mgr->ConnectOutput(taskFQD,1,coutputQA1FQD);
+    mgr->ConnectOutput(taskFQD,2,coutputQA2FQD); }
+  }    
   if (MCEP)  { 
     mgr->ConnectInput(taskMCEP,0,cinput1); 
     mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
index 1683d3e306f23f40307d861bea5cc99a8cdf9d9a..4bae2ef6d31e1ee27edce1fcbcd87199ea8d726f 100644 (file)
@@ -7,8 +7,9 @@
 // LYZ1  = Lee Yang Zeroes first run     (for PbPb)
 // LYZ2  = Lee Yang Zeroes second run    (for PbPb)
 // LYZEP = Lee Yang Zeroes Event Plane   (for PbPb)
-// GFC   = Cumulants                     (for PbPb or pp)
+// GFC   = Cumulants                     (for PbPb)
 // QC    = Q-cumulants                   (for PbPb or pp)
+// FQD   = Fitting q-distribution        (for PbPb)
 // MCEP  = Flow calculated from the real MC event plane (for PbPb only)
 //
 // The LYZ analysis should be done in the following order;
@@ -38,6 +39,7 @@ Bool_t LYZ2  = kFALSE;
 Bool_t LYZEP = kFALSE;
 Bool_t GFC   = kTRUE;
 Bool_t QC    = kTRUE;
+Bool_t FQD   = kTRUE;
 Bool_t MCEP  = kFALSE;
 
 //analysis type can be ESD, AOD, MC, ESDMC0, ESDMC1
@@ -74,11 +76,22 @@ const Int_t maxnsigmatovertex2 = 3;
 
 //ESD (pp)
 //void runProofFlow(const Char_t* data="/COMMON/COMMON/LHC08c11_10TeV_0.5T", Int_t nRuns=-1, Int_t offset=0) {
+//void runProofFlow(const Char_t* data="/COMMON/COMMON/LHC08c18_0.9TeV_0T_Phojet", Int_t nRuns=-1, Int_t offset=0) {
+
+
 //ESD (therminator)
-void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD", Int_t nRuns=-1, Int_t offset=0) {
-//AOD
-//  void runProofFlow(const Char_t* data="/PWG2/nkolk/myDataSet", Int_t nRuns=-1, Int_t offset=0) {
+//void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD", Int_t nRuns=-1, Int_t offset=0) {
+
+void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_c2030", Int_t nRuns=-1, Int_t offset=0) {
+//void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_central", Int_t nRuns=-1, Int_t offset=0) {
+
 
+//void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral", Int_t nRuns=-1, Int_t offset=0) {
+
+
+//AOD
+//void runProofFlow(const Char_t* data="/PWG2/nkolk/myDataSet", Int_t nRuns=-1, Int_t offset=0) {
+//void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_AOD", Int_t nRuns=-1, Int_t offset=0) {
 
   TStopwatch timer;
   timer.Start();
@@ -90,7 +103,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
   if (LYZ1 && LYZEP) {cout<<"WARNING: you cannot run LYZ1 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
 
   printf("*** Connect to PROOF ***\n");
-  TProof::Open("nkolk@alicecaf.cern.ch");
+  TProof::Open("abilandz@alicecaf.cern.ch");
   //TProof::Open("snelling@localhost");
  
   //gProof->UploadPackage("AF-v4-15"); 
@@ -137,6 +150,9 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (QC) {
       TList* qaIntQC = new TList();
       TList* qaDiffQC = new TList(); }
+    if (FQD) {
+      TList* qaIntFQD = new TList();
+      TList* qaDiffFQD = new TList(); }
     if (MCEP) {
       TList* qaIntMCEP = new TList();
       TList* qaDiffMCEP = new TList(); }
@@ -154,6 +170,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcKineCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcKineCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcKineCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcKineCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcKineCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -168,6 +185,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcKineCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcKineCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { mcKineCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { mcKineCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { mcKineCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -181,6 +199,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcGenCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcGenCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcGenCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcGenCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcGenCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -194,6 +213,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcGenCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcGenCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { mcGenCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { mcGenCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { mcGenCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -208,6 +228,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcAccCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { mcAccCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { mcAccCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { mcAccCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { mcAccCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -221,6 +242,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ mcAccCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { mcAccCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { mcAccCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { mcAccCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { mcAccCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -236,6 +258,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recKineCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recKineCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recKineCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recKineCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recKineCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -250,6 +273,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recKineCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recKineCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recKineCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recKineCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recKineCuts2->SetQAOn(qaDiffMCEP); }
   }
   
@@ -263,6 +287,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recQualityCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recQualityCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recQualityCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recQualityCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recQualityCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -276,6 +301,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recQualityCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recQualityCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recQualityCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recQualityCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recQualityCuts2->SetQAOn(qaDiffMCEP); }
   }
  
@@ -288,6 +314,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recIsPrimaryCuts1->SetQAOn(qaIntLYZEP); }
     if (GFC)  { recIsPrimaryCuts1->SetQAOn(qaIntGFC); }
     if (QC)   { recIsPrimaryCuts1->SetQAOn(qaIntQC); }
+    if (FQD)  { recIsPrimaryCuts1->SetQAOn(qaIntFQD); }
     if (MCEP) { recIsPrimaryCuts1->SetQAOn(qaIntMCEP); }
   }
   
@@ -300,6 +327,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (LYZEP){ recIsPrimaryCuts2->SetQAOn(qaDiffLYZEP); }
     if (GFC)  { recIsPrimaryCuts2->SetQAOn(qaDiffGFC); }
     if (QC)   { recIsPrimaryCuts2->SetQAOn(qaDiffQC); }
+    if (FQD)  { recIsPrimaryCuts2->SetQAOn(qaDiffFQD); }
     if (MCEP) { recIsPrimaryCuts2->SetQAOn(qaDiffMCEP); }
   }
  
@@ -357,6 +385,9 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     if (QC)  { 
       cutPID1->SetQAOn(qaIntQC); 
       cutPID2->SetQAOn(qaDiffQC); }
+    if (FQD)  { 
+      cutPID1->SetQAOn(qaIntFQD); 
+      cutPID2->SetQAOn(qaDiffFQD); }
     if (MCEP) { 
       cutPID1->SetQAOn(qaIntMCEP); 
       cutPID2->SetQAOn(qaDiffMCEP); }
@@ -439,7 +470,7 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     else {
       TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2");
       if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;}
-    }
+    }kTRUE;
     cout<<"LYZEP input file/list read..."<<endl;
   }
   
@@ -540,6 +571,17 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
       taskQC->SetQAList2(qaDiffQC); }
     mgr->AddTask(taskQC);
   }
+  if (FQD){
+    if (QA) { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kTRUE);}
+    else { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE);}
+    taskFQD->SetAnalysisType(type);
+    taskFQD->SetCFManager1(cfmgr1);
+    taskFQD->SetCFManager2(cfmgr2);
+    if (QA) { 
+      taskFQD->SetQAList1(qaIntFQD);
+      taskFQD->SetQAList2(qaDiffFQD); }
+    mgr->AddTask(taskFQD);
+  }
   if (MCEP){
     if (QA) { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kTRUE);}
     else { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kFALSE);}
@@ -604,6 +646,13 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     AliAnalysisDataContainer *coutputQC = mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
   }
   
+  if(FQD) {
+    TString outputFQD = "outputFQDanalysis";
+    outputFQD+= type;
+    outputFQD+= ".root";
+    AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
+  }
+
   if(MCEP) {
     TString outputMCEP = "outputMCEPanalysis";
     outputMCEP+= type;
@@ -691,6 +740,19 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
       AliAnalysisDataContainer *coutputQA2QC = 
        mgr->CreateContainer("QAdiffQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffQC);
     }
+    if(FQQ) { 
+      TString qaNameIntFQD = "QAforInt_FQD_";
+      qaNameIntFQD += type;
+      qaNameIntFQD += ".root";
+      AliAnalysisDataContainer *coutputQA1FQD = 
+       mgr->CreateContainer("QAintFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFQD);
+      
+      TString qaNameDiffFQD = "QAforDiff_FQD_";
+      qaNameDiffFQD += type;
+      qaNameDiffFQD += ".root";
+      AliAnalysisDataContainer *coutputQA2FQD = 
+       mgr->CreateContainer("QAdiffFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFQD);
+    }
     if(MCEP) {
       TString qaNameIntMCEP = "QAforInt_MCEP_";
       qaNameIntMCEP += type;
@@ -748,7 +810,13 @@ void runProofFlow(const Char_t* data="/PWG2/akisiel/Therminator_midcentral_ESD",
     mgr->ConnectOutput(taskQC,0,coutputQC);
     if (QA) { mgr->ConnectOutput(taskQC,1,coutputQA1QC);
     mgr->ConnectOutput(taskQC,2,coutputQA2QC); }
-  }  
+  }
+  if (FQD)   { 
+    mgr->ConnectInput(taskFQD,0,cinput1); 
+    mgr->ConnectOutput(taskFQD,0,coutputFQD);
+    if (QA) { mgr->ConnectOutput(taskFQD,1,coutputQA1FQD);
+    mgr->ConnectOutput(taskFQD,2,coutputQA2FQD); }
+  }    
   if (MCEP)  { 
     mgr->ConnectInput(taskMCEP,0,cinput1); 
     mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
index c5366e8a3bc773e75a6041f8c9680b46d637492f..ae0879ba396ec5f4bfdbdb15428158541e1a6138 100644 (file)
@@ -31,5 +31,8 @@
 #pragma link C++ class AliAnalysisTaskQCumulants+;
 #pragma link C++ class AliCumulantsFunctions+;
 #pragma link C++ class AliQCumulantsFunctions+;
+#pragma link C++ class AliFittingFunctionsForQDistribution+;
+#pragma link C++ class AliAnalysisTaskFittingQDistribution+;
+#pragma link C++ class AliFittingQDistribution+;
 
 #endif
index 0c6ccb544be17357437ceb859fed9b30fadadb51..06392dd9bf165437818dceb500599feb8d3e9c10 100644 (file)
@@ -18,14 +18,17 @@ SRCS= FLOW/AliFlowEventSimple.cxx \
       FLOW/AliFlowAnalysisWithLeeYangZeros.cxx \
       FLOW/AliFlowAnalysisWithCumulants.cxx \
       FLOW/AliFlowAnalysisWithQCumulants.cxx \
+      FLOW/AliFittingQDistribution.cxx \
       FLOW/AliCumulantsFunctions.cxx \
       FLOW/AliQCumulantsFunctions.cxx \
+      FLOW/AliFittingFunctionsForQDistribution.cxx \
       FLOW/AliAnalysisTaskScalarProduct.cxx \
       FLOW/AliAnalysisTaskMCEventPlane.cxx \
       FLOW/AliAnalysisTaskLYZEventPlane.cxx \
       FLOW/AliAnalysisTaskCumulants.cxx \
       FLOW/AliAnalysisTaskQCumulants.cxx \
-      FLOW/AliAnalysisTaskLeeYangZeros.cxx
+      FLOW/AliAnalysisTaskLeeYangZeros.cxx \
+      FLOW/AliAnalysisTaskFittingQDistribution.cxx
 
 HDRS= $(SRCS:.cxx=.h)