33 #include <boost/program_options.hpp>
35 namespace po = boost::program_options;
48 ActsExamples::OutputFormat::Root |
49 ActsExamples::OutputFormat::Json |
50 ActsExamples::OutputFormat::Cbor);
68 auto contextDecorators =
geometry.second;
69 for (
const auto& cdr : contextDecorators) {
80 for (
auto& cdr : contextDecorators) {
82 throw std::runtime_error(
"Failed to decorate event context");
94 auto mapSurface = vm[
"mat-mapping-surfaces"].template as<bool>();
95 auto mapVolume = vm[
"mat-mapping-volumes"].template as<bool>();
96 auto volumeStep = vm[
"mat-mapping-volume-stepsize"].template as<float>();
97 if (!mapSurface && !mapVolume) {
102 std::string intputDir = vm[
"input-dir"].template as<std::string>();
103 auto intputFiles = vm[
"input-files"].template as<std::vector<std::string>>();
105 vm[
"mat-mapping-read-surfaces"].template as<bool>();
106 if (vm[
"input-root"].
template as<bool>()) {
111 matTrackReaderRootConfig.
fileList = intputFiles;
114 auto matTrackReaderRoot =
115 std::make_shared<ActsExamples::RootMaterialTrackReader>(
116 matTrackReaderRootConfig,
logLevel);
131 auto smm = std::make_shared<Acts::SurfaceMaterialMapper>(
134 mmAlgConfig.materialSurfaceMapper = smm;
145 auto vmm = std::make_shared<Acts::VolumeMaterialMapper>(
148 mmAlgConfig.materialVolumeMapper = vmm;
150 mmAlgConfig.trackingGeometry =
tGeometry;
155 if (not materialFileName.empty() and vm[
"output-root"].template as<bool>()) {
158 rmwConfig.
filePath = materialFileName +
".root";
162 std::make_shared<ActsExamples::RootMaterialWriter>(rmwConfig,
logLevel);
163 mmAlgConfig.materialWriters.push_back(rmw);
168 matTrackWriterRootConfig.
filePath = materialFileName +
"_tracks.root";
170 mmAlgConfig.mappingMaterialCollection;
173 auto matTrackWriterRoot =
174 std::make_shared<ActsExamples::RootMaterialTrackWriter>(
175 matTrackWriterRootConfig,
logLevel);
180 if (!materialFileName.empty() and (vm[
"output-json"].
template as<bool>() or
181 vm[
"output-cbor"].
template as<bool>())) {
183 std::string fileName = vm[
"mat-output-file"].template as<std::string>();
187 vm[
"mat-output-sensitives"].template as<bool>();
188 jmConverterCfg.processApproaches =
189 vm[
"mat-output-approaches"].template as<bool>();
190 jmConverterCfg.processRepresenting =
191 vm[
"mat-output-representing"].template as<bool>();
192 jmConverterCfg.processBoundaries =
193 vm[
"mat-output-boundaries"].template as<bool>();
194 jmConverterCfg.processVolumes =
195 vm[
"mat-output-volumes"].template as<bool>();
200 jmWriterCfg.
fileName = materialFileName;
203 if (vm[
"output-json"].
template as<bool>()) {
204 format = format | ActsExamples::JsonFormat::Json;
206 if (vm[
"output-cbor"].
template as<bool>()) {
207 format = format | ActsExamples::JsonFormat::Cbor;
211 auto jmw = std::make_shared<ActsExamples::JsonMaterialWriter>(
214 mmAlgConfig.materialWriters.push_back(jmw);
218 auto mmAlg = std::make_shared<ActsExamples::MaterialMapping>(mmAlgConfig);