Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:30

0001 #ifndef MagneticField_GeomBuilder_InterpolatorBuilder_h
0002 #define MagneticField_GeomBuilder_InterpolatorBuilder_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     MagneticField/GeomBuilder
0006 // Class  :     InterpolatorBuilder
0007 //
0008 /**\class InterpolatorBuilder InterpolatorBuilder.h "InterpolatorBuilder.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Tue, 17 May 2022 20:50:20 GMT
0019 //
0020 
0021 // system include files
0022 #include <string>
0023 #include <optional>
0024 #include <unordered_map>
0025 
0026 // user include files
0027 #include "MagneticField/Interpolation/interface/MagProviderInterpol.h"
0028 #include "MagneticField/Interpolation/interface/binary_ifstream.h"
0029 #include "DD4hep_volumeHandle.h"
0030 
0031 // forward declarations
0032 
0033 namespace magneticfield {
0034   class InterpolatorBuilder {
0035   public:
0036     InterpolatorBuilder(std::string iTableSet, bool useMergeFileIfAvailable = true);
0037 
0038     InterpolatorBuilder(const InterpolatorBuilder&) = delete;                   // stop default
0039     const InterpolatorBuilder& operator=(const InterpolatorBuilder&) = delete;  // stop default
0040 
0041     // ---------- const member functions ---------------------
0042 
0043     // ---------- static member functions --------------------
0044 
0045     // ---------- member functions ---------------------------
0046     std::unique_ptr<MagProviderInterpol> build(volumeHandle const*);
0047 
0048   private:
0049     // ---------- member data --------------------------------
0050     std::string tableSet_;
0051     std::unordered_map<std::string, unsigned int> offsets_;
0052     std::optional<interpolation::binary_ifstream> stream_;
0053   };
0054 }  // namespace magneticfield
0055 #endif