fSy2Coll(0.),
fSxyColl(0.),
fX(0.13),
- fNpp(8.)
+ fNpp(8.),
+ fDoPartProd(1)
{
fdNdEtaParam[0] = 8.0;
fdNdEtaParam[1] = 0.13;
fAN = fANucleus.GetN();
for (Int_t i = 0; i<fAN; i++)
{
- AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->At(i));
+ AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(i));
nucleonA->SetInNucleusA();
}
fBNucleus.ThrowNucleons(bgen/2.);
fBN = fBNucleus.GetN();
for (Int_t i = 0; i<fBN; i++)
{
- AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->At(i));
+ AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
nucleonB->SetInNucleusB();
}
// for each of the A nucleons in nucleus B
for (Int_t i = 0; i<fBN; i++)
{
- AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->At(i));
+ AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
for (Int_t j = 0 ; j < fAN ; j++)
{
- AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->At(j));
+ AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(j));
Double_t dx = nucleonB->GetX()-nucleonA->GetX();
Double_t dy = nucleonB->GetY()-nucleonA->GetY();
Double_t dij = dx*dx+dy*dy;
for (Int_t i = 0; i<fAN; i++)
{
- AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->At(i));
+ AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(i));
Double_t xA=nucleonA->GetX();
Double_t yA=nucleonA->GetY();
fMeanXSystem += xA;
for (Int_t i = 0; i<fBN; i++)
{
- AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->At(i));
+ AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
Double_t xB=nucleonB->GetX();
Double_t yB=nucleonB->GetY();
fMeanXSystem += xB;
allnucleons->SetOwner();
for (Int_t i = 0; i<fAN; i++)
{
- allnucleons->Add(fNucleonsA->At(i));
+ allnucleons->Add(fNucleonsA->UncheckedAt(i));
}
for (Int_t i = 0; i<fBN; i++)
{
- allnucleons->Add(fNucleonsB->At(i));
+ allnucleons->Add(fNucleonsB->UncheckedAt(i));
}
return allnucleons;
}
return TMath::BinarySearch(fMaxPlot,array,r)+2;
}
-
//______________________________________________________________________________
void AliGlauberMC::SetdNdEtaParam(Double_t nnp, Double_t x)
{
fdNdEtaGBWParam[1]=lambda;
fdNdEtaGBWParam[2]=snn;
}
+
//______________________________________________________________________________
void AliGlauberMC::SetdNdEtaNBDParam(Double_t k, Double_t nmean, Double_t beta)
{
fdNdEtaNBDParam[1]=nmean;
fdNdEtaNBDParam[2]=beta;
}
+
//______________________________________________________________________________
void AliGlauberMC::SetdNdEtaTwoNBDParam( Double_t k1,
Double_t nmean1,
fdNdEtaTwoNBDParam[4]=alpha;
fdNdEtaTwoNBDParam[5]=beta;
}
+
//______________________________________________________________________________
Double_t AliGlauberMC::GetdNdEta(Double_t nnp, Double_t x)
{
return fNpart*0.47*TMath::Sqrt(TMath::Power(snn,lambda))
* TMath::Power(fNpart,(1.-delta)/3./delta);
}
-//_______________________________________________________________________________
+//_______________________________________________________________________________
Double_t AliGlauberMC::GetdNdEtaNBD ( Int_t k, Double_t nmean, Double_t beta)
{
//Get particle density per unit of rapidity
}
return (1-beta)*mulnp/2+beta*mulnb;
}
-//______________________________________________________________________________
+//______________________________________________________________________________
Double_t AliGlauberMC::GetdNdEtaTwoNBD ( Int_t k1,
Double_t nmean1,
Int_t k2,
}
Double_t mul=(1-beta)*mulnp/2+beta*mulnb;
return mul;
-
}
+
//______________________________________________________________________________
Double_t AliGlauberMC::GetEccentricityPart() const
{
//get standard eccentricity of binary collisions
return ((fSy2Coll-fSx2Coll)/(fSy2Coll+fSx2Coll));
}
+
//______________________________________________________________________________
Bool_t AliGlauberMC::NextEvent(Double_t bgen)
{
if (fnt == 0)
{
fnt = new TNtuple(name,title,
- "Npart:Ncoll:B:MeanX:MeanY:MeanX2:MeanY2:MeanXY:VarX:VarY:VarXY:MeanXSystem:MeanYSystem:MeanXA:MeanYA:MeanXB:MeanYB:VarE:VarEColl:VarEPart:VarEPartColl:dNdEta:dNdEtaGBW:dNdEtaNBD:dNdEtaTwoNBD");
+ "Npart:Ncoll:B:MeanX:MeanY:MeanX2:MeanY2:MeanXY:VarX:VarY:VarXY:MeanXSystem:MeanYSystem:MeanXA:MeanYA:MeanXB:MeanYB:VarE:VarEColl:VarEPart:VarEPartColl:dNdEta:dNdEtaGBW:dNdEtaNBD:dNdEtaTwoNBD:xsect:tAA");
fnt->SetDirectory(0);
}
Int_t q = 0;
}
q++;
- Float_t v[25];
+ Float_t v[27];
v[0] = GetNpart();
v[1] = GetNcoll();
v[2] = fB_MC;
v[18] = GetEccentricityColl();
v[19] = GetEccentricityPart();
v[20] = GetEccentricityPartColl();
- v[21] = GetdNdEta( fdNdEtaParam[0],fdNdEtaParam[1] );
- v[22] = GetdNdEtaGBW( fdNdEtaGBWParam[0],fdNdEtaGBWParam[1],fdNdEtaGBWParam[2] );
- v[23] = GetdNdEtaNBD( TMath::Nint(fdNdEtaNBDParam[0]),
- fdNdEtaNBDParam[1],
- fdNdEtaNBDParam[2] );
- v[24] = GetdNdEtaTwoNBD( TMath::Nint(fdNdEtaTwoNBDParam[0]),
- fdNdEtaTwoNBDParam[1],
- TMath::Nint(fdNdEtaTwoNBDParam[2]),
- fdNdEtaTwoNBDParam[3],
- fdNdEtaTwoNBDParam[4],
- fdNdEtaTwoNBDParam[5] );
+ if (fDoPartProd) {
+ v[21] = GetdNdEta( fdNdEtaParam[0],fdNdEtaParam[1] );
+ v[22] = GetdNdEtaGBW( fdNdEtaGBWParam[0],fdNdEtaGBWParam[1],fdNdEtaGBWParam[2] );
+ v[23] = GetdNdEtaNBD( TMath::Nint(fdNdEtaNBDParam[0]),
+ fdNdEtaNBDParam[1],
+ fdNdEtaNBDParam[2] );
+ v[24] = GetdNdEtaTwoNBD( TMath::Nint(fdNdEtaTwoNBDParam[0]),
+ fdNdEtaTwoNBDParam[1],
+ TMath::Nint(fdNdEtaTwoNBDParam[2]),
+ fdNdEtaTwoNBDParam[3],
+ fdNdEtaTwoNBDParam[4],
+ fdNdEtaTwoNBDParam[5] );
+ } else {
+ v[21] = 0;
+ v[22] = 0;
+ v[23] = 0;
+ v[24] = 0;
+ }
+ v[25]=fXSect;
+
+ Float_t mytAA=-999;
+ if (GetNcoll()>0) mytAA=GetNcoll()/fXSect;
+ v[26]=mytAA;
fnt->Fill(v);
if ((i%50)==0) std::cout << "Generating Event # " << i << "... \r" << flush;
Option_t *sysB,
Double_t signn,
Double_t mind,
+ Double_t r,
+ Double_t a,
const char *fname)
{
AliGlauberMC mcg(sysA,sysB,signn);
mcg.SetMinDistance(mind);
+ mcg.Setr(r);
+ mcg.Seta(a);
mcg.Run(n);
TNtuple *nt=mcg.GetNtuple();
TFile out(fname,"recreate",fname,9);
if(nt) nt->Write();
+ printf("total cross section with a nucleon-nucleon cross section \t%f is \t%f",signn,mcg.GetTotXSect());
out.Close();
}
Int_t nNucls=nucleons->GetEntries();
for(Int_t iNucl=0; iNucl<nNucls; iNucl++)
{
- AliGlauberNucleon *nucl=(AliGlauberNucleon *)nucleons->At(iNucl);
+ AliGlauberNucleon *nucl=(AliGlauberNucleon *)nucleons->UncheckedAt(iNucl);
Char_t nucleus='A';
if(nucl->IsInNucleusB()) nucleus='B';
Double_t x=nucl->GetX();
e.SetLineWidth(1);
for (Int_t i = 0;i<fNucleons->GetEntries();++i) {
- AliGlauberNucleon* gn = (AliGlauberNucleon*) fNucleons->At(i);
+ AliGlauberNucleon* gn = (AliGlauberNucleon*) fNucleons->UncheckedAt(i);
e.SetLineStyle(1);
if (gn->IsSpectator()) e.SetLineStyle(3);
e.DrawEllipse(gn->GetX(),gn->GetY(),r,r,0,360,0,"");
Double_t ctheta = 2*gRandom->Rndm() - 1 ;
Double_t stheta = sqrt(1-ctheta*ctheta);
- AliGlauberNucleon *nucleon1=(AliGlauberNucleon*)(fNucleons->At(0));
- AliGlauberNucleon *nucleon2=(AliGlauberNucleon*)(fNucleons->At(1));
+ AliGlauberNucleon *nucleon1=(AliGlauberNucleon*)(fNucleons->UncheckedAt(0));
+ AliGlauberNucleon *nucleon2=(AliGlauberNucleon*)(fNucleons->UncheckedAt(1));
nucleon1->Reset();
nucleon1->SetXYZ(r * stheta * cos(phi) + xshift,
r * stheta * sin(phi),
}
for (Int_t i = 0; i<fN; i++) {
- AliGlauberNucleon *nucleon=(AliGlauberNucleon*)(fNucleons->At(i));
+ AliGlauberNucleon *nucleon=(AliGlauberNucleon*)(fNucleons->UncheckedAt(i));
nucleon->Reset();
while(1) {
fTrials++;
if(fMinDist<0) break;
Bool_t test=1;
for (Int_t j = 0; j<i; j++) {
- AliGlauberNucleon *other=(AliGlauberNucleon*)fNucleons->At(j);
+ AliGlauberNucleon *other=(AliGlauberNucleon*)fNucleons->UncheckedAt(j);
Double_t xo=other->GetX();
Double_t yo=other->GetY();
Double_t zo=other->GetZ();
sumy = sumy/fN;
sumz = sumz/fN;
for (Int_t i = 0; i<fN; i++) {
- AliGlauberNucleon *nucleon=(AliGlauberNucleon*)(fNucleons->At(i));
+ AliGlauberNucleon *nucleon=(AliGlauberNucleon*)(fNucleons->UncheckedAt(i));
nucleon->SetXYZ(nucleon->GetX()-sumx-xshift,
nucleon->GetY()-sumy,
nucleon->GetZ()-sumz);