// -*- mode: c++ -*- #ifndef BRAT_BrGeometryDbManager #define BRAT_BrGeometryDbManager // // $Id: BrGeometryDbManager.h,v 1.5 2002/04/16 14:44:12 hagel Exp $ // // Root Classes #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif // BRAHMS Classes #ifndef BRAT_BrDetectorVolume #include "BrDetectorVolume.h" #endif class BrGeometryDbManager; class BrParameterDbManager; class BrDbObject : public TObject { // // This class is used only by the manager class. // The objects are used to maintain what databases objects has been // loaded via this mechanism. // public: BrDbObject(){}; BrDbObject(const Char_t* classname, const Char_t* detectorname, TObject* obj); ~BrDbObject(); private: Char_t fClassName[80]; // ClassName for database object Char_t fDetectorName[80]; // Identifier of detector/magnet name TObject* fDetectorGeometry; // Pointer to database object. public: friend class BrGeometryDbManager; friend class BrParameterDbManager; friend ostream& operator << (ostream& os, BrDbObject* dbobj); ClassDef(BrDbObject,0) // BRAHMS Database object }; class BrGeometriesDb; class BrRunInfoManager; class BrDbDetectorVolume; class BrDbMagnetVolume; class BrGeometryDbManager : public TObject { public: static BrGeometryDbManager* Instance(); // Root is not happy with the protected for the constructor. // i.e. one cannot invoke the TBrowser. The destructor also // has be public otherwise CINT complains. protected: BrGeometryDbManager(); public: ~BrGeometryDbManager(); public: void SetDbFileName(Char_t* filename); void SetDebugLevel(Int_t level){fDebugLevel=level;} void SetVerbosity(Int_t level){fVerbose=level;} void SetVerbose(Int_t level){fVerbose=level;} TObject* GetDetectorVolume(const Char_t* classname, const Char_t* detector); void List(); void SetDbModeMySQL(); void SetAsciiRead(const Char_t *vol,const Char_t *file); void Update(); private: BrDbObject* GetDbObject(const Char_t* classname, const Char_t* detector); TObjArray* fObjectlist; // List (Map) of object names and actual objects TObjArray *fAsciiVolumeList; //List of volumes to read from ascii file Int_t fDebugLevel; // Debug Level Int_t fVerbose; // Verbosity level TObjArray fFileList; // static BrGeometryDbManager* fInstance; //New variables and methods for implementing access to BRAHMS MySQL Db Int_t fDbMode; //ASCII or MySQL etc. enum EDbModes { kModeASCII = 1, kModeMySQL = 2 }; TObject* GetDetectorVolumeFromMySQL(const Char_t* classname, const Char_t* detector); TObject *BuildDetectorVolume(const Char_t *name); TObject *BuildMagnetVolume(const Char_t *name); ClassDef(BrGeometryDbManager,0) // BRAHMS Database Manager object }; #endif // $Log: BrGeometryDbManager.h,v $ // Revision 1.5 2002/04/16 14:44:12 hagel // Implement Hall Probe reading from Db in ySQL mode. Major surgery on BrGeometryDbManager concerning building BrDetectorVolume and BrMagnetVolume // // Revision 1.4 2002/02/08 22:55:48 hagel // Take advantage of new features of BrRotMatrix // // Revision 1.3 2002/01/31 15:24:07 ouerdane // added verbosity level and associated setter // // Revision 1.2 2001/08/02 03:13:46 hagel // Yet another iteration on GeometryDB; this should be close to last // // Revision 1.1.1.1 2001/06/21 14:55:18 hagel // Initial revision of brat2 // // Revision 1.12 2001/05/07 21:22:34 hagel // Next iteration of Geometry DB // // Revision 1.11 2001/03/07 17:40:20 hagel // Implement MySQL DB access support // // Revision 1.10 2000/11/23 01:31:47 brahmlib // Changed the returned object from operator+. // // Revision 1.9 2000/11/22 21:15:27 videbaek // Geometry manager updated to deal with modified Magnet and DetectorVolume // as well as with multiple file definitions. // // Revision 1.8 2000/05/10 15:56:04 nbi // Added the classes BrRunsDb, BrGeometriesDb, changed some code, bug // corrections , and so on. It's almost there ;-) // // Revision 1.7 1999/03/07 22:42:28 videbaek // Remove aprostrofees from several comments. emacs cannot make nice // layout with those in text. So use do not not dont // // Revision 1.6 1999/02/24 15:21:22 hagel // Enforce const in arguments // // Revision 1.5 1999/02/04 20:38:28 hagel // Added statement so that BrDbObject could support the new class BrParameterDbManager // See notes in BrParameterDbManager // // Revision 1.4 1999/01/21 23:23:21 hagel // 1. Changed convention for checking includes. Current convention is: // BRAT_Br...... eg BRAT_BrModule ala ROOT. // 2. Added CVS logs to .h files that did not have them. // 3. Moved checking of include definition to first line for easier reading // 4. Put checks before all includes in the include files as per BRAT specifications // 5. Added BrGeantHeader to Geant Makefile // 6. All changes have been checked to compile on NT ala Cygnus // // Revision 1.3 1998/12/21 20:20:35 videbaek // added BrMagnetVolume as being managed // // Revision 1.1 1998/12/09 17:01:37 videbaek // Add new db manager class. It has been checked out for // the simple BrDetectorVolume class. // //