#include <TParticle.h>
#include <TROOT.h>
#include <TRandom.h>
+#include <TMath.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "eposproc.h"
#include "EPOScommon.h"
+#include "AliGenEposIsajetToPdgConverter.h"
#include "TEpos.h"
using namespace std;
fBminim(0.0),
fBmaxim(10000.0),
fPhimin(0.0),
- fPhimax(2*3.1415927),
+ fPhimax(TMath::TwoPi()),
fEcms(-1),
fSplitting(kFALSE),
fNoDecays(),
- fExtraInputLines()
+ fExtraInputLines(),
+ fIdConverter()
{
+ fIdConverter=new AliGenEposIsajetToPdgConverter();
}
-TEpos::~TEpos() {}
+TEpos::TEpos(const TEpos&) : TGenerator("EPOS", "Epos event generator"),
+ fLaproj(0),
+ fMaproj(0),
+ fLatarg(0),
+ fMatarg(0),
+ fBminim(0.0),
+ fBmaxim(10000.0),
+ fPhimin(0.0),
+ fPhimax(TMath::TwoPi()),
+ fEcms(-1),
+ fSplitting(kFALSE),
+ fNoDecays(),
+ fExtraInputLines(),
+ fIdConverter()
+{
+ fIdConverter = new AliGenEposIsajetToPdgConverter();
+}
+
+TEpos::~TEpos() {
+ delete fIdConverter;
+}
+
+TEpos& TEpos::operator=(const TEpos&) {
+ if (!fIdConverter) {
+ fIdConverter = new AliGenEposIsajetToPdgConverter();
+ }
+ return *this;
+}
void TEpos::Initialize() {
Int_t nopeno = 0;
IniModel(appli.model);
ebin.nrebin = 1;
ainit();
+ aseed(2);
}
void TEpos::GenerateEvent() {
- cseed.seedj = gRandom->Rndm() * 1e10;
- aseed(2);
+// cseed.seedj = gRandom->Rndm() * 1e10;
Int_t n = 1;
evgen(n);
}
if (mother->GetFirstDaughter()==-1)
mother->SetFirstDaughter(iPart);
}
- TDatabasePDG *pdgDb = TDatabasePDG::Instance();
Int_t status = cptl.istptl[iPart] + 1;
- Int_t pdg = pdgDb->ConvertIsajetToPdg(cptl.idptl[iPart]);
- if (pdg == 0) {
- printf("TEpos: Warning, unknown particle, index: %d, ISAJET: %d\n",iPart,cptl.idptl[iPart]);
- }
+ Int_t pdg = fIdConverter->ConvertIsajetToPdg(cptl.idptl[iPart]);
new((*particles)[iPart]) TParticle(pdg, status,
tFather, -1, -1, -1,
cptl.pptl[iPart][0], cptl.pptl[iPart][1],cptl.pptl[iPart][2],cptl.pptl[iPart][3],
if (mother->GetFirstDaughter()==-1)
mother->SetFirstDaughter(iPart);
}
- TDatabasePDG *pdgDb = TDatabasePDG::Instance();
Int_t status = cptl.istptl[iPart] + 1;
- Int_t pdg = pdgDb->ConvertIsajetToPdg(cptl.idptl[iPart]);
- if (pdg == 0) {
- printf("TEpos: Warning, unknown particle, index: %d, ISAJET: %d\n",iPart,cptl.idptl[iPart]);
- }
+ Int_t pdg = fIdConverter->ConvertIsajetToPdg(cptl.idptl[iPart]);
TParticle* p = new TParticle(pdg, status,
tFather, -1, -1, -1,
cptl.pptl[iPart][0], cptl.pptl[iPart][1],cptl.pptl[iPart][2],cptl.pptl[iPart][3],
void TEpos::GenerateInputFile() {
ofstream file(GetInputFileName(), ios_base::out | ios_base::trunc);
char epo[256];
- strcpy(epo, getenv("ALICE_ROOT"));
+ char *epoEnv = getenv("EPO");
+ if (epoEnv) {
+ strcpy(epo, epoEnv);
+ } else {
+ strcpy(epo, getenv("ALICE_ROOT"));
+ }
strcat(epo, "/EPOS/epos167");
file << "fname pathnx " << epo << "/" << endl;
file << "fname copy none" << endl;
file << "fname log none" << endl;
file << "fname check none" << endl;
- file << "fname data /tmp/epos.out" << endl;
+// file << "fname data /tmp/epos.out" << endl;
file << "fname initl " << epo << "/epos.initl" << endl;
file << "fname inidi " << epo << "/epos.inidi" << endl;
file << "fname inidr " << epo << "/epos.inidr" << endl;
file << "echo on" << endl;
// .optns file
+ int precision = file.precision();
+ file.precision(15);
+ file << "set seedj " << (gRandom->Rndm() * 1e14) << endl;
+ file.precision(precision);
file << "application hadron" << endl;
file << "set laproj " << fLaproj << endl;
file << "set maproj " << fMaproj << endl;
file << fExtraInputLines[i] << endl;
}
- file << "output epos" << endl;
- file << "record event nevt nptl b endrecord" << endl;
- file << "record particle i id fa mo c1 c2 st endrecord" << endl;
+// file << "output epos" << endl;
+// file << "record event nevt nptl b endrecord" << endl;
+// file << "record particle i id fa mo c1 c2 st endrecord" << endl;
file << "input " << epo << "/epos.param" << endl;
file << "runprogram" << endl;