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 =
"./";
26 TString outFile =
"testrun_";
27 outFile = outFile + mcEngine +
".root";
29 TString geoFile =
"data/geoFile_" + mcEngine +
"_full.root";
30 TString geoFileMisaligned =
"data/geoFile_" + mcEngine +
"_full_misaligned.root";
32 TString parFile =
"testparams_";
33 parFile = parFile + mcEngine +
".root";
35 TList* parFileList =
new TList();
37 TString paramDir = dir +
"/simulation/Tutorial4/parameters/";
38 TString paramFile = paramDir +
"example.par";
40 TObjString* tutDetDigiFile =
new TObjString(paramFile);
41 parFileList->Add(tutDetDigiFile);
60 run->SetName(mcEngine);
87 boxGen->
SetPRange(momentum, momentum + 0.01);
89 boxGen->
SetBoxXYZ(-20., -20., 20., 20., 0.);
107 parOut->
open(parFile.Data());
108 parIn->
open(parFileList,
"in");
123 myfile.open(
"misalignmentMatrices.txt");
129 for (
auto& mat : matrices) {
130 myfile << mat.first <<
"\n";
131 rot = mat.second.GetRotationMatrix();
132 trans = mat.second.GetTranslation();
133 for (
int i = 0; i < 9; i++)
134 myfile << rot[i] <<
"\n";
135 for (
int i = 0; i < 3; i++)
136 myfile << trans[i] <<
"\n";
140 LOG(info) <<
"AlignHandler: all matrices added!";
142 LOG(info) <<
"SUCCESS! All matrices created and saved!";
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
std::map< std::string, TGeoHMatrix > getMisalignmentMatrices()
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 run_tutorial4_createMatrices(Int_t nEvents=10, TString mcEngine="TGeant3", Bool_t isMT=false)
void SetGenerator(FairPrimaryGenerator *Gen)
void SetSink(FairSink *tempSink)
void SetIsMT(Bool_t isMT)
FairParRootFileIo * parOut
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)
void AddModule(FairModule *Mod)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
Bool_t setFirstInput(FairParIo *)
void SetStoreTraj(Bool_t storeTraj=kTRUE)