end-of-line normalization
[u/mrichter/AliRoot.git] / PWGCF / EBYE / macros / runBalanceFunctionToyModel.C
index d2ca8f5..0042325 100644 (file)
-//=========Total multiplicity=========//\r
-Double_t nTotalMultiplicityMean = 100.;\r
-Double_t nTotalMultiplicitySigma = 10.;\r
-\r
-//=========Net charge=========//\r
-Double_t nNetChargeMean = 0.0;\r
-Double_t nNetChargeSigma = 3.0;\r
-\r
-//==============Particles and spectra==============//\r
-//Double_t gAllChargesTemperature = 0.11; //in GeV\r
-Double_t gAllChargesTemperature = 4.5; //not temperature==>modified hagedorn\r
-Double_t gPionPercentage = 0.8;\r
-Double_t gPionTemperature = 0.1; //in GeV\r
-Double_t gKaonPercentage = 0.12;\r
-Double_t gKaonTemperature = 0.12; //in GeV\r
-Double_t gProtonPercentage = 0.08;\r
-Double_t gProtonTemperature = 0.2; //in GeV\r
-//==============Particles and spectra==============//\r
-\r
-//==============Flow values==============//\r
-Double_t gDirectedFlow = 0.0;\r
-Double_t gEllipticFlow = 0.2;\r
-Double_t gTriangularFlow = 0.0;\r
-Double_t gQuandrangularFlow = 0.0;\r
-Double_t gPentangularFlow = 0.0;\r
-//==============Flow values==============//\r
-\r
-//=========Acceptance definition=========//\r
-Double_t gEtaMin = -1.0;\r
-Double_t gEtaMax = 1.0;\r
-Double_t gPtMin = 0.1;\r
-Double_t gPtMax = 20.0;\r
-//=========Acceptance definition=========//\r
-\r
-//=========Acceptance filter=========//\r
-Bool_t kUseAcceptanceFilter = kFALSE;\r
-const char *gAcceptanceFilterFile = "efficiencyALICE.root";\r
-//=========Acceptance filter=========//\r
-\r
-//=========Detector effects=========//\r
-Bool_t kSimulateDetectorEffects = kTRUE;\r
-Int_t fNumberOfInefficientSectors = 5;//inefficient secotrs in phi\r
-Double_t fInefficiencyFactorInPhi = 0.65;//efficiency factor < 1\r
-Int_t fNumberOfDeadSectors = 3;//number of dead sectors\r
-Bool_t fEfficiencyDropNearEtaEdges = kTRUE;//efficiency drop in eta edges\r
-//=========Detector effects=========//\r
-\r
-//=========Jets=========//\r
-Bool_t kUseJets = kFALSE;\r
-//=========Jets=========//\r
-\r
-//=========Dynamical Correlations=========//\r
-Bool_t kUseDynamicalCorrelations = kFALSE;\r
-Double_t gDynamicalCorrelationsPercentage = 0.1;\r
-//=========Dynamical Correlations=========//\r
-\r
-//=========bf object configuration=========//\r
-Bool_t kRunShuffling = kFALSE;\r
-Bool_t kRunMixing = kTRUE;\r
-Bool_t bResonancesCut = kFALSE;\r
-Bool_t bHBTcut = kFALSE;\r
-Bool_t bConversionCut = kFALSE;\r
-Bool_t bMomentumDifferenceCut = kFALSE;\r
-TString fArgEventClass = "EventPlane";\r
-Double_t deltaEtaMax = TMath::Abs(gEtaMax-gEtaMin);\r
-Bool_t bVertexBinning = kFALSE;\r
-//=========bf object configuration=========//\r
-\r
-//=========Debug option=========//\r
-Bool_t kUseDebug = kFALSE;\r
-//=========Debug option=========//\r
-\r
-// Run macro used for the toy model analysis\r
-// Author: Panos.Christakoglou@nikhef.nl\r
-\r
-//____________________________________________________________________\r
-void runBalanceFunctionToyModel(Int_t nEvents = 10,\r
-                               Bool_t kUseAllCharges = kTRUE) {\r
-  TStopwatch timer;\r
-  timer.Start();\r
-\r
-  // load libraries\r
-  gSystem->Load("libCore.so");        \r
-  gSystem->Load("libGeom.so");\r
-  gSystem->Load("libVMC.so");\r
-  gSystem->Load("libPhysics.so");\r
-  gSystem->Load("libTree.so");\r
-\r
-  gSystem->Load("libSTEERBase");\r
-  gSystem->Load("libESD");\r
-  gSystem->Load("libAOD");\r
-  gSystem->Load("libANALYSIS");\r
-  gSystem->Load("libANALYSISalice");\r
-  gSystem->Load("libEventMixing.so");\r
-  gSystem->Load("libCORRFW");\r
-  gSystem->Load("libPWGTools");\r
-  gSystem->Load("libPWGCFebye");\r
-\r
-  //configure the bf objects\r
-  gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C");\r
-  AliBalancePsi *bf  = GetBalanceFunctionObject("MC","",0,100,kRunShuffling,bResonancesCut,bHBTcut,bConversionCut,bMomentumDifferenceCut,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-  AliBalancePsi *bfm = 0x0;\r
-  if(kRunMixing) \r
-    bfm = GetBalanceFunctionObject("MC","",0,100,kRunShuffling,bResonancesCut,bHBTcut,bConversionCut,bMomentumDifferenceCut,fArgEventClass,deltaEtaMax,bVertexBinning);\r
-  \r
-  //Configure the toy model object\r
-  AliAnalysisTaskToyModel *toyModelAnalysis = new AliAnalysisTaskToyModel();\r
-  if(kUseDebug) toyModelAnalysis->SetDebugFlag();\r
-  toyModelAnalysis->SetAnalysisObject(bf);\r
-  if(kRunMixing)\r
-    toyModelAnalysis->SetMixingObject(bfm);\r
-  toyModelAnalysis->SetTotalMultiplicity(nTotalMultiplicityMean,nTotalMultiplicitySigma);\r
-  toyModelAnalysis->SetNetCharge(nNetChargeMean,nNetChargeSigma);\r
-  toyModelAnalysis->SetKinematicsCutsMC(gPtMin,gPtMax,gEtaMin,gEtaMax);\r
-\r
-  if(kUseAllCharges) {\r
-    toyModelAnalysis->SetSpectraTemperatureForAllCharges(gAllChargesTemperature);\r
-    toyModelAnalysis->SetDirectedFlowForAllCharges(gDirectedFlow);\r
-    toyModelAnalysis->SetEllipticFlowForAllCharges(gEllipticFlow);\r
-    toyModelAnalysis->SetTriangularFlowForAllCharges(gTriangularFlow);\r
-    toyModelAnalysis->SetQuandrangularFlowForAllCharges(gQuandrangularFlow);\r
-    toyModelAnalysis->SetPentangularFlowForAllCharges(gPentangularFlow);\r
-  }\r
-  else {\r
-    //Pions\r
-    toyModelAnalysis->SetPionPercentage(gPionPercentage);\r
-    toyModelAnalysis->SetSpectraTemperatureForPions(gPionTemperature);\r
-    toyModelAnalysis->SetDirectedFlowForPions(gDirectedFlow);\r
-    toyModelAnalysis->SetEllipticFlowForPions(gEllipticFlow);\r
-    toyModelAnalysis->SetTriangularFlowForPions(gTriangularFlow);\r
-    toyModelAnalysis->SetQuandrangularFlowForPions(gQuandrangularFlow);\r
-    toyModelAnalysis->SetPentangularFlowForPions(gPentangularFlow);\r
-\r
-    //Kaons\r
-    toyModelAnalysis->SetKaonPercentage(gKaonPercentage);\r
-    toyModelAnalysis->SetSpectraTemperatureForKaons(gKaonTemperature);\r
-    toyModelAnalysis->SetDirectedFlowForKaons(gDirectedFlow);\r
-    toyModelAnalysis->SetEllipticFlowForKaons(gEllipticFlow);\r
-    toyModelAnalysis->SetTriangularFlowForKaons(gTriangularFlow);\r
-    toyModelAnalysis->SetQuandrangularFlowForKaons(gQuandrangularFlow);\r
-    toyModelAnalysis->SetPentangularFlowForKaons(gPentangularFlow);\r
-\r
-    //Protons\r
-    toyModelAnalysis->SetProtonPercentage(gProtonPercentage);\r
-    toyModelAnalysis->SetSpectraTemperatureForProtons(gProtonTemperature);\r
-    toyModelAnalysis->SetDirectedFlowForProtons(gDirectedFlow);\r
-    toyModelAnalysis->SetEllipticFlowForProtons(gEllipticFlow);\r
-    toyModelAnalysis->SetTriangularFlowForProtons(gTriangularFlow);\r
-    toyModelAnalysis->SetQuandrangularFlowForProtons(gQuandrangularFlow);\r
-    toyModelAnalysis->SetPentangularFlowForProtons(gPentangularFlow);\r
-  }\r
-\r
-  //Jets\r
-  if(kUseJets)\r
-    toyModelAnalysis->SetUseJets();\r
-\r
-  //Dynamical correlations\r
-  if(kUseDynamicalCorrelations) \r
-    toyModelAnalysis->SetCorrelationPercentage(gDynamicalCorrelationsPercentage);\r
-\r
-  //Acceptance filter\r
-  if(kUseAcceptanceFilter) {\r
-    TFile *gParamFile = TFile::Open(gAcceptanceFilterFile);\r
-    if((!gParamFile) || (!gParamFile->IsOpen())) {\r
-      Printf("File %s not found!!!",acceptanceFilename);\r
-      return;\r
-    }\r
-\r
-    TString gParamName;\r
-    for(Int_t iCentrality = 0; iCentrality < numberOfCentralityBins; iCentrality++) {\r
-      gParamName = "gParamCentrality0";//centrality 0-5%\r
-      TF1 *gParameterization = dynamic_cast<TF1 *>(gParamFile->Get(gParamName.Data()));\r
-    }\r
-    toyModelAnalysis->SetAcceptanceParameterization(gParameterization);\r
-  }\r
-\r
-  //Detector effects\r
-  if(kSimulateDetectorEffects) \r
-    toyModelAnalysis->SimulateDetectorEffects();\r
-  if(fNumberOfInefficientSectors) {\r
-    toyModelAnalysis->SetNumberOfInefficientSectorsInPhi(fNumberOfInefficientSectors);\r
-    toyModelAnalysis->SetInefficiencyFactor(fInefficiencyFactorInPhi);\r
-  }\r
-  if(fNumberOfDeadSectors)\r
-    toyModelAnalysis->SetNumberOfDeadSectorsInPhi(fNumberOfDeadSectors);\r
-  if(fEfficiencyDropNearEtaEdges)\r
-    toyModelAnalysis->EnableEfficiencyDropNearEtaEdges();\r
-\r
-  //Initialize and run\r
-  toyModelAnalysis->Init();\r
-  toyModelAnalysis->CreateOutputObjects();\r
-  toyModelAnalysis->Run(nEvents);\r
-  toyModelAnalysis->FinishOutput();\r
-\r
-  // Print real and CPU time used for analysis:  \r
-  timer.Stop();\r
-  timer.Print();\r
-}\r
-\r
+//=========Total multiplicity=========//
+Double_t nTotalMultiplicityMean = 100.;
+Double_t nTotalMultiplicitySigma = 10.;
+
+//=========Net charge=========//
+Double_t nNetChargeMean = 0.0;
+Double_t nNetChargeSigma = 3.0;
+
+//==============Particles and spectra==============//
+//Double_t gAllChargesTemperature = 0.11; //in GeV
+Double_t gAllChargesTemperature = 4.5; //not temperature==>modified hagedorn
+Double_t gPionPercentage = 0.8;
+Double_t gPionTemperature = 0.1; //in GeV
+Double_t gKaonPercentage = 0.12;
+Double_t gKaonTemperature = 0.12; //in GeV
+Double_t gProtonPercentage = 0.08;
+Double_t gProtonTemperature = 0.2; //in GeV
+//==============Particles and spectra==============//
+
+//==============Flow values==============//
+Double_t gDirectedFlow = 0.0;
+Double_t gEllipticFlow = 0.2;
+Double_t gTriangularFlow = 0.0;
+Double_t gQuandrangularFlow = 0.0;
+Double_t gPentangularFlow = 0.0;
+//==============Flow values==============//
+
+//=========Acceptance definition=========//
+Double_t gEtaMin = -1.0;
+Double_t gEtaMax = 1.0;
+Double_t gPtMin = 0.1;
+Double_t gPtMax = 20.0;
+//=========Acceptance definition=========//
+
+//=========Acceptance filter=========//
+Bool_t kUseAcceptanceFilter = kFALSE;
+const char *gAcceptanceFilterFile = "efficiencyALICE.root";
+//=========Acceptance filter=========//
+
+//=========Detector effects=========//
+Bool_t kSimulateDetectorEffects = kTRUE;
+Int_t fNumberOfInefficientSectors = 5;//inefficient secotrs in phi
+Double_t fInefficiencyFactorInPhi = 0.65;//efficiency factor < 1
+Int_t fNumberOfDeadSectors = 3;//number of dead sectors
+Bool_t fEfficiencyDropNearEtaEdges = kTRUE;//efficiency drop in eta edges
+//=========Detector effects=========//
+
+//=========Jets=========//
+Bool_t kUseJets = kFALSE;
+//=========Jets=========//
+
+//=========Dynamical Correlations=========//
+Bool_t kUseDynamicalCorrelations = kFALSE;
+Double_t gDynamicalCorrelationsPercentage = 0.1;
+//=========Dynamical Correlations=========//
+
+//=========bf object configuration=========//
+Bool_t kRunShuffling = kFALSE;
+Bool_t kRunMixing = kTRUE;
+Bool_t bResonancesCut = kFALSE;
+Bool_t bHBTcut = kFALSE;
+Bool_t bConversionCut = kFALSE;
+Bool_t bMomentumDifferenceCut = kFALSE;
+TString fArgEventClass = "EventPlane";
+Double_t deltaEtaMax = TMath::Abs(gEtaMax-gEtaMin);
+Bool_t bVertexBinning = kFALSE;
+//=========bf object configuration=========//
+
+//=========Debug option=========//
+Bool_t kUseDebug = kFALSE;
+//=========Debug option=========//
+
+// Run macro used for the toy model analysis
+// Author: Panos.Christakoglou@nikhef.nl
+
+//____________________________________________________________________
+void runBalanceFunctionToyModel(Int_t nEvents = 10,
+                               Bool_t kUseAllCharges = kTRUE) {
+  TStopwatch timer;
+  timer.Start();
+
+  // load libraries
+  gSystem->Load("libCore.so");        
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libPhysics.so");
+  gSystem->Load("libTree.so");
+
+  gSystem->Load("libSTEERBase");
+  gSystem->Load("libESD");
+  gSystem->Load("libAOD");
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  gSystem->Load("libEventMixing.so");
+  gSystem->Load("libCORRFW");
+  gSystem->Load("libPWGTools");
+  gSystem->Load("libPWGCFebye");
+
+  //configure the bf objects
+  gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C");
+  AliBalancePsi *bf  = GetBalanceFunctionObject("MC","",0,100,kRunShuffling,bResonancesCut,bHBTcut,bConversionCut,bMomentumDifferenceCut,fArgEventClass,deltaEtaMax,bVertexBinning);
+  AliBalancePsi *bfm = 0x0;
+  if(kRunMixing) 
+    bfm = GetBalanceFunctionObject("MC","",0,100,kRunShuffling,bResonancesCut,bHBTcut,bConversionCut,bMomentumDifferenceCut,fArgEventClass,deltaEtaMax,bVertexBinning);
+  
+  //Configure the toy model object
+  AliAnalysisTaskToyModel *toyModelAnalysis = new AliAnalysisTaskToyModel();
+  if(kUseDebug) toyModelAnalysis->SetDebugFlag();
+  toyModelAnalysis->SetAnalysisObject(bf);
+  if(kRunMixing)
+    toyModelAnalysis->SetMixingObject(bfm);
+  toyModelAnalysis->SetTotalMultiplicity(nTotalMultiplicityMean,nTotalMultiplicitySigma);
+  toyModelAnalysis->SetNetCharge(nNetChargeMean,nNetChargeSigma);
+  toyModelAnalysis->SetKinematicsCutsMC(gPtMin,gPtMax,gEtaMin,gEtaMax);
+
+  if(kUseAllCharges) {
+    toyModelAnalysis->SetSpectraTemperatureForAllCharges(gAllChargesTemperature);
+    toyModelAnalysis->SetDirectedFlowForAllCharges(gDirectedFlow);
+    toyModelAnalysis->SetEllipticFlowForAllCharges(gEllipticFlow);
+    toyModelAnalysis->SetTriangularFlowForAllCharges(gTriangularFlow);
+    toyModelAnalysis->SetQuandrangularFlowForAllCharges(gQuandrangularFlow);
+    toyModelAnalysis->SetPentangularFlowForAllCharges(gPentangularFlow);
+  }
+  else {
+    //Pions
+    toyModelAnalysis->SetPionPercentage(gPionPercentage);
+    toyModelAnalysis->SetSpectraTemperatureForPions(gPionTemperature);
+    toyModelAnalysis->SetDirectedFlowForPions(gDirectedFlow);
+    toyModelAnalysis->SetEllipticFlowForPions(gEllipticFlow);
+    toyModelAnalysis->SetTriangularFlowForPions(gTriangularFlow);
+    toyModelAnalysis->SetQuandrangularFlowForPions(gQuandrangularFlow);
+    toyModelAnalysis->SetPentangularFlowForPions(gPentangularFlow);
+
+    //Kaons
+    toyModelAnalysis->SetKaonPercentage(gKaonPercentage);
+    toyModelAnalysis->SetSpectraTemperatureForKaons(gKaonTemperature);
+    toyModelAnalysis->SetDirectedFlowForKaons(gDirectedFlow);
+    toyModelAnalysis->SetEllipticFlowForKaons(gEllipticFlow);
+    toyModelAnalysis->SetTriangularFlowForKaons(gTriangularFlow);
+    toyModelAnalysis->SetQuandrangularFlowForKaons(gQuandrangularFlow);
+    toyModelAnalysis->SetPentangularFlowForKaons(gPentangularFlow);
+
+    //Protons
+    toyModelAnalysis->SetProtonPercentage(gProtonPercentage);
+    toyModelAnalysis->SetSpectraTemperatureForProtons(gProtonTemperature);
+    toyModelAnalysis->SetDirectedFlowForProtons(gDirectedFlow);
+    toyModelAnalysis->SetEllipticFlowForProtons(gEllipticFlow);
+    toyModelAnalysis->SetTriangularFlowForProtons(gTriangularFlow);
+    toyModelAnalysis->SetQuandrangularFlowForProtons(gQuandrangularFlow);
+    toyModelAnalysis->SetPentangularFlowForProtons(gPentangularFlow);
+  }
+
+  //Jets
+  if(kUseJets)
+    toyModelAnalysis->SetUseJets();
+
+  //Dynamical correlations
+  if(kUseDynamicalCorrelations) 
+    toyModelAnalysis->SetCorrelationPercentage(gDynamicalCorrelationsPercentage);
+
+  //Acceptance filter
+  if(kUseAcceptanceFilter) {
+    TFile *gParamFile = TFile::Open(gAcceptanceFilterFile);
+    if((!gParamFile) || (!gParamFile->IsOpen())) {
+      Printf("File %s not found!!!",acceptanceFilename);
+      return;
+    }
+
+    TString gParamName;
+    for(Int_t iCentrality = 0; iCentrality < numberOfCentralityBins; iCentrality++) {
+      gParamName = "gParamCentrality0";//centrality 0-5%
+      TF1 *gParameterization = dynamic_cast<TF1 *>(gParamFile->Get(gParamName.Data()));
+    }
+    toyModelAnalysis->SetAcceptanceParameterization(gParameterization);
+  }
+
+  //Detector effects
+  if(kSimulateDetectorEffects) 
+    toyModelAnalysis->SimulateDetectorEffects();
+  if(fNumberOfInefficientSectors) {
+    toyModelAnalysis->SetNumberOfInefficientSectorsInPhi(fNumberOfInefficientSectors);
+    toyModelAnalysis->SetInefficiencyFactor(fInefficiencyFactorInPhi);
+  }
+  if(fNumberOfDeadSectors)
+    toyModelAnalysis->SetNumberOfDeadSectorsInPhi(fNumberOfDeadSectors);
+  if(fEfficiencyDropNearEtaEdges)
+    toyModelAnalysis->EnableEfficiencyDropNearEtaEdges();
+
+  //Initialize and run
+  toyModelAnalysis->Init();
+  toyModelAnalysis->CreateOutputObjects();
+  toyModelAnalysis->Run(nEvents);
+  toyModelAnalysis->FinishOutput();
+
+  // Print real and CPU time used for analysis:  
+  timer.Stop();
+  timer.Print();
+}
+