CMS 3D CMS Logo

MagGeoBuilderFromDDD.h
Go to the documentation of this file.
1 #ifndef MagGeoBuilderFromDDD_H
2 #define MagGeoBuilderFromDDD_H
3 
12 
15 
16 #include <string>
17 #include <vector>
18 #include <map>
19 #include <memory>
20 
21 class Surface;
22 class MagBLayer;
23 class MagESector;
24 class MagVolume6Faces;
25 namespace magneticfield {
28  class BaseVolumeHandle; // Needs to be public to share code with DD4hep
29  using handles = std::vector<BaseVolumeHandle*>;
30 } // namespace magneticfield
31 
33 public:
35  MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug = false);
36 
38  virtual ~MagGeoBuilderFromDDD();
39 
43  void setScaling(const std::vector<int>& keys, const std::vector<double>& values);
44 
46 
48  std::vector<MagBLayer*> barrelLayers() const;
49 
51  std::vector<MagESector*> endcapSectors() const;
52 
53  float maxR() const;
54 
55  float maxZ() const;
56 
57  // Temporary container to manipulate volumes and their surfaces.
58  class volumeHandle; // Needs to be public to share code with DD4hep
59 
60 private:
61  // Build the geometry.
62  //virtual void build();
63  virtual void build(const DDCompactView& cpv);
64 
65  // FIXME: only for temporary tests and debug, to be removed
66  friend class TestMagVolume;
67  friend class MagGeometry;
70 
71  std::vector<MagVolume6Faces*> barrelVolumes() const;
72  std::vector<MagVolume6Faces*> endcapVolumes() const;
73 
74  // Build interpolator for the volume with "correct" rotation
75  void buildInterpolator(const volumeHandle* vol, std::map<std::string, MagProviderInterpol*>& interpolators);
76 
77  // Build all MagVolumes setting the MagProviderInterpol
79  std::map<std::string, MagProviderInterpol*>& interpolators);
80 
81  // Print checksums for surfaces.
83 
84  // Perform simple sanity checks
86 
87  magneticfield::handles bVolumes; // the barrel volumes.
88  magneticfield::handles eVolumes; // the endcap volumes.
89 
90  std::vector<MagBLayer*> mBLayers; // Finally built barrel geometry
91  std::vector<MagESector*> mESectors; // Finally built barrel geometry
92 
93  std::string tableSet; // Version of the data files to be used
94  int geometryVersion; // Version of MF geometry
95 
96  std::map<int, double> theScalingFactors;
97  const magneticfield::TableFileMap* theGridFiles; // Non-owned pointer assumed to be valid until build() is called
98 
99  const bool debug;
100 };
101 #endif
void summary(magneticfield::handles &volumes)
std::vector< MagVolume6Faces * > barrelVolumes() const
std::vector< MagBLayer * > mBLayers
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
magneticfield::handles eVolumes
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
virtual ~MagGeoBuilderFromDDD()
Destructor.
virtual void build(const DDCompactView &cpv)
void buildMagVolumes(const magneticfield::handles &volumes, std::map< std::string, MagProviderInterpol *> &interpolators)
magneticfield::handles bVolumes
std::vector< BaseVolumeHandle * > handles
MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false)
Constructor.
const magneticfield::TableFileMap * theGridFiles
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol *> &interpolators)
std::vector< MagVolume6Faces * > endcapVolumes() const
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
void testInside(magneticfield::handles &volumes)
std::vector< MagESector * > mESectors
std::map< int, std::pair< std::string, int > > TableFileMap
std::map< int, double > theScalingFactors
void setGridFiles(const magneticfield::TableFileMap &gridFiles)