CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MagGeoBuilderFromDDD.h
Go to the documentation of this file.
1 #ifndef MagGeoBuilderFromDDD_H
2 #define MagGeoBuilderFromDDD_H
3 
15 
17 
18 #include <string>
19 #include <vector>
20 #include <map>
21 #include <memory>
22 
23 class Surface;
24 class MagBLayer;
25 class MagESector;
26 class MagVolume6Faces;
27 namespace magneticfield {
30 
31  typedef std::map<unsigned, std::pair<std::string, int> > TableFileMap;
32 }
33 
34 
36 public:
38  MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false);
39 
41  virtual ~MagGeoBuilderFromDDD();
42 
46  void setScaling(const std::vector<int>& keys, const std::vector<double>& values);
47 
48  void setGridFiles(const std::auto_ptr<magneticfield::TableFileMap> gridFiles);
49 
51  std::vector<MagBLayer*> barrelLayers() const;
52 
54  std::vector<MagESector*> endcapSectors() const;
55 
56  float maxR() const;
57 
58  float maxZ() const;
59 
60 private:
62 
63  // Build the geometry.
64  //virtual void build();
65  virtual void build(const DDCompactView & cpv);
66 
67 
68  // FIXME: only for temporary tests and debug, to be removed
69  friend class TestMagVolume;
70  friend class MagGeometry;
73 
74 
75  std::vector<MagVolume6Faces*> barrelVolumes() const;
76  std::vector<MagVolume6Faces*> endcapVolumes() const;
77 
78  // Temporary container to manipulate volumes and their surfaces.
79  class volumeHandle;
80  typedef std::vector<volumeHandle*> handles;
81 
82  // Build interpolator for the volume with "correct" rotation
83  void buildInterpolator(const volumeHandle * vol,
84  std::map<std::string, MagProviderInterpol*>& interpolators);
85 
86  // Build all MagVolumes setting the MagProviderInterpol
87  void buildMagVolumes(const handles & volumes,
88  std::map<std::string, MagProviderInterpol*> & interpolators);
89 
90  // Print checksums for surfaces.
91  void summary(handles & volumes);
92 
93  // Perform simple sanity checks
94  void testInside(handles & volumes);
95 
96  // A layer of barrel volumes.
97  class bLayer;
98  // A sector of volumes in a layer.
99  class bSector;
100  // A rod of volumes in a sector.
101  class bRod;
102  // A slab of volumes in a rod.
103  class bSlab;
104  // A sector of endcap volumes.
105  class eSector;
106  // A layer of volumes in an endcap sector.
107  class eLayer;
108 
109 
110  // Extractors for precomputed_value_sort (to sort containers of volumeHandles).
111  typedef std::unary_function<const volumeHandle*, double> uFcn;
112  struct ExtractZ;
113  struct ExtractAbsZ;
114  struct ExtractPhi;
115  struct ExtractPhiMax;
116  struct ExtractR;
117  struct ExtractRN;
118  struct LessDPhi;
119  // This one to be used only for max_element and min_element
120  struct LessZ;
121 
122  handles bVolumes; // the barrel volumes.
123  handles eVolumes; // the endcap volumes.
124 
125  std::vector<MagBLayer*> mBLayers; // Finally built barrel geometry
126  std::vector<MagESector*> mESectors; // Finally built barrel geometry
127 
128  std::string tableSet; // Version of the data files to be used
129  int geometryVersion; // Version of MF geometry
130 
131  std::map<int, double> theScalingFactors;
132  std::auto_ptr<magneticfield::TableFileMap> theGridFiles;
133 
134  static bool debug;
135 
136 };
137 #endif
std::vector< MagBLayer * > mBLayers
std::vector< volumeHandle * > handles
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
type of data representation of DDCompactView
Definition: DDCompactView.h:77
void summary(handles &volumes)
std::vector< MagVolume6Faces * > barrelVolumes() const
virtual ~MagGeoBuilderFromDDD()
Destructor.
virtual void build(const DDCompactView &cpv)
ConstReferenceCountingPointer< Surface > RCPS
void testInside(handles &volumes)
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false)
Constructor.
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
std::vector< MagVolume6Faces * > endcapVolumes() const
std::unary_function< const volumeHandle *, double > uFcn
std::vector< MagESector * > mESectors
std::map< int, double > theScalingFactors
void setGridFiles(const std::auto_ptr< magneticfield::TableFileMap > gridFiles)
std::auto_ptr< magneticfield::TableFileMap > theGridFiles
void buildMagVolumes(const handles &volumes, std::map< std::string, MagProviderInterpol * > &interpolators)
std::map< unsigned, std::pair< std::string, int > > TableFileMap