Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:15

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2025 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "traccc/examples/make_magnetic_field.hpp"
0010 
0011 // Project include(s).
0012 #include "traccc/bfield/construct_const_bfield.hpp"
0013 #include "traccc/definitions/primitives.hpp"
0014 #include "traccc/io/read_magnetic_field.hpp"
0015 
0016 namespace traccc::details {
0017 
0018 magnetic_field make_magnetic_field(const opts::magnetic_field& opts) {
0019   if (opts.read_from_file) {
0020     magnetic_field result;
0021     io::read_magnetic_field(result, opts.file, opts.format);
0022     return result;
0023   } else {
0024     return construct_const_bfield({0.f, 0.f, opts.value});
0025   }
0026 }
0027 
0028 }  // namespace traccc::details