Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8309084
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
View Options
Index: trunk/macros/tools/runFlucs.C
===================================================================
--- trunk/macros/tools/runFlucs.C (revision 66)
+++ trunk/macros/tools/runFlucs.C (revision 67)
@@ -1,103 +1,103 @@
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "../runglauber.C"
#include <TProfile2D.h>
#endif
void runFlucs(const Int_t n,
const char *sysA,
const char *sysB,
const Double_t signn,
const Double_t mind,
const Double_t xsectsigma,
const char *fname)
{
TGlauberMC *mcg = new TGlauberMC(sysA,sysB,signn);
mcg->SetMinDistance(mind);
TF1 *fPTot = 0;
if (xsectsigma>0) {
fPTot = new TF1("fPTot","((x/[2])/(x/[2]+[0]))*exp(-(((x/[2])/[0]-1 )**2)/([1]*[1]))/[2]",0,300);
fPTot->SetParameters(signn,xsectsigma,1);
fPTot->SetNpx(1000);
fPTot->SetParameter(2,signn/fPTot->GetHistogram()->GetMean());
}
TFile *out = TFile::Open(fname,"recreate",fname,9);
if (!out)
return;
TNtuple *nt = new TNtuple("nt","nt",
"Npart:Ncoll:B:nc:np");
nt->SetDirectory(out);
const TGlauNucleus *nucA = mcg->GetNucleusA();
const Int_t AN = nucA->GetN();
Int_t *nA = new Int_t[AN];
Double_t *rbA = new Double_t[AN];
const TGlauNucleus *nucB = mcg-> GetNucleusB();
const Int_t BN = nucB->GetN();
Int_t *nB = new Int_t[BN];
Double_t *rbB = new Double_t[BN];
for (Int_t ev=0; ev<n; ++ev) {
while (!mcg->NextEvent());
for (Int_t i = 0; i<AN; ++i) {
nA[i] = 0;
if (fPTot)
rbA[i] = TMath::Sqrt(fPTot->GetRandom()/TMath::Pi()/10.)/2.;
else
rbA[i] = TMath::Sqrt(signn/TMath::Pi()/10.)/2.;
}
for (Int_t i = 0; i<BN; ++i) {
nB[i] = 0;
- //if (fPTot)
- // rbB[i] = TMath::Sqrt(fPTot->GetRandom()/TMath::Pi()/10.)/2.;
- //else
+ if (fPTot)
+ rbB[i] = TMath::Sqrt(fPTot->GetRandom()/TMath::Pi()/10.)/2.;
+ else
rbB[i] = TMath::Sqrt(signn/TMath::Pi()/10.)/2.;
}
const TObjArray *nucleonsA = nucA->GetNucleons();
const TObjArray *nucleonsB = nucB->GetNucleons();
Double_t ncoll2 = 0;
for (Int_t i = 0; i<AN; ++i) {
TGlauNucleon *nucleonA=(TGlauNucleon*)(nucleonsA->At(i));
for (Int_t j = 0; j<BN; ++j) {
TGlauNucleon *nucleonB=(TGlauNucleon*)(nucleonsB->At(j));
Double_t dx = nucleonB->GetX()-nucleonA->GetX();
Double_t dy = nucleonB->GetY()-nucleonA->GetY();
Double_t dij = dx*dx+dy*dy;
Double_t d = rbA[i]+rbB[j];
if (dij < d*d) {
nA[i]++;
nB[j]++;
++ncoll2;
}
}
}
Int_t npart2 = 0;
for (Int_t i = 0; i<AN; ++i) {
if (nA[i]==0)
continue;
++npart2;
}
for (Int_t i = 0; i<BN; ++i) {
if (nB[i]==0)
continue;
++npart2;
}
Float_t v[5]; Int_t f=0;
v[f++] = mcg->GetNpart();
v[f++] = mcg->GetNcoll();
v[f++] = mcg->GetB();
v[f++] = ncoll2;
v[f++] = npart2;
nt->Fill(v);
}
if (fPTot)
fPTot->Write();
out->Write();
out->Close();
delete out;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 21, 2:15 PM (8 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023082
Default Alt Text
(3 KB)
Attached To
rTGLAUBERMCSVN tglaubermcsvn
Event Timeline
Log In to Comment