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 
22 class Surface;
23 class MagBLayer;
24 class MagESector;
25 class MagVolume6Faces;
26 namespace magneticfield {
29 }
30 
31 
33 public:
39  MagGeoBuilderFromDDD(std::string version_, bool debug=false, bool overrideMasterSector=false);
40 
42  virtual ~MagGeoBuilderFromDDD();
43 
47  void setScaling(std::vector<int> keys, std::vector<double> values);
48 
50  std::vector<MagBLayer*> barrelLayers() const;
51 
53  std::vector<MagESector*> endcapSectors() const;
54 
55  float maxR() const;
56 
57  float maxZ() const;
58 
59 private:
61 
62  // Build the geometry.
63  //virtual void build();
64  virtual void build(const DDCompactView & cpv);
65 
66 
67  // FIXME: only for temporary tests and debug, to be removed
68  friend class TestMagVolume;
69  friend class MagGeometry;
72 
73 
74  std::vector<MagVolume6Faces*> barrelVolumes() const;
75  std::vector<MagVolume6Faces*> endcapVolumes() const;
76 
77  // Temporary container to manipulate volumes and their surfaces.
78  class volumeHandle;
79  typedef std::vector<volumeHandle*> handles;
80 
81  // Build interpolator for the volume with "correct" rotation
82  void buildInterpolator(const volumeHandle * vol,
83  std::map<std::string, MagProviderInterpol*>& interpolators);
84 
85  // Build all MagVolumes setting the MagProviderInterpol
86  void buildMagVolumes(const handles & volumes,
87  std::map<std::string, MagProviderInterpol*> & interpolators);
88 
89  // Print checksums for surfaces.
90  void summary(handles & volumes);
91 
92  // Perform simple sanity checks
93  void testInside(handles & volumes);
94 
95  // A layer of barrel volumes.
96  class bLayer;
97  // A sector of volumes in a layer.
98  class bSector;
99  // A rod of volumes in a sector.
100  class bRod;
101  // A slab of volumes in a rod.
102  class bSlab;
103  // A sector of endcap volumes.
104  class eSector;
105  // A layer of volumes in an endcap sector.
106  class eLayer;
107 
108 
109  // Extractors for precomputed_value_sort (to sort containers of volumeHandles).
110  typedef std::unary_function<const volumeHandle*, double> uFcn;
111  struct ExtractZ;
112  struct ExtractAbsZ;
113  struct ExtractPhi;
114  struct ExtractPhiMax;
115  struct ExtractR;
116  struct ExtractRN;
117  struct LessDPhi;
118  // This one to be used only for max_element and min_element
119  struct LessZ;
120 
121  handles bVolumes; // the barrel volumes.
122  handles eVolumes; // the endcap volumes.
123 
124  std::vector<MagBLayer*> mBLayers; // Finally built barrel geometry
125  std::vector<MagESector*> mESectors; // Finally built barrel geometry
126 
127  std::string version; // Version of the data files to be used
128 
129  std::map<int, double> theScalingFactors;
130 
131  bool overrideMasterSector; // see comment on ctor
132 
133  static bool debug;
134 
135 };
136 #endif
std::vector< MagBLayer * > mBLayers
std::vector< volumeHandle * > handles
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
MagGeoBuilderFromDDD(std::string version_, bool debug=false, bool overrideMasterSector=false)
type of data representation of DDCompactView
Definition: DDCompactView.h:81
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)
void setScaling(std::vector< int > keys, std::vector< double > values)
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
std::vector< MagVolume6Faces * > endcapVolumes() const
std::unary_function< const volumeHandle *, double > uFcn
std::vector< MagESector * > mESectors
std::map< int, double > theScalingFactors
void buildMagVolumes(const handles &volumes, std::map< std::string, MagProviderInterpol * > &interpolators)