]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
better pt dependence simulation
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 May 2009 09:57:18 +0000 (09:57 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 May 2009 09:57:18 +0000 (09:57 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h
PWG2/FLOW/macros/compareFlowResults.C
PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C

index ab045fa379cd93a1548b747200d9cfb658f5f707..a5c3469eee12720e295dc52d8462a3ccf5b2dbe2 100644 (file)
@@ -27,7 +27,6 @@
 #include "TMath.h"
 #include "TF1.h"
 #include "TRandom3.h"
 #include "TMath.h"
 #include "TF1.h"
 #include "TRandom3.h"
-//#include "TUnuran.h"
 
 #include "AliFlowEventSimpleMakerOnTheFly.h"
 #include "AliFlowEventSimple.h"
 
 #include "AliFlowEventSimpleMakerOnTheFly.h"
 #include "AliFlowEventSimple.h"
@@ -42,6 +41,7 @@ ClassImp(AliFlowEventSimpleMakerOnTheFly)
 AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fMultiplicityOfRP(0),
   fMultiplicitySpreadOfRP(0.),
 AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fMultiplicityOfRP(0),
   fMultiplicitySpreadOfRP(0.),
+  fTemperatureOfRP(0.),  
   fUseConstantHarmonics(kFALSE),
   fV1RP(0.), 
   fV1SpreadRP(0.), 
   fUseConstantHarmonics(kFALSE),
   fV1RP(0.), 
   fV1SpreadRP(0.), 
@@ -60,9 +60,6 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   // constructor
   fMyTRandom3 = new TRandom3(iseed);   
   gRandom->SetSeed(fMyTRandom3->Integer(65539));
   // constructor
   fMyTRandom3 = new TRandom3(iseed);   
   gRandom->SetSeed(fMyTRandom3->Integer(65539));
-  //fMyUnuran = new TUnuran(); 
-  //fMyUnuran->SetSeed(iseed);  
  }
 
 
  }
 
 
@@ -84,13 +81,14 @@ AliFlowEventSimpleMakerOnTheFly::~AliFlowEventSimpleMakerOnTheFly()
 void AliFlowEventSimpleMakerOnTheFly::Init()
 {
  // define the pt spectra and phi distribution
 void AliFlowEventSimpleMakerOnTheFly::Init()
 {
  // define the pt spectra and phi distribution
- // pt spectra:   
+
+ // pt spectra of pions (Boltzman):   
  Double_t dPtMin = 0.; // to be improved (move this to the body of contstructor?)
  Double_t dPtMax = 10.; // to be improved (move this to the body of contstructor?) 
   
  Double_t dPtMin = 0.; // to be improved (move this to the body of contstructor?)
  Double_t dPtMax = 10.; // to be improved (move this to the body of contstructor?) 
   
- fPtSpectra = new TF1("fPtSpectra","[0]*x*TMath::Exp(-x*x)",dPtMin,dPtMax);  
+ fPtSpectra = new TF1("fPtSpectra","[0]*x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/[1])",dPtMin,dPtMax);  
  fPtSpectra->SetParName(0,"Multiplicity of RPs");  
  fPtSpectra->SetParName(0,"Multiplicity of RPs");  
+ fPtSpectra->SetParName(1,"Temperature of RPs");
  
  // phi distribution:
  Double_t dPhiMin = 0.; // to be improved (move this to the body of contstructor?)
  
  // phi distribution:
  Double_t dPhiMin = 0.; // to be improved (move this to the body of contstructor?)
@@ -116,6 +114,9 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
   if(fMultiplicitySpreadOfRP>0.0) iNewMultiplicityOfRP = (Int_t)fMyTRandom3->Gaus(fMultiplicityOfRP,fMultiplicitySpreadOfRP);
   fPtSpectra->SetParameter(0,iNewMultiplicityOfRP);
   
   if(fMultiplicitySpreadOfRP>0.0) iNewMultiplicityOfRP = (Int_t)fMyTRandom3->Gaus(fMultiplicityOfRP,fMultiplicitySpreadOfRP);
   fPtSpectra->SetParameter(0,iNewMultiplicityOfRP);
   
+  // set the 'temperature' of RPs
+  fPtSpectra->SetParameter(1,fTemperatureOfRP);  
+  
   // sampling the reaction plane
   Double_t dMCReactionPlaneAngle = fMyTRandom3->Uniform(0.,TMath::TwoPi());
   fPhiDistribution->SetParameter(2,dMCReactionPlaneAngle);
   // sampling the reaction plane
   Double_t dMCReactionPlaneAngle = fMyTRandom3->Uniform(0.,TMath::TwoPi());
   fPhiDistribution->SetParameter(2,dMCReactionPlaneAngle);
index 99f0fedf2a488685380b227f6a28b57bd440a9cd..ca0f76706ad3eb132d03d1e752d5d221897dc7fa 100644 (file)
@@ -19,7 +19,6 @@
 
 class TF1;
 class TRandom3;
 
 class TF1;
 class TRandom3;
-//class TUnuran;
 
 #include "AliFlowEventSimple.h"  //needed as include
     
 
 #include "AliFlowEventSimple.h"  //needed as include
     
@@ -46,6 +45,9 @@ class AliFlowEventSimpleMakerOnTheFly {
   void SetMultiplicitySpreadOfRP(Double_t multSpreadRP) {this->fMultiplicitySpreadOfRP = multSpreadRP;}
   Double_t GetMultiplicitySpreadOfRP() const {return this->fMultiplicitySpreadOfRP;} 
   
   void SetMultiplicitySpreadOfRP(Double_t multSpreadRP) {this->fMultiplicitySpreadOfRP = multSpreadRP;}
   Double_t GetMultiplicitySpreadOfRP() const {return this->fMultiplicitySpreadOfRP;} 
   
+  void SetTemperatureOfRP(Double_t temperatureRP) {this->fTemperatureOfRP = temperatureRP;}
+  Double_t GetTemperatureOfRP() const {return this->fTemperatureOfRP;} 
+  
   void SetUseConstantHarmonics(Bool_t const uch) {this->fUseConstantHarmonics = uch;};
   Bool_t GetUseConstantHarmonics() const {return this->fUseConstantHarmonics;};
   
   void SetUseConstantHarmonics(Bool_t const uch) {this->fUseConstantHarmonics = uch;};
   Bool_t GetUseConstantHarmonics() const {return this->fUseConstantHarmonics;};
   
@@ -88,7 +90,8 @@ class AliFlowEventSimpleMakerOnTheFly {
   // global parameters:
   Int_t     fMultiplicityOfRP;       // multiplicity of RPs
   Double_t  fMultiplicitySpreadOfRP; // multiplicity spread of RPs 
   // global parameters:
   Int_t     fMultiplicityOfRP;       // multiplicity of RPs
   Double_t  fMultiplicitySpreadOfRP; // multiplicity spread of RPs 
-  Bool_t    fUseConstantHarmonics;      // harmonics V1, V2, V4... are constant (kTRUE) or functions of pt and eta (kFALSE)     
+  Double_t  fTemperatureOfRP;        // "temperature" of RPs in GeV/c (increase this parameter to get more high pt RPs) 
+  Bool_t    fUseConstantHarmonics;   // harmonics V1, V2, V4... are constant (kTRUE) or functions of pt and eta (kFALSE)     
   // constant harmonics: 
   Double_t  fV1RP;                   // directed flow of RPs
   Double_t  fV1SpreadRP;             // directed flow spread of RPs
   // constant harmonics: 
   Double_t  fV1RP;                   // directed flow of RPs
   Double_t  fV1SpreadRP;             // directed flow spread of RPs
@@ -108,7 +111,6 @@ class AliFlowEventSimpleMakerOnTheFly {
   //................................................................................................
   
   TRandom3* fMyTRandom3; // our TRandom3 generator
   //................................................................................................
   
   TRandom3* fMyTRandom3; // our TRandom3 generator
-  //TUnuran*  fMyUnuran;   // our TUnuran generator
   Int_t     fCount;      // count number of events 
   Int_t     fNoOfLoops;  // number of times to use the same particle (nonflow)
 
   Int_t     fCount;      // count number of events 
   Int_t     fNoOfLoops;  // number of times to use the same particle (nonflow)
 
index 793ef47efbbbf083cf17842f4af7ae5c2a69016c..5ec8442235536f7900327fd6cb994c2ab2d65615 100644 (file)
@@ -42,6 +42,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
   Bool_t plotQC6PtRP   = kFALSE; // not calculated yet
   Bool_t plotQC8PtRP   = kFALSE; // not calculated yet
   Bool_t plotLYZ2PtRP  = kTRUE;
   Bool_t plotQC6PtRP   = kFALSE; // not calculated yet
   Bool_t plotQC8PtRP   = kFALSE; // not calculated yet
   Bool_t plotLYZ2PtRP  = kTRUE;
+  Bool_t plotLYZEPPtRP = kTRUE;  
   
   // set here which methods will be plotted by default for differential flow (Eta,RP):
   Bool_t plotMCEtaRP    = kFALSE;
   
   // set here which methods will be plotted by default for differential flow (Eta,RP):
   Bool_t plotMCEtaRP    = kFALSE;
@@ -79,8 +80,8 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
   Bool_t plotGFC8PtPOI  = kTRUE;
   Bool_t plotQC2PtPOI   = kTRUE;
   Bool_t plotQC4PtPOI   = kTRUE;
   Bool_t plotGFC8PtPOI  = kTRUE;
   Bool_t plotQC2PtPOI   = kTRUE;
   Bool_t plotQC4PtPOI   = kTRUE;
-  Bool_t plotQC6PtPOI   = kFALSE;
-  Bool_t plotQC8PtPOI   = kFALSE;
+  Bool_t plotQC6PtPOI   = kFALSE; // not calculated yet
+  Bool_t plotQC8PtPOI   = kFALSE; // not calculated yet
   Bool_t plotLYZ2PtPOI  = kTRUE;
   Bool_t plotLYZEPPtPOI = kTRUE; 
   
   Bool_t plotLYZ2PtPOI  = kTRUE;
   Bool_t plotLYZEPPtPOI = kTRUE; 
   
@@ -1885,7 +1886,6 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
 
  //----------------------------------------------------------------------------------
  //final drawing for differential flow (Pt, RP):
 
  //----------------------------------------------------------------------------------
  //final drawing for differential flow (Pt, RP):
- Bool_t plotLYZEPPtRP = kTRUE;  
  if(plotDiffFlowPtRP)
  {
   TCanvas* diffFlowPtAllCanvasRP = new TCanvas("Differential Flow (Pt) of RP","Differential Flow (Pt) of RP ",1000,600);
  if(plotDiffFlowPtRP)
  {
   TCanvas* diffFlowPtAllCanvasRP = new TCanvas("Differential Flow (Pt) of RP","Differential Flow (Pt) of RP ",1000,600);
@@ -2397,7 +2397,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnSP!=0.) 
     {
     }
     if(dvnMC!=0. && dvnSP!=0.) 
     {
-     spDiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnSP-dvnMC)/dvnMC));
+     spDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnSP-dvnMC)/dvnMC);
     }
     
     // GFC{2}:
     }
     
     // GFC{2}:
@@ -2408,7 +2408,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnGFC2!=0.) 
     {
     }
     if(dvnMC!=0. && dvnGFC2!=0.) 
     {
-     gfc2DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnGFC2-dvnMC)/dvnMC));
+     gfc2DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC2-dvnMC)/dvnMC);
     }
     
     // GFC{4}:
     }
     
     // GFC{4}:
@@ -2419,7 +2419,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnGFC4!=0.) 
     {
     }
     if(dvnMC!=0. && dvnGFC4!=0.) 
     {
-     gfc4DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnGFC4-dvnMC)/dvnMC));
+     gfc4DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC4-dvnMC)/dvnMC);
     }
     
     // GFC{6}:
     }
     
     // GFC{6}:
@@ -2430,7 +2430,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnGFC6!=0.) 
     {
     }
     if(dvnMC!=0. && dvnGFC6!=0.) 
     {
-     gfc6DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnGFC6-dvnMC)/dvnMC));
+     gfc6DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC6-dvnMC)/dvnMC);
     }
     
     // GFC{8}:
     }
     
     // GFC{8}:
@@ -2441,7 +2441,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnGFC8!=0.) 
     {
     }
     if(dvnMC!=0. && dvnGFC8!=0.) 
     {
-     gfc8DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnGFC8-dvnMC)/dvnMC));
+     gfc8DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnGFC8-dvnMC)/dvnMC);
     }
     
     // QC{2}:
     }
     
     // QC{2}:
@@ -2452,7 +2452,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnQC2!=0.) 
     {
     }
     if(dvnMC!=0. && dvnQC2!=0.) 
     {
-     qc2DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnQC2-dvnMC)/dvnMC));
+     qc2DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC2-dvnMC)/dvnMC);
     }
     
     // QC{4}:
     }
     
     // QC{4}:
@@ -2463,7 +2463,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnQC4!=0.) 
     {
     }
     if(dvnMC!=0. && dvnQC4!=0.) 
     {
-     qc4DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnQC4-dvnMC)/dvnMC));
+     qc4DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC4-dvnMC)/dvnMC);
     }
     
     // QC{6}:
     }
     
     // QC{6}:
@@ -2474,7 +2474,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnQC6!=0.) 
     {
     }
     if(dvnMC!=0. && dvnQC6!=0.) 
     {
-     qc6DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnQC6-dvnMC)/dvnMC));
+     qc6DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC6-dvnMC)/dvnMC);
     }
     
     // QC{8}:
     }
     
     // QC{8}:
@@ -2485,7 +2485,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnQC8!=0.) 
     {
     }
     if(dvnMC!=0. && dvnQC8!=0.) 
     {
-     qc8DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnQC8-dvnMC)/dvnMC));
+     qc8DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnQC8-dvnMC)/dvnMC);
     }
     
     // LYZ2:
     }
     
     // LYZ2:
@@ -2496,7 +2496,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnLYZ2!=0.) 
     {
     }
     if(dvnMC!=0. && dvnLYZ2!=0.) 
     {
-     lyz2DiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnLYZ2-dvnMC)/dvnMC));
+     lyz2DiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnLYZ2-dvnMC)/dvnMC);
     }
       
     // LYZEP:
     }
       
     // LYZEP:
@@ -2507,7 +2507,7 @@ void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
     }
     if(dvnMC!=0. && dvnLYZEP!=0.) 
     {
     }
     if(dvnMC!=0. && dvnLYZEP!=0.) 
     {
-     lyzepDiffFlowPtRelativeToMCRP->SetBinContent(p,TMath::Abs((dvnLYZEP-dvnMC)/dvnMC));
+     lyzepDiffFlowPtRelativeToMCRP->SetBinContent(p,(dvnLYZEP-dvnMC)/dvnMC);
     }  
  
    } // end of for(Int_t p=1;p<iNbinsPt+1;p++)
     }  
  
    } // end of for(Int_t p=1;p<iNbinsPt+1;p++)
index 3c7c06599e283216c5730c6b81c5b2e08d19677d..2213eb905fab6d3f06e008a69cff91d352598323 100644 (file)
@@ -8,8 +8,8 @@
 // flow analysis method can be: (set to kTRUE or kFALSE)
 Bool_t SP    = kTRUE;
 Bool_t LYZ1  = kTRUE;
 // flow analysis method can be: (set to kTRUE or kFALSE)
 Bool_t SP    = kTRUE;
 Bool_t LYZ1  = kTRUE;
-Bool_t LYZ2  = kFALSE;  
-Bool_t LYZEP = kFALSE; 
+Bool_t LYZ2  = kFALSE;
+Bool_t LYZEP = kFALSE;
 Bool_t GFC   = kTRUE;
 Bool_t QC    = kTRUE;
 Bool_t FQD   = kTRUE;
 Bool_t GFC   = kTRUE;
 Bool_t QC    = kTRUE;
 Bool_t FQD   = kTRUE;
@@ -17,18 +17,19 @@ Bool_t MCEP  = kTRUE;
 //--------------------------------------------------------------------------------------
 
 Bool_t bSameSeed = kFALSE; // use always the same seed for random generators
 //--------------------------------------------------------------------------------------
 
 Bool_t bSameSeed = kFALSE; // use always the same seed for random generators
-Bool_t bConstantHarmonics = kTRUE; // harmonics V1, V2, V4... are constant (kTRUE) or functions of pt and eta (kFALSE)
+Bool_t bConstantHarmonics = kFALSE; // harmonics V1, V2, V4... are constant (kTRUE) or functions of pt and eta (kFALSE)
 
 // Set the event parameters:
 Int_t iLoops = 1; // number of times to use each track (to simulate nonflow)
 
 Int_t iMultiplicityOfRP = 500; // multiplicity of RPs
 Double_t dMultiplicitySpreadOfRP = 0; // multiplicity spread of RPs
 
 // Set the event parameters:
 Int_t iLoops = 1; // number of times to use each track (to simulate nonflow)
 
 Int_t iMultiplicityOfRP = 500; // multiplicity of RPs
 Double_t dMultiplicitySpreadOfRP = 0; // multiplicity spread of RPs
+Double_t dTemperatureOfRP = 0.44; // 'temperature' of RPs in GeV/c (increase this parameter to get more high pt RPs) 
 
 //......................................................................................  
 // if you use (pt,eta) dependent harmonics (bConstantHarmonics = kFALSE):
 Double_t dPtCutOff = 2.0; // V2(pt) is linear up to pt = 2 GeV and for pt > 2 GeV it is constant: V2(pt) = dVRPMax
 
 //......................................................................................  
 // if you use (pt,eta) dependent harmonics (bConstantHarmonics = kFALSE):
 Double_t dPtCutOff = 2.0; // V2(pt) is linear up to pt = 2 GeV and for pt > 2 GeV it is constant: V2(pt) = dVRPMax
-Double_t dV2RPMax = 0.2; // maximum value of V2(pt) for pt >= 2GeV
+Double_t dV2RPMax = 0.20; // maximum value of V2(pt) for pt >= 2GeV
 //...................................................................................... 
 
 //......................................................................................  
 //...................................................................................... 
 
 //......................................................................................  
@@ -48,7 +49,7 @@ enum anaModes {mLocal,mLocalSource,mLocalPAR};
 // mLocalPAR: Analyze data on your computer using root + PAR files
 // mLocalSource: Analyze data on your computer using root + source files
                                           
 // mLocalPAR: Analyze data on your computer using root + PAR files
 // mLocalSource: Analyze data on your computer using root + source files
                                           
-int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=1000)
+int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=100)
 {
  TStopwatch timer;
  timer.Start();
 {
  TStopwatch timer;
  timer.Start();
@@ -189,6 +190,7 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=1000)
  eventMakerOnTheFly->SetNoOfLoops(iLoops);
  eventMakerOnTheFly->SetMultiplicityOfRP(iMultiplicityOfRP);
  eventMakerOnTheFly->SetMultiplicitySpreadOfRP(dMultiplicitySpreadOfRP);
  eventMakerOnTheFly->SetNoOfLoops(iLoops);
  eventMakerOnTheFly->SetMultiplicityOfRP(iMultiplicityOfRP);
  eventMakerOnTheFly->SetMultiplicitySpreadOfRP(dMultiplicitySpreadOfRP);
+ eventMakerOnTheFly->SetTemperatureOfRP(dTemperatureOfRP);
 
  eventMakerOnTheFly->SetV1RP(dV1RP);
  eventMakerOnTheFly->SetV1SpreadRP(dV1SpreadRP);  
 
  eventMakerOnTheFly->SetV1RP(dV1RP);
  eventMakerOnTheFly->SetV1SpreadRP(dV1SpreadRP);