8 int runMC(Int_t nEvents = 1000, TString mcEngine =
"TGeant4", Bool_t isMT =
false)
10 UInt_t randomSeed = 123456;
11 gRandom->SetSeed(randomSeed);
13 TString dir = getenv(
"VMCWORKDIR");
15 TString tut_geomdir = dir +
"/common/geometry";
16 gSystem->Setenv(
"GEOMPATH", tut_geomdir.Data());
18 TString tut_configdir = dir +
"/common/gconfig";
19 gSystem->Setenv(
"CONFIG_DIR", tut_configdir.Data());
22 Int_t partPdgC[] = {211, 11, 2212};
24 Double_t momentum = 2.;
28 TString outDir =
"./";
31 TString outFile = Form(
"%s/prop.mc.root", outDir.Data());
34 TString parFile = Form(
"%s/prop.par.root", outDir.Data());
36 TString geoFile =
"geofile_" + mcEngine +
"_full.root";
52 run->SetName(mcEngine);
81 for (
int iPart = 0; iPart < 3; iPart++) {
86 boxGen->
SetPRange(momentum, momentum + 0.01);
115 parOut->
open(parFile.Data());
128 cout << endl << endl;
134 cout <<
"<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
136 cout <<
"</DartMeasurement>" << endl;
139 Double_t rtime = timer.RealTime();
140 Double_t ctime = timer.CpuTime();
142 Float_t cpuUsage = ctime / rtime;
143 cout <<
"<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
145 cout <<
"</DartMeasurement>" << endl;
147 cout << endl << endl;
148 cout <<
"Output file is " << outFile << endl;
149 cout <<
"Parameter file is " << parFile << endl;
150 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
"s" << endl << endl;
151 cout <<
"Macro finished successfully." << endl;
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
void CreateGeometryFile(const char *geofile)
list of container factories
void SetStepSizeCut(Double_t stepSizeMin=0.)
void SetField(FairField *field)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void AddGenerator(FairGenerator *generator)
void SetField(Double_t bX, Double_t bY, Double_t bZ)
void SetMomentumCutP(Double_t pMin=0., Double_t thetaMin=0., Double_t phiMin=0., Double_t pMax=1e10, Double_t thetaMax=TMath::Pi(), Double_t phiMax=TMath::TwoPi())
void SetPointsArrayName(const std::string &tempName)
void SetGenerator(FairPrimaryGenerator *Gen)
void SetSink(FairSink *tempSink)
void SetIsMT(Bool_t isMT)
void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
FairParRootFileIo * parOut
static FairTrajFilter * Instance()
void SetStorePrimaries(Bool_t storePrim=kTRUE)
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)
int runMC(Int_t nEvents=1000, TString mcEngine="TGeant4", Bool_t isMT=false)
void SetStoreTraj(Bool_t storeTraj=kTRUE)