File indexing completed on 2024-04-06 12:22:30
0001 #ifndef MagneticField_GeomBuilder_DD4hep_MagGeoBuilder_h
0002 #define MagneticField_GeomBuilder_DD4hep_MagGeoBuilder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "CondFormats/MFObjects/interface/MagFieldConfig.h"
0013 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0014 #include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"
0015 #include "DetectorDescription/DDCMS/interface/DDDetector.h"
0016 #include "MagneticField/Interpolation/interface/MagProviderInterpol.h"
0017 #include "DD4hep_volumeHandle.h"
0018
0019 #include <string>
0020 #include <vector>
0021 #include <map>
0022 #include <memory>
0023
0024 namespace dd4hep {
0025 class Detector;
0026 }
0027
0028 class Surface;
0029 class MagBLayer;
0030 class MagESector;
0031 class MagVolume6Faces;
0032
0033 namespace magneticfield {
0034 class InterpolatorBuilder;
0035
0036 class MagGeoBuilder {
0037 public:
0038 MagGeoBuilder(std::string tableSet, int geometryVersion, bool debug = false, bool useMergeFileIfAvailable = true);
0039
0040 ~MagGeoBuilder();
0041
0042
0043 void build(const cms::DDDetector* det);
0044
0045
0046
0047
0048 void setScaling(const std::vector<int>& keys, const std::vector<double>& values);
0049
0050 void setGridFiles(const TableFileMap& gridFiles);
0051
0052
0053 std::vector<MagBLayer*> barrelLayers() const;
0054
0055
0056 std::vector<MagESector*> endcapSectors() const;
0057
0058 float maxR() const;
0059
0060 float maxZ() const;
0061
0062 std::vector<MagVolume6Faces*> barrelVolumes() const;
0063 std::vector<MagVolume6Faces*> endcapVolumes() const;
0064
0065 private:
0066
0067 MagProviderInterpol* buildInterpolator(const volumeHandle* vol, InterpolatorBuilder&) const;
0068
0069
0070 void buildMagVolumes(const handles& volumes,
0071 const std::map<std::string, MagProviderInterpol*>& interpolators) const;
0072
0073
0074 void summary(handles& volumes) const;
0075
0076
0077 void testInside(handles& volumes) const;
0078
0079 handles bVolumes_;
0080 handles eVolumes_;
0081
0082 std::vector<MagBLayer*> mBLayers_;
0083 std::vector<MagESector*> mESectors_;
0084
0085 std::string tableSet_;
0086 int geometryVersion_;
0087
0088 std::map<int, double> theScalingFactors_;
0089 const TableFileMap* theGridFiles_;
0090
0091 const bool debug_;
0092 const bool useMergeFileIfAvailable_;
0093 };
0094 }
0095 #endif