00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef GEOMEDIUMMAP_H
00012 #define GEOMEDIUMMAP_H
00013
00014 #include <map>
00015 #include <string>
00016 #include <TObject.h>
00017 #include "Validity/VldContext.h"
00018 #include "GeoGeometry/Geo.h"
00019
00020 class GeoMedium;
00021 class GeoGeometry;
00022
00023 class GeoMediumMap : public TObject {
00024
00025 friend class GeoGeometry;
00026
00027 public:
00028
00029
00030 typedef std::map<Geo::EDetComponent,GeoMedium*> MediumMap;
00031 typedef MediumMap::const_iterator MediumMapConstItr;
00032 typedef MediumMap::iterator MediumMapItr;
00033 typedef std::map<Geo::EDetComponent,Geo::EFldStrength> FldStrengthMap;
00034 typedef FldStrengthMap::const_iterator FldStrengthMapConstItr;
00035 typedef FldStrengthMap::iterator FldStrengthMapItr;
00036 typedef std::map<Geo::EFldStrength,Geo::ESwimMethod> SwimMethodMap;
00037 typedef SwimMethodMap::const_iterator SwimMethodMapConstItr;
00038 typedef SwimMethodMap::iterator SwimMethodMapItr;
00039
00040
00041 GeoMediumMap():fGeoGeometry(0) {}
00042 virtual ~GeoMediumMap() {}
00043
00044
00045 virtual GeoMedium* GetMedium(Geo::EDetComponent detcomp) const;
00046 virtual Geo::EFldStrength GetFldStrength(Geo::EDetComponent detcomp) const;
00047 virtual Geo::ESwimMethod GetSwimMethod(Geo::EFldStrength fldstrength) const
00048 { return fSwimMethodMap.find(fldstrength)->second; }
00049
00050 virtual void Print(Option_t* option="") const;
00051
00052
00053 virtual void UpdateGlobalManager() const;
00054
00055 protected:
00056
00057 GeoMediumMap(GeoGeometry* geo,const VldContext& vldc);
00058
00059 private:
00060
00061
00062 void BuildMediums();
00063 bool BuildMediumMap();
00064 void BuildSwimMethodMap();
00065 void BuildFarMediumMap();
00066 void BuildNearMediumMap();
00067 void BuildCalMediumMap();
00068 void BuildDefMediumMap();
00069
00070 void SetMedium(Geo::EDetComponent,std::string medname,Geo::EFldStrength);
00071 int CreateMediumsforMaterial(std::string medname, int medId,
00072 int matId, int isVol, float fieldm);
00073 void ConfigureMedium(GeoMedium* med);
00074
00075
00076 GeoGeometry* fGeoGeometry;
00077 VldContext fVldContext;
00078 MediumMap fMediumMap;
00079 FldStrengthMap fFldStrengthMap;
00080 SwimMethodMap fSwimMethodMap;
00081
00082 ClassDef(GeoMediumMap,2)
00083 };
00084 #endif // GEOMEDIUMMAP_H