Skip to content
Snippets Groups Projects
Commit 87b9b74a authored by Christopher Dilks's avatar Christopher Dilks
Browse files

update IRT aux `TFile` creation

parent 142be8cd
Branches
No related tags found
1 merge request!331Draft: Resolve "add IRT geometry to RICH cpp files"
Pipeline #35653 failed
......@@ -34,6 +34,7 @@
<constant name="DRICH_debug_optics" value="0"/>
<constant name="DRICH_debug_mirror" value="0"/>
<constant name="DRICH_debug_sensors" value="0"/>
<constant name="DRICH_create_irt_file" value="0"/>
</define>
......@@ -54,6 +55,7 @@
vis_vessel="DRICH_vessel_vis"
vis_gas="DRICH_gas_vis"
debug_optics="DRICH_debug_optics"
irt_filename="irt-drich.root"
>
......
......@@ -43,15 +43,6 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
xml::Component dims = detElem.dimensions();
OpticalSurfaceManager surfMgr = desc.surfaceManager();
//@@@ Create output file and a geometry object pointer;
std::string str = detName; std::transform(str.begin(), str.end(), str.begin(), ::tolower);
#ifdef IRT_AUXFILE
auto fout = new TFile((str + "-config.root").c_str(), "RECREATE");
auto geometry = new CherenkovDetectorCollection();
// Yes, a single detector per .root file in this environment;
auto detector = geometry->AddNewDetector(detName.c_str());
#endif
// attributes -----------------------------------------------------------
// - vessel
double vesselZmin = dims.attr<double>(_Unicode(zmin));
......@@ -121,6 +112,21 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
int debug_optics_mode = detElem.attr<int>(_Unicode(debug_optics));
bool debug_mirror = mirrorElem.attr<bool>(_Unicode(debug));
bool debug_sensors = sensorSphElem.attr<bool>(_Unicode(debug));
#ifdef IRT_AUXFILE
// - IRT auxiliary file
auto irtAuxFileName = detElem.attr<std::string>(_Unicode(irt_filename));
// bool createIrtFile = desc.constantAsLong("DRICH_create_irt_file") == 1; // not used, we always want the aux file
#endif
//@@@ Create output file and a geometry object pointer;
std::string str = detName; std::transform(str.begin(), str.end(), str.begin(), ::tolower);
#ifdef IRT_AUXFILE
auto fout = new TFile(irtAuxFileName.c_str(), "RECREATE");
auto geometry = new CherenkovDetectorCollection();
// Yes, a single detector per .root file in this environment;
auto detector = geometry->AddNewDetector(detName.c_str());
#endif
// if debugging optics, override some settings
bool debug_optics = debug_optics_mode > 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment