8 void run_tutorial4(Int_t nEvents = 10, TString mcEngine =
"TGeant3", Bool_t doAlign =
true, Bool_t isMT =
false)
11 TString dir = getenv(
"VMCWORKDIR");
13 TString tut_configdir = dir +
"/simulation/Tutorial4/gconfig";
14 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
16 TString tut_geomdir = dir +
"/common/geometry";
17 gSystem->Setenv(
"GEOMPATH", tut_geomdir.Data());
19 Double_t momentum = 2.;
23 TString outDir =
"./data/";
30 outFile =
"testrun_align_";
31 geoFile =
"geoFile_align_";
32 parFile =
"testparams_align_";
36 parFile =
"testparams_";
38 outFile = outDir + outFile + mcEngine +
".root";
39 geoFile = outDir + geoFile + mcEngine +
".root";
40 parFile = outDir + parFile + mcEngine +
".root";
42 TList* parFileList =
new TList();
44 TString paramDir = dir +
"/simulation/Tutorial4/parameters/";
45 TString paramFile = paramDir +
"example.par";
47 TObjString* tutDetDigiFile =
new TObjString(paramFile);
48 parFileList->Add(tutDetDigiFile);
67 run->SetName(mcEngine);
95 boxGen->
SetPRange(momentum, momentum + 0.01);
97 boxGen->
SetBoxXYZ(-20., -20., 20., 20., 0.);
114 parOut->
open(parFile.Data());
115 parIn->
open(parFileList,
"in");
151 cout << endl << endl;
157 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
159 cout <<
"</DartMeasurement>" << endl;
162 Double_t rtime = timer.RealTime();
163 Double_t ctime = timer.CpuTime();
165 Float_t cpuUsage = ctime / rtime;
166 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
168 cout <<
"</DartMeasurement>" << endl;
170 cout << endl << endl;
171 cout <<
"Output file is " << outFile << endl;
172 cout <<
"Parameter file is " << parFile << endl;
173 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
"s" << endl << endl;
174 cout <<
"Macro finished successfully." << endl;
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
list of container factories
Bool_t open(const Text_t *fname, const Text_t *status="in")
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void AddGenerator(FairGenerator *generator)
void SetGenerator(FairPrimaryGenerator *Gen)
void SetSink(FairSink *tempSink)
void SetModifyGeometry(Bool_t val)
void SetIsMT(Bool_t isMT)
FairParRootFileIo * parOut
void run_tutorial4(Int_t nEvents=10, TString mcEngine="TGeant3", Bool_t doAlign=true, Bool_t isMT=false)
void SetBoxXYZ(Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0)
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)
Bool_t setFirstInput(FairParIo *)
void SetStoreTraj(Bool_t storeTraj=kTRUE)