55 auto contextDecorators = geometry.second;
60 auto surfaceLogLevel =
67 for (
size_t ievt = 0; ievt <
nEvents; ++ievt) {
77 for (
auto& cdr : contextDecorators) {
79 throw std::runtime_error(
"Failed to decorate event context");
82 std::string geoContextStr =
"";
83 if (contextDecorators.size() > 0) {
92 std::string outputDir = vm[
"output-dir"].template as<std::string>();
95 if (vm[
"output-obj"].as<bool>()) {
97 std::vector<std::shared_ptr<FW::Obj::ObjSurfaceWriter>> subWriters;
98 std::vector<std::shared_ptr<std::ofstream>> subStreams;
100 for (
auto sdet : subDetectors) {
102 auto sdStream = std::shared_ptr<std::ofstream>(
new std::ofstream);
103 std::string sdOutputName =
105 sdStream->open(sdOutputName);
111 if (contextDecorators.size() > 0) {
115 std::make_shared<FW::Obj::ObjSurfaceWriter>(sdObjWriterConfig);
117 subWriters.push_back(sdObjWriter);
118 subStreams.push_back(sdStream);
123 vm,
"ObjTrackingGeometryWriter", volumeLogLevel);
125 tgObjWriterConfig.surfaceWriters = subWriters;
126 auto tgObjWriter = std::make_shared<FW::Obj::ObjTrackingGeometryWriter>(
133 for (
auto sStreams : subStreams) {
139 if (vm[
"output-csv"].as<bool>()) {
145 auto tgCsvWriter = std::make_shared<FW::CsvTrackingGeometryWriter>(
146 tgCsvWriterConfig, logLevel);
149 tgCsvWriter->write(context);
153 std::string materialFileName = vm[
"mat-output-file"].as<std::string>();
155 if (!materialFileName.empty() and vm[
"output-root"].template as<bool>()) {
158 rmwConfig.
fileName = materialFileName +
".root";
163 if (!materialFileName.empty() and vm[
"output-json"].template as<bool>()) {
165 std::string fileName = vm[
"mat-output-file"].template as<std::string>();
169 jmConverterCfg.processSensitives =
170 vm[
"mat-output-sensitives"].template as<bool>();
171 jmConverterCfg.processApproaches =
172 vm[
"mat-output-approaches"].template as<bool>();
173 jmConverterCfg.processRepresenting =
174 vm[
"mat-output-representing"].template as<bool>();
175 jmConverterCfg.processBoundaries =
176 vm[
"mat-output-boundaries"].template as<bool>();
177 jmConverterCfg.processVolumes =
178 vm[
"mat-output-volumes"].template as<bool>();
179 jmConverterCfg.writeData = vm[
"mat-output-data"].template as<bool>();
180 jmConverterCfg.processnonmaterial =
181 vm[
"mat-output-allsurfaces"].template as<bool>();
184 materialFileName +
".json");