8 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
9 gSystem->Load(
"libHypGe");
10 gSystem->Load(
"libHyp");
11 FairRunSim *
fRun =
new FairRunSim();
17 gRandom->SetSeed(now.Convert());
18 cout << now.Convert() << endl;
22 if (WhichDetector == 3)
24 GeoFile =
"hypGe_GeoMarcell.root";
25 outFile +=
"TripleV2_";
27 else if (WhichDetector == 31)
29 GeoFile =
"hypGeGeoTripleCluster_V3.root";
30 outFile +=
"TripleBall30_";
32 else if (WhichDetector == 32)
34 GeoFile =
"hypGeGeoTripleCluster_Straight.root";
35 outFile +=
"TripleStraight_";
37 else if (WhichDetector == 33)
39 GeoFile =
"hypGeGeoTripleCluster_Ball40_Offset10.root";
40 outFile +=
"TripleBall40Offset10_";
42 else if (WhichDetector == 34)
44 GeoFile =
"hypGeGeoTripleCluster_Ball40_Offset20.root";
45 outFile +=
"TripleBall40Offset20_";
47 else if (WhichDetector == 35)
49 GeoFile =
"hypGeGeoTripleCluster_Ball40_Offset10_STTFitting.root";
50 outFile +=
"TripleBall40Offset10STT_";
52 else if (WhichDetector == 36)
54 GeoFile =
"hypGeGeoTripleCluster_Ball40_Offset20_STTFitting.root";
55 outFile +=
"TripleBall40Offset20STT_";
58 else if (WhichDetector == 2)
60 GeoFile =
"hypGe_GeoMarcell_2er.root";
61 outFile +=
"DoubleV2_";
63 else if (WhichDetector == 21)
65 GeoFile =
"hypGeGeoDoubleCluster_V3.root";
66 outFile +=
"DoubleV3_";
75 outFile += Energy*1000;
86 outFile +=
"withSecTar";
92 SimparamsFile +=
"__Simparams.root";
99 fRun->SetName(
"TGeant4");
101 fRun->SetOutputFile(outFile);
105 fRun->SetMaterials(
"media_pnd_hypGe.geo");
111 Cave->SetGeometryFileName(
"pndcave.geo");
112 fRun->AddModule(Cave);
121 Hyp->SetGeometryFileName(
"../macro/hyp/Sebastian/SekTarget_open_varAbs4Si5_3Q_HYPbe_1mm_MVD.root");
122 fRun->AddModule(Hyp);
126 Mvd->SetGeometryFileName(
"../macro/hyp/Sebastian/Mvd-2.2_Simplified_onlyStrip5_z-verschoben550.root");
127 fRun->AddModule(Mvd);
134 Hyp->SetGeometryFileName(
"../macro/hyp/Sebastian/SekTarget_open_varAbs4Si5_3Q_HYPbe_1mm_MVD_air.root");
135 fRun->AddModule(Hyp);
140 HypGe->SetGeometryFileName(GeoFile);
141 fRun->AddModule(HypGe);
146 FairPrimaryGenerator*
primGen =
new FairPrimaryGenerator();
147 fRun->SetGenerator(primGen);
159 boxGen->
SetXYZ(0., 0., -55.);
172 boxGen2->
SetXYZ(0., 0., -55.);
173 primGen->AddGenerator(boxGen2);
179 TF1 *
f1 =
new TF1(
"f1",
"0.427842106*exp(-x/3.35703)", 4.5, 8.4999);
187 boxGen->SetPhiRange(0., 360.);
188 boxGen->SetThetaRange(90., 180.);
191 primGen->AddGenerator(
boxGen);
194 fRun->SetStoreTraj(kTRUE);
212 FairRuntimeDb *
rtdb=fRun->GetRuntimeDb();
216 FairParRootFileIo*
output=
new FairParRootFileIo(kParameterMerged);
217 output->open(SimparamsFile);
218 rtdb->setOutput(output);
232 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
PndBoxGenerator * boxGen2
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
FairParRootFileIo * output
FairPrimaryGenerator * primGen
void SetSensorVol(TString VolSi)
void sim_Gamma(Int_t nEvents=1000, Int_t WhichDetector=36, Double_t Energy=0.001, Bool_t addSecTar=1)
void SetVolTgFc(Int_t quad=2, TF1 *func=0)
void SetAbsorberVol(TString VolAb)
FairBoxGenerator * boxGen
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void SetPathGeo(TString pgeo)