added uniform flow fluctuations
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 May 2009 10:22:18 +0000 (10:22 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 May 2009 10:22:18 +0000 (10:22 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h
PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C

index d0490b8..84d3edf 100644 (file)
@@ -48,8 +48,11 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fUseConstantHarmonics(kFALSE),
   fV1RP(0.), 
   fV1SpreadRP(0.), 
+  fV2DistrOfRPsIsGauss(kFALSE),
   fV2RP(0.), 
   fV2SpreadRP(0.), 
+  fMinV2RP(0.),
+  fMaxV2RP(0.),
   fV4RP(0.), 
   fV4SpreadRP(0.), 
   fV2RPMax(0.), 
@@ -58,7 +61,7 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fPhiDistribution(NULL),
   fMyTRandom3(NULL),
   fCount(0),
-  fNoOfLoops(1) 
+  fNoOfLoops(1)
 {
   // constructor
   fMyTRandom3 = new TRandom3(iseed);   
@@ -102,7 +105,7 @@ void AliFlowEventSimpleMakerOnTheFly::Init()
  fPhiDistribution->SetParName(1,"elliptic flow"); 
  fPhiDistribution->SetParName(2,"Reaction Plane");
  fPhiDistribution->SetParName(3,"harmonic 4"); // to be improved (name)
+
 }
 
 //========================================================================
@@ -145,8 +148,22 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
   if(fUseConstantHarmonics)
   {
    Double_t dNewV2RP = fV2RP;
-   if(fV2SpreadRP>0.0) dNewV2RP = fMyTRandom3->Gaus(fV2RP,fV2SpreadRP);
-   fPhiDistribution->SetParameter(1,dNewV2RP);
+   if(fV2DistrOfRPsIsGauss)
+   {
+    if(fV2SpreadRP>0.0) dNewV2RP = fMyTRandom3->Gaus(fV2RP,fV2SpreadRP);
+    fPhiDistribution->SetParameter(1,dNewV2RP);
+   } else 
+     {
+      if(fMinV2RP != fMaxV2RP) 
+      {
+       dNewV2RP = fMyTRandom3->Uniform(fMinV2RP,fMaxV2RP);    
+       fPhiDistribution->SetParameter(1,dNewV2RP);  
+      } else
+        {
+         dNewV2RP = fMinV2RP;
+         fPhiDistribution->SetParameter(1,dNewV2RP);          
+        }
+     } 
   }
   
   // sampling the V4:
index 888120e..78121a4 100644 (file)
@@ -67,12 +67,21 @@ class AliFlowEventSimpleMakerOnTheFly {
   void SetV1SpreadRP(Double_t dV1SpreadRP) {this->fV1SpreadRP = dV1SpreadRP;}
   Double_t GetV1SpreadRP() const {return this->fV1SpreadRP;} 
   
+  void SetV2DistrOfRPsIsGauss(Bool_t const v2dorig) {this->fV2DistrOfRPsIsGauss = v2dorig;};
+  Bool_t GetV2DistrOfRPsIsGauss() const {return this->fV2DistrOfRPsIsGauss;};
+  
   void SetV2RP(Double_t dV2RP) {this->fV2RP = dV2RP;}
   Double_t GetV2RP() const {return this->fV2RP;} 
   
   void SetV2SpreadRP(Double_t dV2SpreadRP) {this->fV2SpreadRP = dV2SpreadRP;}
   Double_t GetV2SpreadRP() const {return this->fV2SpreadRP;} 
   
+  void SetMinV2RP(Double_t dMinV2RP) {this->fMinV2RP = dMinV2RP;}
+  Double_t GetMinV2RP() const {return this->fMinV2RP;} 
+  
+  void SetMaxV2RP(Double_t dMaxV2RP) {this->fMaxV2RP = dMaxV2RP;}
+  Double_t GetMaxV2RP() const {return this->fMaxV2RP;} 
+  
   void SetV4RP(Double_t dV4RP) {this->fV4RP = dV4RP;}
   Double_t GetV4RP() const {return this->fV4RP;} 
   
@@ -110,8 +119,16 @@ class AliFlowEventSimpleMakerOnTheFly {
   // constant harmonics: 
   Double_t  fV1RP;                   // directed flow of RPs
   Double_t  fV1SpreadRP;             // directed flow spread of RPs
-  Double_t  fV2RP;                   // elliptic flow of RPs
-  Double_t  fV2SpreadRP;             // elliptic flow spread of RPs
+  
+  Bool_t    fV2DistrOfRPsIsGauss;    // 1.) if kTRUE  = elliptic flow of RPs is sampled e-b-e from Gaussian distribution with
+                                     //                 mean = fV2RP and spread = fV2SpreadRP
+                                     // 2.) if kFALSE = elliptic flow of RPs is sampled e-b-e uniformly from 
+                                     //                 interval [fMinV2RP,fMaxV2RP]
+  Double_t  fV2RP;                   // mean elliptic flow of RPs (if sampled from Gaussian)
+  Double_t  fV2SpreadRP;             // elliptic flow spread of RPs (if sampled from Gaussian)
+  Double_t  fMinV2RP;                // minimal elliptic flow of RPs (if sampled uniformly)
+  Double_t  fMaxV2RP;                // minimal elliptic flow of RPs (if sampled uniformly)
+  
   Double_t  fV4RP;                   // harmonic V4 of RPs
   Double_t  fV4SpreadRP;             // harmonic V4's spread of RPs
   // (pt,eta) dependent harmonics:
@@ -129,7 +146,6 @@ class AliFlowEventSimpleMakerOnTheFly {
   Int_t     fCount;      // count number of events 
   Int_t     fNoOfLoops;  // number of times to use the same particle (nonflow)
   
-
   ClassDef(AliFlowEventSimpleMakerOnTheFly,0) // macro for rootcint
 };
  
index 4856f5b..c0ebcf3 100644 (file)
@@ -32,12 +32,18 @@ Bool_t bConstantHarmonics = kTRUE; // harmonics V1, V2, V4... are constant (kTRU
 
 Int_t iLoops = 1; // number of times to use each track (to simulate nonflow)
 
-Bool_t bMultDistrOfRPsIsGauss = kTRUE; // 1.) if kTRUE  = multiplicitiy of RPs is sampled e-b-e from Gaussian distribution with
+Bool_t bMultDistrOfRPsIsGauss = kFALSE; // 1.) if kTRUE  = multiplicitiy of RPs is sampled e-b-e from Gaussian distribution with
                                         //                 mean = iMultiplicityOfRP and spread = dMultiplicitySpreadOfRP
                                         // 2.) if kFALSE = multiplicitiy of RPs is sampled e-b-e uniformly from 
                                         //                 interval [iMinMultOfRP,iMaxMultOfRP]
                                         // 3.) for a fixed multiplicity use Gaussian with zero spread or use uniform with iMinMult=iMaxMult
-                                         
+                                        
+Bool_t bV2DistrOfRPsIsGauss = kFALSE; // 1.) if kTRUE  = elliptic flow of RPs is sampled e-b-e from Gaussian distribution with
+                                      //                 mean = dV2RP and spread = dV2SpreadRP
+                                      // 2.) if kFALSE = elliptic flow of RPs is sampled e-b-e uniformly from 
+                                      //                 interval [dMinV2RP,dMaxV2RP]
+                                      // 3.) for a fixed elliptic flow use Gaussian with zero spread or use uniform with dMinV2RP=dMaxV2RP
+                                                                                   
 Int_t iMultiplicityOfRP = 500;        // mean multiplicity of RPs (if sampled from Gaussian)
 Double_t dMultiplicitySpreadOfRP = 0; // multiplicity spread of RPs (if sampled from Gaussian)
 Int_t iMinMultOfRP = 400;             // minimal multiplicity of RPs (if sampled uniformly)
@@ -52,9 +58,11 @@ Double_t dV2RPMax = 0.20; // maximum value of V2(pt) for pt >= 2GeV
 //...................................................................................... 
 
 //......................................................................................  
-// if you use constant harmonics (bConstantHarmonics = kTRUE):
-Double_t dV2RP = 0.05; // elliptic flow of RPs
-Double_t dV2SpreadRP = 0.; // elliptic flow spread of RPs
+// if you use constant harmonics (bConstantHarmonics = kTRUE) (i.e. no pt dependence):
+Double_t dV2RP = 0.05;       // elliptic flow of RPs (if sampled from Gaussian)
+Double_t dV2SpreadRP = 0.0;  // elliptic flow spread of RPs (if sampled from Gaussian)
+Double_t dMinV2RP = 0.04;    // minimal elliptic flow of RPs (if sampled uniformly)
+Double_t dMaxV2RP = 0.06;    // maximal elliptic flow of RPs (if sampled uniformly)
 
 Double_t dV1RP = 0.0; // directed flow of RPs
 Double_t dV1SpreadRP = 0.0; // directed flow spread of RPs
@@ -257,8 +265,17 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=440)
  if(bConstantHarmonics)
  { 
   eventMakerOnTheFly->SetUseConstantHarmonics(bConstantHarmonics);
-  eventMakerOnTheFly->SetV2RP(dV2RP);
-  eventMakerOnTheFly->SetV2SpreadRP(dV2SpreadRP);  
+  if(bV2DistrOfRPsIsGauss)
+  {
+   eventMakerOnTheFly->SetV2DistrOfRPsIsGauss(bV2DistrOfRPsIsGauss);
+   eventMakerOnTheFly->SetV2RP(dV2RP);
+   eventMakerOnTheFly->SetV2SpreadRP(dV2SpreadRP);  
+  } else
+    {
+     eventMakerOnTheFly->SetV2DistrOfRPsIsGauss(bV2DistrOfRPsIsGauss);
+     eventMakerOnTheFly->SetMinV2RP(dMinV2RP);
+     eventMakerOnTheFly->SetMaxV2RP(dMaxV2RP);  
+    }
  }
  // (pt,eta) dependent harmonic V2:
  if(!bConstantHarmonics)