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
MagProviderInterpol.h
MagGeoBuilderFromDDD::mBLayers
std::vector< MagBLayer * > mBLayers
Definition: MagGeoBuilderFromDDD.h:90
MagGeoBuilderFromDDD::theScalingFactors
std::map< int, double > theScalingFactors
Definition: MagGeoBuilderFromDDD.h:96
MagGeoBuilderFromDDD
Definition: MagGeoBuilderFromDDD.h:32
magneticfield
Definition: MagFieldConfig.h:22
Surface
Definition: Surface.h:36
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
MagGeoBuilderFromDDD::barrelLayers
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
Definition: MagGeoBuilderFromDDD.cc:621
DDCompactView.h
MagGeoBuilderFromDDD::debug
const bool debug
Definition: MagGeoBuilderFromDDD.h:99
MagGeoBuilderFromDDD::setScaling
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
Definition: MagGeoBuilderFromDDD.cc:658
MagGeoBuilderFromDDD::maxZ
float maxZ() const
Definition: MagGeoBuilderFromDDD.cc:648
volumeBasedMagneticField_160812_cfi.volumes
volumes
Definition: volumeBasedMagneticField_160812_cfi.py:57
MagGeoBuilderFromDDD::maxR
float maxR() const
Definition: MagGeoBuilderFromDDD.cc:643
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
MagGeoBuilderFromDDD::TestMagVolume
friend class TestMagVolume
Definition: MagGeoBuilderFromDDD.h:66
MagGeoBuilderFromDDD::geometryVersion
int geometryVersion
Definition: MagGeoBuilderFromDDD.h:94
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
MagGeoBuilderFromDDD::setGridFiles
void setGridFiles(const magneticfield::TableFileMap &gridFiles)
Definition: MagGeoBuilderFromDDD.cc:668
MagGeoBuilderFromDDD::volumeHandle
Definition: volumeHandle.h:23
volumeBasedMagneticField_160812_cfi.gridFiles
gridFiles
Definition: volumeBasedMagneticField_160812_cfi.py:45
MagVolume6Faces
Definition: MagVolume6Faces.h:23
magneticfield::handles
std::vector< BaseVolumeHandle * > handles
Definition: BaseVolumeHandle.h:154
MagGeoBuilderFromDDD::theGridFiles
const magneticfield::TableFileMap * theGridFiles
Definition: MagGeoBuilderFromDDD.h:97
MagGeometry
Definition: MagGeometry.h:23
MagGeoBuilderFromDDD::build
virtual void build(const DDCompactView &cpv)
Definition: MagGeoBuilderFromDDD.cc:117
MagGeoBuilderFromDDD::endcapSectors
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
Definition: MagGeoBuilderFromDDD.cc:623
MagGeoBuilderFromDDD::bVolumes
magneticfield::handles bVolumes
Definition: MagGeoBuilderFromDDD.h:87
MagFieldConfig.h
BaseVolumeHandle
MagGeoBuilderFromDDD::endcapVolumes
std::vector< MagVolume6Faces * > endcapVolumes() const
Definition: MagGeoBuilderFromDDD.cc:634
MagGeoBuilderFromDDD::summary
void summary(magneticfield::handles &volumes)
Definition: MagGeoBuilderFromDDD.cc:72
magneticfield::VolumeBasedMagneticFieldESProducer
Definition: VolumeBasedMagneticFieldESProducer.cc:26
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MagBLayer
Definition: MagBLayer.h:24
MagGeoBuilderFromDDD::MagGeoBuilderFromDDD
MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false)
Constructor.
Definition: MagGeoBuilderFromDDD.cc:56
MagGeoBuilderFromDDD::buildInterpolator
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: MagGeoBuilderFromDDD.cc:500
magneticfield::VolumeBasedMagneticFieldESProducerFromDB
Definition: VolumeBasedMagneticFieldESProducerFromDB.cc:49
MagGeoBuilderFromDDD::testInside
void testInside(magneticfield::handles &volumes)
Definition: MagGeoBuilderFromDDD.cc:597
MagESector
Definition: MagESector.h:18
MagGeoBuilderFromDDD::buildMagVolumes
void buildMagVolumes(const magneticfield::handles &volumes, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: MagGeoBuilderFromDDD.cc:456
MagGeoBuilderFromDDD::~MagGeoBuilderFromDDD
virtual ~MagGeoBuilderFromDDD()
Destructor.
Definition: MagGeoBuilderFromDDD.cc:62
VolumeBasedMagneticFieldESProducer
magneticfield::TableFileMap
std::map< int, std::pair< std::string, int > > TableFileMap
Definition: MagFieldConfig.h:23
MagGeoBuilderFromDDD::barrelVolumes
std::vector< MagVolume6Faces * > barrelVolumes() const
Definition: MagGeoBuilderFromDDD.cc:625
MagGeoBuilderFromDDD::tableSet
std::string tableSet
Definition: MagGeoBuilderFromDDD.h:93
VolumeBasedMagneticFieldESProducerFromDB
MagGeoBuilderFromDDD::mESectors
std::vector< MagESector * > mESectors
Definition: MagGeoBuilderFromDDD.h:91
MagGeoBuilderFromDDD::eVolumes
magneticfield::handles eVolumes
Definition: MagGeoBuilderFromDDD.h:88