9 TString mcEngine =
"TGeant3",
11 Bool_t loadPostInitConfig =
false)
14 TString dir = getenv(
"VMCWORKDIR");
15 TString tutdir = dir +
"/simulation/Tutorial1";
17 TString tut_geomdir = dir +
"/common/geometry";
18 gSystem->Setenv(
"GEOMPATH", tut_geomdir.Data());
20 TString tut_configdir = dir +
"/common/gconfig";
21 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
23 TString partName[] = {
"pions",
"eplus",
"proton"};
24 Int_t partPdgC[] = {211, 11, 2212};
27 Double_t momentum = 2.;
31 TString outDir =
"./";
34 TString outFile = Form(
"%s/tutorial1_%s_%s.mc_p%1.3f_t%1.0f_n%d.root",
37 partName[chosenPart].Data(),
43 TString parFile = Form(
"%s/tutorial1_%s_%s.params_p%1.3f_t%1.0f_n%d.root",
46 partName[chosenPart].Data(),
51 TString geoFile =
"geofile_" + mcEngine +
"_full.root";
67 run->SetName(mcEngine);
69 if (loadPostInitConfig)
97 boxGen->
SetPRange(momentum, momentum + 0.01);
107 UInt_t randomSeed = 123456;
108 TRandom3 random(randomSeed);
118 parOut->
open(parFile.Data());
131 cout << endl << endl;
137 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
139 cout <<
"</DartMeasurement>" << endl;
142 Double_t rtime = timer.RealTime();
143 Double_t ctime = timer.CpuTime();
145 Float_t cpuUsage = ctime / rtime;
146 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
148 cout <<
"</DartMeasurement>" << endl;
150 cout << endl << endl;
151 cout <<
"Output file is " << outFile << endl;
152 cout <<
"Parameter file is " << parFile << endl;
153 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
"s" << endl << endl;
154 cout <<
"Macro finished successfully." << endl;
void run_tutorial1(Int_t nEvents=10, TString mcEngine="TGeant3", Bool_t isMT=true, Bool_t loadPostInitConfig=false)
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
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 UsePostInitConfig(bool useC=true, const char *stringC="g4ConfigPostInit.C")
virtual void Run(Int_t NEvents=0, Int_t NotUsed=0)
void AddModule(FairModule *Mod)
void SetSimulationConfig(FairGenericVMCConfig *tconf)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)