Go to the documentation of this file.00001 #ifndef MagGeoBuilderFromDDD_H
00002 #define MagGeoBuilderFromDDD_H
00003
00013 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
00014 #include "MagneticField/Interpolation/interface/MagProviderInterpol.h"
00015
00016 #include "DetectorDescription/Core/interface/DDCompactView.h"
00017
00018 #include <string>
00019 #include <vector>
00020 #include <map>
00021 #include <memory>
00022
00023 class Surface;
00024 class MagBLayer;
00025 class MagESector;
00026 class MagVolume6Faces;
00027 namespace magneticfield {
00028 class VolumeBasedMagneticFieldESProducer;
00029 class AutoMagneticFieldESProducer;
00030
00031 typedef std::map<unsigned, std::pair<std::string, int> > TableFileMap;
00032 }
00033
00034
00035 class MagGeoBuilderFromDDD {
00036 public:
00038 MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false);
00039
00041 virtual ~MagGeoBuilderFromDDD();
00042
00046 void setScaling(const std::vector<int>& keys, const std::vector<double>& values);
00047
00048 void setGridFiles(const std::auto_ptr<magneticfield::TableFileMap> gridFiles);
00049
00051 std::vector<MagBLayer*> barrelLayers() const;
00052
00054 std::vector<MagESector*> endcapSectors() const;
00055
00056 float maxR() const;
00057
00058 float maxZ() const;
00059
00060 private:
00061 typedef ConstReferenceCountingPointer<Surface> RCPS;
00062
00063
00064
00065 virtual void build(const DDCompactView & cpv);
00066
00067
00068
00069 friend class TestMagVolume;
00070 friend class MagGeometry;
00071 friend class magneticfield::VolumeBasedMagneticFieldESProducer;
00072 friend class magneticfield::AutoMagneticFieldESProducer;
00073
00074
00075 std::vector<MagVolume6Faces*> barrelVolumes() const;
00076 std::vector<MagVolume6Faces*> endcapVolumes() const;
00077
00078
00079 class volumeHandle;
00080 typedef std::vector<volumeHandle*> handles;
00081
00082
00083 void buildInterpolator(const volumeHandle * vol,
00084 std::map<std::string, MagProviderInterpol*>& interpolators);
00085
00086
00087 void buildMagVolumes(const handles & volumes,
00088 std::map<std::string, MagProviderInterpol*> & interpolators);
00089
00090
00091 void summary(handles & volumes);
00092
00093
00094 void testInside(handles & volumes);
00095
00096
00097 class bLayer;
00098
00099 class bSector;
00100
00101 class bRod;
00102
00103 class bSlab;
00104
00105 class eSector;
00106
00107 class eLayer;
00108
00109
00110
00111 typedef std::unary_function<const volumeHandle*, double> uFcn;
00112 struct ExtractZ;
00113 struct ExtractAbsZ;
00114 struct ExtractPhi;
00115 struct ExtractPhiMax;
00116 struct ExtractR;
00117 struct ExtractRN;
00118 struct LessDPhi;
00119
00120 struct LessZ;
00121
00122 handles bVolumes;
00123 handles eVolumes;
00124
00125 std::vector<MagBLayer*> mBLayers;
00126 std::vector<MagESector*> mESectors;
00127
00128 std::string tableSet;
00129 int geometryVersion;
00130
00131 std::map<int, double> theScalingFactors;
00132 std::auto_ptr<magneticfield::TableFileMap> theGridFiles;
00133
00134 static bool debug;
00135
00136 };
00137 #endif