11 TString dir = getenv(
"VMCWORKDIR");
12 TString tutdir = dir +
"/simulation/Tutorial1";
14 TString tut_geomdir = dir +
"/common/geometry";
15 gSystem->Setenv(
"GEOMPATH", tut_geomdir.Data());
17 TString tut_configdir = dir +
"/common/gconfig";
18 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
20 TString partName[] = {
"pions",
"eplus",
"proton"};
21 Int_t partPdgC[] = {211, 11, 2212};
24 Double_t momentum = 2.;
28 TString outDir =
"./";
31 TString outFile = Form(
"%s/tutorial1_%s_%s.mc_p%1.3f_t%1.0f_n%d.root",
34 partName[chosenPart].Data(),
40 TString parFile = Form(
"%s/tutorial1_%s_%s.params_p%1.3f_t%1.0f_n%d.root",
43 partName[chosenPart].Data(),
48 TString geoFile =
"geofile_" + mcEngine +
"_full.root";
64 run->SetName(mcEngine);
96 boxGen->
SetPRange(momentum, momentum + 0.01);
106 UInt_t randomSeed = 123456;
107 TRandom3 random(randomSeed);
112 gLogger->SetLogScreenLevel(
"info");
121 parOut->
open(parFile.Data());
134 cout << endl << endl;
140 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
142 cout <<
"</DartMeasurement>" << endl;
145 Double_t rtime = timer.RealTime();
146 Double_t ctime = timer.CpuTime();
148 Float_t cpuUsage = ctime / rtime;
149 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
151 cout <<
"</DartMeasurement>" << endl;
153 cout << endl << endl;
154 cout <<
"Output file is " << outFile << endl;
155 cout <<
"Parameter file is " << parFile << endl;
156 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
"s" << endl << endl;
157 cout <<
"Macro finished successfully." << endl;
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
void CreateGeometryFile(const char *geofile)
list of container factories
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void AddGenerator(FairGenerator *generator)
void SetGenerator(FairPrimaryGenerator *Gen)
void SetSink(FairSink *tempSink)
void SetIsMT(Bool_t isMT)
FairParRootFileIo * parOut
void run_tutorial1_fastsim(Int_t nEvents=10, TString mcEngine="TGeant3", Bool_t isMT=false)
FairRuntimeDb * GetRuntimeDb(void)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetMaterials(const char *MatFileName)
Bool_t setOutput(FairParIo *)
Bool_t open(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
virtual void Run(Int_t NEvents=0, Int_t NotUsed=0)
void AddModule(FairModule *Mod)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void SetStoreTraj(Bool_t storeTraj=kTRUE)