00001 // 00002 // EmcRecROOTGeo 00003 // 00004 // May 15, 2007, Created by Miao He 00005 // 00006 // Construct ROOT geometry from gdml 00007 // 00008 #ifndef EMC_REC_ROOT_GEO_H 00009 #define EMC_REC_ROOT_GEO_H 00010 00011 #include <map> 00012 #include "Identifier/Identifier.h" 00013 #include "Identifier/EmcID.h" 00014 #include "CLHEP/Geometry/Point3D.h" 00015 #ifndef ENABLE_BACKWARDS_COMPATIBILITY 00016 typedef HepGeom::Point3D<double> HepPoint3D; 00017 #endif 00018 using namespace CLHEP; 00019 class EmcRecCrystal; 00020 00021 class EmcRecROOTGeo 00022 { 00023 public: 00024 // Constructors and destructors 00025 EmcRecROOTGeo(); 00026 ~EmcRecROOTGeo(); 00027 00028 public: 00029 void InitFromXML(); 00030 void FillCrystalMap(EmcRecCrystal&, const int, const int, const int); 00031 EmcRecCrystal GetCrystal(const Identifier& id) const; 00032 HepPoint3D GetCCenter(const Identifier& id) const; 00033 HepPoint3D GetCFrontCenter(const Identifier& id) const; 00034 void ComputeThetaPhi(const int part, const int theta, const int phi, 00035 int& newTheta, int& newPhi); 00036 00037 private: 00038 std::map<Identifier, EmcRecCrystal> m_crystalMap; 00039 00040 }; 00041 00042 #endif