// -*- mode: c++ -*- // $Id: BrDbDetectorVolume.h,v 1.9 2002/03/28 18:08:44 hagel Exp $ // $Author: hagel $ // $Date: 2002/03/28 18:08:44 $ // $Copyright: 2001 Brahms Collaboration // #ifndef BRAT_BrDbDetectorVolume #define BRAT_BrDbDetectorVolume #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 BrDbDetectorVolume : public BrDbTable { friend class BrGeometriesDb; friend class BrRdbmGeometriesDb; friend class DbDetectorVolumeEditBox; //Part of Geometry Db Browser!!! public: enum ERunTypes { kTypeNotSpecified = 0, kTypeData = 1, kTypeSimulation = 2 }; private: Char_t fName[64]; // Detector name Int_t fSpectrometerAngle; //100x absolute angle of spectrometer for index 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 fSizeX; // Detector size x Double_t fSizeY; // Detector size y Double_t fSizeZ; // Detector size z Double_t fTheta; // Detector angle theta (relative to parent volume) Double_t fPhi; // Detector angle phi (relative to parent volume) Double_t fPsi; // Detector angle psi (relative to parent volume) Double_t fPosX; // Detector position x (relative to platform) Double_t fPosY; // Detector position y (relative to platform) Double_t fPosZ; // Detector position z (relative to platform) Char_t fParentName[64]; //Parent volume name Int_t fPlatformType; //Platform it sits on Int_t fRunType; //Type of run this entry used for, ie data or simul. Int_t fRevisionId; // revision id void SetName(const Char_t *name); void SetPlatformType(Int_t type) {fPlatformType = type;} void SetParentName(const Char_t *parent); void SetSize(Double_t x, Double_t y, Double_t z); void SetPosition(Double_t x, Double_t y, Double_t z); void SetAngles(Double_t theta, Double_t phi, Double_t psi); void SetRevisionId(Int_t revision) {fRevisionId = revision;} void ReadAsciiFile(const Char_t *file); void WriteAsciiFile(const Char_t *file); public: BrDbDetectorVolume(); BrDbDetectorVolume(const Char_t *name, const Char_t *parentName, Int_t specAngle, Int_t validstart, Int_t validstop, Int_t fromstart, Int_t fromend, Int_t date, Double_t posX, Double_t posY, Double_t posZ, Double_t theta, Double_t phi, Double_t psi, Double_t sizeX, Double_t sizeY, Double_t sizeZ, ERunTypes runType=kTypeData); BrDbDetectorVolume(const Char_t *file); static const Char_t* kTableName; static BrDbQuery* Create(void); static BrDbDetectorVolume* 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 GetDate() const {return fDate;} Double_t GetSizeX() const {return fSizeX;} Double_t GetSizeY() const {return fSizeY;} Double_t GetSizeZ() const {return fSizeZ;} Double_t GetTheta() const {return fTheta;} Double_t GetPhi() const {return fPhi;} Double_t GetPsi() const {return fPsi;} Double_t GetPosX() const {return fPosX;} Double_t GetPosY() const {return fPosY;} Double_t GetPosZ() const {return fPosZ;} const Char_t *GetParentName() const {return (const Char_t*)fParentName;} Int_t GetPlatformType() const {return fPlatformType;} Int_t GetRevisionId() const {return fRevisionId;} Int_t GetSpectrometerAngle() const {return fSpectrometerAngle;} ClassDef(BrDbDetectorVolume,1) // Run Class for BRAHMS database } ; #endif // // $Log: BrDbDetectorVolume.h,v $ // Revision 1.9 2002/03/28 18:08:44 hagel // Implemented ASCII read and write for BrDbDetectorVolume // // Revision 1.8 2002/02/08 22:55:48 hagel // Take advantage of new features of BrRotMatrix // // Revision 1.7 2001/10/08 10:51:47 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.6 2001/09/05 03:59:12 hagel // Added GetDate method // // Revision 1.5 2001/08/14 14:45:36 hagel // Yet another iteration on GeometryDB // // Revision 1.4 2001/08/02 03:13:46 hagel // Yet another iteration on GeometryDB; this should be close to last // // Revision 1.3 2001/06/22 17:38:03 cholm // Minor changes // // Revision 1.2 2001/06/22 02:56:48 hagel // Improvements in GeometryDB // // Revision 1.1.1.1 2001/06/21 14:55:18 hagel // Initial revision of brat2 // // Revision 1.4 2001/06/05 18:38:27 cholm // Removed BrDbInc.h an all references to it // // Revision 1.3 2001/05/07 21:22:30 hagel // Next iteration of Geometry DB // // Revision 1.2 2001/04/20 16:14:14 hagel // Rework MySQL mode of BrMagnetVolume // // Revision 1.1 2001/03/07 16:52:59 hagel // Initial revision, probably needs more iterations //