// from AliRoot
#include "AliFastGlauber.h"
// from root
-#include <Riostream.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TF2.h>
#include <TH2F.h>
#include <TLegend.h>
#include <TMath.h>
-#include <TROOT.h>
#include <TRandom.h>
#include <TStyle.h>
TF2* AliFastGlauber::fgWAlmondCurrent = NULL;
TF2* AliFastGlauber::fgWAlmondFixedB[40];
const Int_t AliFastGlauber::fgkMCInts = 100000;
-Int_t AliFastGlauber::fgCounter = 0;
+AliFastGlauber* AliFastGlauber::fgGlauber = NULL;
+
AliFastGlauber::AliFastGlauber():
fWSr0(0.),
fName()
{
// Default Constructor
- fgCounter++;
- if(fgCounter>1)
- Error("AliFastGlauber","More than one instance (%d) is not supported, check your code!",fgCounter);
-
// Defaults for Pb
SetMaxImpact();
SetLengthDefinition();
SetPbPbLHC();
+ fXY[0] = fXY[1] = 0;
+ fI0I1[0] = fI0I1[1] = 0;
}
AliFastGlauber::AliFastGlauber(const AliFastGlauber & gl)
{
// Copy constructor
gl.Copy(*this);
+ fXY[0] = fXY[1] = 0;
+ fI0I1[0] = fI0I1[1] = 0;
+}
+
+AliFastGlauber* AliFastGlauber::Instance()
+{
+// Set random number generator
+ if (fgGlauber) {
+ return fgGlauber;
+ } else {
+ fgGlauber = new AliFastGlauber();
+ return fgGlauber;
+ }
}
AliFastGlauber::~AliFastGlauber()
{
// Destructor
- fgCounter--;
for(Int_t k=0; k<40; k++) delete fgWAlmondFixedB[k];
}
fgWIntRadius->Draw("same");
}
-Double_t AliFastGlauber::WSb(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WSb(const Double_t* x, const Double_t* par)
{
//
// Woods-Saxon Parameterisation
return y; //fm^-3
}
-Double_t AliFastGlauber::WSbz(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WSbz(const Double_t* x, const Double_t* par)
{
//
// Wood Saxon Parameterisation
return y; //fm^-3
}
-Double_t AliFastGlauber::WSz(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WSz(const Double_t* x, const Double_t* par)
{
//
// Wood Saxon Parameterisation
return y; //fm^-3
}
-Double_t AliFastGlauber::WSta(Double_t* x, Double_t* /*par*/)
+Double_t AliFastGlauber::WSta(const Double_t* x, const Double_t* /*par*/)
{
//
// Thickness function T_A
return y; //fm^-2
}
-Double_t AliFastGlauber::WStarfi(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WStarfi(const Double_t* x, const Double_t* par)
{
//
// Kernel for overlap function: T_A(s)*T_A(s-b)
return y; //fm^-3
}
-Double_t AliFastGlauber::WStaa(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WStaa(const Double_t* x, const Double_t* par)
{
//
// Overlap function
return y;
}
-Double_t AliFastGlauber::WKParticipants(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WKParticipants(const Double_t* x, const Double_t* par)
{
//
// Kernel for number of participants
return y; //fm^-1
}
-Double_t AliFastGlauber::WParticipants(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WParticipants(const Double_t* x, const Double_t* par)
{
//
// Number of Participants as
return y; //no units
}
-Double_t AliFastGlauber::WSgeo(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WSgeo(const Double_t* x, const Double_t* par)
{
//
// Geometrical Cross-Section
return y; //fm
}
-Double_t AliFastGlauber::WSbinary(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WSbinary(const Double_t* x, const Double_t* par)
{
//
// Number of binary hard collisions
return y; //fm
}
-Double_t AliFastGlauber::WSN(Double_t* x, Double_t* /*par*/)
+Double_t AliFastGlauber::WSN(const Double_t* x, const Double_t* /*par*/)
{
//
// Number of hard processes per event
return y; //no units
}
-Double_t AliFastGlauber::WEnergyDensity(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WEnergyDensity(const Double_t* x, const Double_t* par)
{
//
// Initial energy density
return y; //fm^-4
}
-Double_t AliFastGlauber::WAlmond(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WAlmond(const Double_t* x, const Double_t* par)
{
//
// Almond shaped interaction region
return y; //fm^-4
}
-Double_t AliFastGlauber::WIntRadius(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WIntRadius(const Double_t* x, const Double_t* par)
{
//
// Average interaction density over radius
return y; //fm^-3
}
-Double_t AliFastGlauber::WPathLength0(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WPathLength0(const Double_t* x, const Double_t* par)
{
//
// Path Length as a function of phi
} // radial steps
Double_t y=0.;
- if (!kiopt) // My length definition (is exact for hard disk)
- if(w) y= 2. * rw / w;
- else {
- const Double_t knorm=fgWSta->Eval(1e-4);
- if(knorm) y = TMath::Sqrt(2. * rw * kDr / knorm / knorm);
+ if (!kiopt) { // My length definition (is exact for hard disk)
+ if(w) y= 2. * rw / w;
+ } else {
+ const Double_t knorm=fgWSta->Eval(1e-4);
+ if(knorm) y = TMath::Sqrt(2. * rw * kDr / knorm / knorm);
}
return y; //fm
}
-Double_t AliFastGlauber::WPathLength(Double_t* x, Double_t* par)
+Double_t AliFastGlauber::WPathLength(const Double_t* x, const Double_t* par)
{
//
// Path Length as a function of phi
return fgWSbinary->Integral(b1, b2)/fgWSbinary->Integral(0., 100.);
}
-Double_t AliFastGlauber::NHard(Double_t b1, Double_t b2) const
+Double_t AliFastGlauber::NHard(const Double_t b1, const Double_t b2) const
{
//
// Number of binary hard collisions
//
// Return number of binary hard collisions normalized to 1 at b=0
//
- if(b==0) b=1e-4;
+ if(b < 1.e-4) b = 1e-4;
return fgWSN->Eval(b)/fgWSN->Eval(1e-4);
}
//
// Return number of binary hard collisions at b
//
- if(b==0) b=1e-4;
+ if(b<1.e-4) b=1e-4;
return fgWSN->Eval(b);
}
//
// Return the number of participants normalized to 1 at b=0
//
- if(b==0) b=1e-4;
+ if(b<1.e-4) b=1e-4;
return (fgWParticipants->Eval(b)/fgWParticipants->Eval(1e-4));
}
//
// Return the number of participants for impact parameter b
//
- if(b==0) b=1e-4;
+ if(b<1.e-4) b=1e-4;
return (fgWParticipants->Eval(b));
}
//
// Return the number of collisions for impact parameter b
//
- if(b==0) b=1e-4;
+ if(b<1.e-4) b=1e-4;
return (fgWStaa->Eval(b)*fSigmaNN);
}