// -*- mode: c++ -*- // $Id: BrDbMagnetVolume.h,v 1.6 2002/06/06 23:04:22 hagel Exp $ // $Author: hagel $ // $Date: 2002/06/06 23:04:22 $ // $Copyright: 2001 Brahms Collaboration // //NOTE: SEE IMPORTANT NOTE IN CXX FILE //KH 8-Apr-2001 #ifndef BRAT_BrDbMagnetVolume #define BRAT_BrDbMagnetVolume #ifndef ROOT_TObjArray #include "TObjArray.h" #endif #ifndef ROOT_TSQLServer #include "TSQLServer.h" #endif #ifndef ROOT_TSQLResult #include "TSQLResult.h" #endif #ifndef ROOT_TSQLRow #include "TSQLRow.h" #endif #ifndef BRAT_BrDbTable #include "BrDbTable.h" #endif #ifndef BRAT_BrDbQuery #include "BrDbQuery.h" #endif class BrDbMagnetVolume : public BrDbTable { friend class BrGeometriesDb; friend class BrRdbmGeometriesDb; public: enum EFieldTypes { kFieldTypeAnalytical = 1 }; public: enum ERunTypes { kTypeData = 1, kTypeSimulation = 2 }; private: Char_t fName[64]; // Magnet name Int_t fValidStart; // Start time that these values are valid (UNIX time) Int_t fValidStop; // Stop time for these values to be valid (UNIX time) Int_t fFromStart; // Start time for basis for revsion Int_t fFromEnd; // End time for basis for revsion Int_t fDate; // Date of creation Double_t fFrontEdge; // Z of front edge Double_t fBackEdge; // Z of back edge Int_t fFieldType; // Type of field; Char_t fFieldFilename[64]; //Name of file containing field data if field //type indicates data is stored in a file Int_t fRunType; //Type of run this entry used for, ie data or simul. Int_t fRevisionId; //RevisionId void SetName(const Char_t *name); void SetFieldFilename(const Char_t *name); void SetRevisionId(Int_t revision) {fRevisionId = revision;} public: BrDbMagnetVolume(); BrDbMagnetVolume(const Char_t *name, Int_t validstart, Int_t validstop, Int_t fromstart, Int_t fromend, Int_t date, Double_t zmin, Double_t zmax, EFieldTypes fieldType = kFieldTypeAnalytical, const Char_t *fieldFilename=0,ERunTypes runType = kTypeData); static const Char_t* kTableName; static BrDbQuery* Create(void); static BrDbMagnetVolume* SingleInstance(TSQLRow*); static TObjArray* MultipleInstance(TSQLResult*); virtual BrDbQuery* Insert(void); const Char_t *GetName() const {return (const Char_t*)fName;} Int_t GetValidStart() const {return fValidStart;} Int_t GetValidStop() const {return fValidStop;} Int_t GetFromStart() const {return fFromStart;} Int_t GetFromEnd() const {return fFromEnd;} Int_t GetDate() const {return fDate;} Double_t GetFrontEdge() const {return fFrontEdge;} Double_t GetBackEdge() const {return fBackEdge;} Int_t GetFieldType() const {return fFieldType;} const Char_t *GetFieldFilename() const {return fFieldFilename;} Int_t GetRunType() const {return fRunType;} Int_t GetRevisionId() const {return fRevisionId;} ClassDef(BrDbMagnetVolume,1) // Magnet Parameter Class for BRAHMS database } ; #endif // // $Log: BrDbMagnetVolume.h,v $ // Revision 1.6 2002/06/06 23:04:22 hagel // Fix small bugs with magnet revisions // // Revision 1.5 2001/10/08 10:51:54 cholm // Some small changes mostly (I'm not sure that Kris has finished this yet). // Implmented the MySQL implmentation of the BrGeometriesDb access class. // The ROOT implmentation must wait until it's clear what the status of this // part of BRAT is (I'm not all that happy with the current implmentation, and // it doesn't help not to have some documentation). // // Revision 1.4 2001/09/05 03:59:12 hagel // Added GetDate method // // Revision 1.3 2001/08/14 14:45:37 hagel // Yet another iteration on GeometryDB // // 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.4 2001/06/05 18:38:43 cholm // Removed BrDbInc.h an all references to it // // Revision 1.3 2001/05/07 21:22:32 hagel // Next iteration of Geometry DB // // Revision 1.2 2001/04/20 16:14:15 hagel // Rework MySQL mode of BrMagnetVolume // // Revision 1.1 2001/03/07 16:53:00 hagel // Initial revision, probably needs more iterations //