Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GeoMediumMap.h

Go to the documentation of this file.
00001 
00002 //
00003 // GeoMediumMap
00004 //
00005 // GeoMediumMap is a helper class to build mediums and associations
00006 // between detector components and mediums.
00007 //
00008 // Author:  S. Kasahara  11/07
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; // constructs GeoMediumMap
00026 
00027  public:
00028 
00029    // typedefs and enumerations 
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    // Constructors/Destructors
00041    GeoMediumMap():fGeoGeometry(0) {} // def, used by i/o 
00042    virtual ~GeoMediumMap() {}
00043 
00044    // State testing methods
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    // State changing methods
00053    virtual void UpdateGlobalManager() const;
00054   
00055  protected:
00056    // constructor invoked by GeoGeometry friend
00057    GeoMediumMap(GeoGeometry* geo,const VldContext& vldc); // normal ctor
00058  
00059  private:
00060 
00061   // Data members
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    // Data members
00076    GeoGeometry* fGeoGeometry; 
00077    VldContext fVldContext; // the vld of this map, only DetectorType used
00078    MediumMap fMediumMap; // component,med pairs (mediums not owned)
00079    FldStrengthMap fFldStrengthMap; // component, fld strength pairs
00080    SwimMethodMap fSwimMethodMap; // field strength, swim method pairs
00081 
00082 ClassDef(GeoMediumMap,2)
00083 };
00084 #endif // GEOMEDIUMMAP_H

Generated on Mon Feb 15 11:06:45 2010 for loon by  doxygen 1.3.9.1