From 84eaa6a77df2b213d2e1f179e66da3213844c555 Mon Sep 17 00:00:00 2001 From: David Emschermann <d.emschermann@gsi.de> Date: Thu, 18 Nov 2021 13:44:43 +0100 Subject: [PATCH] correct positions of TRD v22a and v22b, use full FEE coverage and fix macros to generare parameter files with fairroot v18.6.x, refs #2332 --- macro/geometry/create_medialist.C | 5 ++-- .../geometry/trd/Create_TRD_Geometry_v22a.C | 23 +++++++++---------- .../geometry/trd/Create_TRD_Geometry_v22b.C | 17 ++++++++------ macro/trd/create_digipar_root.C | 7 +++--- macro/trd/create_geometry_file_root.C | 10 +++++++- 5 files changed, 37 insertions(+), 25 deletions(-) diff --git a/macro/geometry/create_medialist.C b/macro/geometry/create_medialist.C index f52add4207..44f4d5fca9 100644 --- a/macro/geometry/create_medialist.C +++ b/macro/geometry/create_medialist.C @@ -5,7 +5,7 @@ //forward declaration void loop_over_nodes(TObjArray*, TString&, CbmMediaList&); -void create_medialist(TString inFileName = "") +void create_medialist(TString inFileName = "", bool removegeomgr = true) { if (inFileName.Length() > 0) { @@ -54,7 +54,8 @@ void create_medialist(TString inFileName = "") matlist.Write(); outfile->Close(); - RemoveGeoManager(); + if (removegeomgr) + RemoveGeoManager(); } void loop_over_nodes(TObjArray* nodes, TString& path, CbmMediaList& matlist) diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C index 5fed432b7c..94e5e121b4 100644 --- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C +++ b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22a.C @@ -8,9 +8,8 @@ /// \file Create_TRD_Geometry_v22a.C /// \brief Generates TRD geometry in Root format. /// -// 2021-10-28 - SR - v22c - based on v22a the trd 2d-h is removed -// 2021-10-28 - SR - v22b - based on v22a the trd 2d is removed -// 2021-10-07 - SR - v22a - based on v20b the trd 2d is inserted +// 2021-10-28 - SR - v22b - based on v22a the TRD-2D is removed +// 2021-10-07 - SR - v22a - based on v20b the TRD-2D is inserted // 2021-09-28 - SR - v21b - based on v21a the position is corrected // 2021-07-25 - AB - v21a - based on v20b, add 2 TRD2D modules and their support structure for the 2021 setup // 2020-05-25 - DE - v20b - based on v20a, use 2 TRD modules for 2021 setup @@ -111,11 +110,8 @@ const TString tagVersion = "v22a_mcbm"; // const TString subVersion = "_3m"; const Int_t setupid = 1; // 1e is the default -// const Double_t zfront[5] = { 260., 410., 360., 410., 550. }; -const Double_t zfront[5] = {260., 155., 360., 410., 550.}; // move 1st TRD to z=180 cm // mCBM 2021_07 -// const Double_t zfront[5] = {260., 177., 360., 410., 550.}; // move 1st TRD -// to z=177 cm -// const Double_t zfront[5] = { 260., 140., 360., 410., 550. }; +// const Double_t zfront[5] = {260., 410., 360., 410., 550.}; +const Double_t zfront[5] = {260., 99., 360., 410., 550.}; // move 1st TRD-1D z=99 cm // mCBM 2022_02 const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"}; const TString subVersion = setupVer[setupid]; @@ -766,11 +762,7 @@ void Create_TRD_Geometry_v22a() trd->Export(FileNameSim); // an alternative way of writing the trd volume TFile* outfile = new TFile(FileNameSim, "UPDATE"); - // TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., - // 0.); TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]); - // TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7, 0., - // zfront[setupid]); trd_placement->Write(); outfile->Close(); @@ -788,6 +780,13 @@ void Create_TRD_Geometry_v22a() // cout << "Press Return to exit" << endl; // cin.get(); // exit(); + + // create medialist for this geometry + TString createmedialist = gSystem->Getenv("VMCWORKDIR"); + createmedialist += "/macro/geometry/create_medialist.C"; + std::cout << "Loading macro " << createmedialist << std::endl; + gROOT->LoadMacro(createmedialist); + gROOT->ProcessLine("create_medialist(\"\", false)"); } //============================================================== diff --git a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C index 7aa7392e74..d9f3b3bebf 100644 --- a/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C +++ b/macro/mcbm/geometry/trd/Create_TRD_Geometry_v22b.C @@ -116,10 +116,8 @@ const TString tagVersion = "v22b_mcbm"; //const TString subVersion = "_3m"; const Int_t setupid = 1; // 1e is the default -//const Double_t zfront[5] = { 260., 410., 360., 410., 550. }; -const Double_t zfront[5] = {260., 180., 360., 410., 550.}; // move 1st TRD to z=180 cm // mCBM 2021_07 -//const Double_t zfront[5] = {260., 177., 360., 410., 550.}; // move 1st TRD to z=177 cm -//const Double_t zfront[5] = { 260., 140., 360., 410., 550. }; +//const Double_t zfront[5] = {260., 410., 360., 410., 550.}; +const Double_t zfront[5] = {260., 180., 360., 410., 550.}; // move 1st TRD-1D z=99 cm // mCBM 2022_02 const TString setupVer[5] = {"_1h", "_1e", "_1m", "_3e", "_3m"}; const TString subVersion = setupVer[setupid]; @@ -668,9 +666,7 @@ void Create_TRD_Geometry_v22b() trd->Export(FileNameSim); // an alternative way of writing the trd volume TFile* outfile = new TFile(FileNameSim, "UPDATE"); - // TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., 0.); - // TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]); - TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", -7., 0., zfront[setupid]); + TGeoTranslation* trd_placement = new TGeoTranslation("trd_trans", 0., 0., zfront[setupid]); trd_placement->Write(); outfile->Close(); @@ -688,6 +684,13 @@ void Create_TRD_Geometry_v22b() // cout << "Press Return to exit" << endl; // cin.get(); // exit(); + + // create medialist for this geometry + TString createmedialist = gSystem->Getenv("VMCWORKDIR"); + createmedialist += "/macro/geometry/create_medialist.C"; + std::cout << "Loading macro " << createmedialist << std::endl; + gROOT->LoadMacro(createmedialist); + gROOT->ProcessLine("create_medialist(\"\", false)"); } diff --git a/macro/trd/create_digipar_root.C b/macro/trd/create_digipar_root.C index 025c97f9b0..6310a9db13 100644 --- a/macro/trd/create_digipar_root.C +++ b/macro/trd/create_digipar_root.C @@ -14,15 +14,16 @@ // // -------------------------------------------------------------------------- -void create_digipar_root(TString geoName = "trd_v13q", Bool_t asicFASP = kTRUE) +void create_digipar_root(TString geoName = "trd_v22a_mcbm", Bool_t asicFASP = kTRUE) { TString inFile = "data/test.mc." + geoName + ".root"; TString geoFile = "geofile_" + geoName + ".root"; TString outFile = "data/test.esd." + geoName + ".root"; TString digiFile = geoName + ".par"; // Digi Parameter Output File - FairRunAna* run = new FairRunAna(); - run->SetInputFile(inFile); + FairRunAna* run = new FairRunAna(); + FairFileSource* inputSource = new FairFileSource(inFile); + run->SetSource(inputSource); run->SetOutputFile(outFile); run->SetGeomFile(geoFile); diff --git a/macro/trd/create_geometry_file_root.C b/macro/trd/create_geometry_file_root.C index cce55d15ec..8f7725e2ac 100644 --- a/macro/trd/create_geometry_file_root.C +++ b/macro/trd/create_geometry_file_root.C @@ -16,8 +16,15 @@ // // -------------------------------------------------------------------------- -void create_geometry_file_root(TString geoName = "trd_v13q") +void create_geometry_file_root(TString geoName = "trd_v22a_mcbm") { + TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory + + // Set the path to the directory with macros for Geant3 and Geant4 + // configuration + TString tut_configdir = srcDir + "/sim/transport/gconfig"; + gSystem->Setenv("CONFIG_DIR", tut_configdir.Data()); + TString outDir = "data"; TString outFile = outDir + "/test.mc." + geoName + ".root"; TString parFile = outDir + "/params.root"; @@ -38,6 +45,7 @@ void create_geometry_file_root(TString geoName = "trd_v13q") cave->SetGeometryFileName(caveGeom); run->AddModule(cave); } + if (trdGeom != "") { FairDetector* trd = new CbmTrd("TRD", kTRUE); trd->SetGeometryFileName(trdGeom); -- GitLab