8 void run_tutorial2(Int_t nEvents = 10, TString mcEngine =
"TGeant3", Bool_t isMT =
true)
11 TString dir = getenv(
"VMCWORKDIR");
12 TString tutdir = dir +
"/simulation/Tutorial2";
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/tutorial2_%s.mc_p%1.3f_t%1.0f_n%d.root",
33 partName[chosenPart].Data(),
39 TString parFile = Form(
"%s/tutorial2_%s.params_p%1.3f_t%1.0f_n%d.root",
41 partName[chosenPart].Data(),
47 gRandom->SetSeed(98989);
63 run->SetName(mcEngine);
88 boxGen->
SetPRange(momentum, momentum + 0.01);
103 parOut->
open(parFile.Data());
115 cout << endl << endl;
121 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
123 cout <<
"</DartMeasurement>" << endl;
126 Double_t rtime = timer.RealTime();
127 Double_t ctime = timer.CpuTime();
129 Float_t cpuUsage = ctime / rtime;
130 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
132 cout <<
"</DartMeasurement>" << endl;
134 cout << endl << endl;
135 cout <<
"Output file is " << outFile << endl;
136 cout <<
"Parameter file is " << parFile << endl;
137 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
"s" << endl << endl;
138 cout <<
"Macro finished successfully." << endl;
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
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)
void run_tutorial2(Int_t nEvents=10, TString mcEngine="TGeant3", Bool_t isMT=true)
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 Run(Int_t NEvents=0, Int_t NotUsed=0)
void AddModule(FairModule *Mod)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)