CMS 3D CMS Logo

DD4hep_MagGeoBuilder.h
Go to the documentation of this file.
1 #ifndef MagneticField_GeomBuilder_DD4hep_MagGeoBuilder_h
2 #define MagneticField_GeomBuilder_DD4hep_MagGeoBuilder_h
3 
17 #include "DD4hep_volumeHandle.h"
18 
19 #include <string>
20 #include <vector>
21 #include <map>
22 #include <memory>
23 
24 namespace dd4hep {
25  class Detector;
26 }
27 
28 class Surface;
29 class MagBLayer;
30 class MagESector;
31 class MagVolume6Faces;
32 
33 namespace magneticfield {
34 
35  class MagGeoBuilder {
36  public:
37  MagGeoBuilder(std::string tableSet, int geometryVersion, bool debug = false);
38 
40 
41  // Build the geometry.
42  void build(const cms::DDDetector* det);
43 
47  void setScaling(const std::vector<int>& keys, const std::vector<double>& values);
48 
49  void setGridFiles(const TableFileMap& gridFiles);
50 
52  std::vector<MagBLayer*> barrelLayers() const;
53 
55  std::vector<MagESector*> endcapSectors() const;
56 
57  float maxR() const;
58 
59  float maxZ() const;
60 
61  std::vector<MagVolume6Faces*> barrelVolumes() const;
62  std::vector<MagVolume6Faces*> endcapVolumes() const;
63 
64  private:
65  // Build interpolator for the volume with "correct" rotation
66  void buildInterpolator(const volumeHandle* vol, std::map<std::string, MagProviderInterpol*>& interpolators);
67 
68  // Build all MagVolumes setting the MagProviderInterpol
69  void buildMagVolumes(const handles& volumes, std::map<std::string, MagProviderInterpol*>& interpolators);
70 
71  // Print checksums for surfaces.
72  void summary(handles& volumes) const;
73 
74  // Perform simple sanity checks
75  void testInside(handles& volumes);
76 
77  handles bVolumes_; // the barrel volumes.
78  handles eVolumes_; // the endcap volumes.
79 
80  std::vector<MagBLayer*> mBLayers_; // Finally built barrel geometry
81  std::vector<MagESector*> mESectors_; // Finally built barrel geometry
82 
83  std::string tableSet_; // Version of the data files to be used
84  int geometryVersion_; // Version of MF geometry
85 
86  std::map<int, double> theScalingFactors_;
87  const TableFileMap* theGridFiles_; // Non-owned pointer assumed to be valid until build() is called
88 
89  const bool debug_;
90  };
91 } // namespace magneticfield
92 #endif
MagProviderInterpol.h
magneticfield::MagGeoBuilder::build
void build(const cms::DDDetector *det)
Definition: DD4hep_MagGeoBuilder.cc:104
volumeBasedMagneticField_160812_cfi.geometryVersion
geometryVersion
Definition: volumeBasedMagneticField_160812_cfi.py:39
magneticfield::MagGeoBuilder::MagGeoBuilder
MagGeoBuilder(std::string tableSet, int geometryVersion, bool debug=false)
Definition: DD4hep_MagGeoBuilder.cc:48
magneticfield::volumeHandle
Definition: DD4hep_volumeHandle.h:23
magneticfield
Definition: MagFieldConfig.h:22
magneticfield::MagGeoBuilder
Definition: DD4hep_MagGeoBuilder.h:35
Surface
Definition: Surface.h:36
DD4hep_volumeHandle.h
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
magneticfield::MagGeoBuilder::endcapSectors
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
Definition: DD4hep_MagGeoBuilder.cc:557
DDDetector.h
magneticfield::MagGeoBuilder::~MagGeoBuilder
~MagGeoBuilder()
Definition: DD4hep_MagGeoBuilder.cc:53
magneticfield::MagGeoBuilder::barrelLayers
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
Definition: DD4hep_MagGeoBuilder.cc:555
debug
#define debug
Definition: HDRShower.cc:19
volumeBasedMagneticField_160812_cfi.volumes
volumes
Definition: volumeBasedMagneticField_160812_cfi.py:57
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
magneticfield::MagGeoBuilder::maxZ
float maxZ() const
Definition: DD4hep_MagGeoBuilder.cc:582
volumeBasedMagneticField_160812_cfi.gridFiles
gridFiles
Definition: volumeBasedMagneticField_160812_cfi.py:45
magneticfield::MagGeoBuilder::eVolumes_
handles eVolumes_
Definition: DD4hep_MagGeoBuilder.h:78
magneticfield::MagGeoBuilder::buildInterpolator
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: DD4hep_MagGeoBuilder.cc:431
MagVolume6Faces
Definition: MagVolume6Faces.h:23
magneticfield::handles
std::vector< BaseVolumeHandle * > handles
Definition: BaseVolumeHandle.h:154
DDSpecParRegistry.h
magneticfield::MagGeoBuilder::summary
void summary(handles &volumes) const
Definition: DD4hep_MagGeoBuilder.cc:62
magneticfield::MagGeoBuilder::theScalingFactors_
std::map< int, double > theScalingFactors_
Definition: DD4hep_MagGeoBuilder.h:86
magneticfield::MagGeoBuilder::maxR
float maxR() const
Definition: DD4hep_MagGeoBuilder.cc:577
magneticfield::MagGeoBuilder::mBLayers_
std::vector< MagBLayer * > mBLayers_
Definition: DD4hep_MagGeoBuilder.h:80
magneticfield::MagGeoBuilder::geometryVersion_
int geometryVersion_
Definition: DD4hep_MagGeoBuilder.h:84
MagFieldConfig.h
magneticfield::MagGeoBuilder::barrelVolumes
std::vector< MagVolume6Faces * > barrelVolumes() const
Definition: DD4hep_MagGeoBuilder.cc:559
magneticfield::MagGeoBuilder::tableSet_
std::string tableSet_
Definition: DD4hep_MagGeoBuilder.h:83
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MagBLayer
Definition: MagBLayer.h:24
align::Detector
Definition: StructureType.h:92
ReferenceCounted.h
magneticfield::MagGeoBuilder::theGridFiles_
const TableFileMap * theGridFiles_
Definition: DD4hep_MagGeoBuilder.h:87
magneticfield::MagGeoBuilder::endcapVolumes
std::vector< MagVolume6Faces * > endcapVolumes() const
Definition: DD4hep_MagGeoBuilder.cc:568
magneticfield::MagGeoBuilder::buildMagVolumes
void buildMagVolumes(const handles &volumes, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: DD4hep_MagGeoBuilder.cc:387
magneticfield::MagGeoBuilder::mESectors_
std::vector< MagESector * > mESectors_
Definition: DD4hep_MagGeoBuilder.h:81
dd4hep
Definition: DDPlugins.h:8
cms::DDDetector
Definition: DDDetector.h:12
magneticfield::MagGeoBuilder::bVolumes_
handles bVolumes_
Definition: DD4hep_MagGeoBuilder.h:77
MagESector
Definition: MagESector.h:18
magneticfield::TableFileMap
std::map< int, std::pair< std::string, int > > TableFileMap
Definition: MagFieldConfig.h:23
magneticfield::MagGeoBuilder::debug_
const bool debug_
Definition: DD4hep_MagGeoBuilder.h:89
magneticfield::MagGeoBuilder::setScaling
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
Definition: DD4hep_MagGeoBuilder.cc:592
magneticfield::MagGeoBuilder::setGridFiles
void setGridFiles(const TableFileMap &gridFiles)
Definition: DD4hep_MagGeoBuilder.cc:602
magneticfield::MagGeoBuilder::testInside
void testInside(handles &volumes)
Definition: DD4hep_MagGeoBuilder.cc:530