// -*- mode: c++ -*- // // $Id: BrParameterDbManager.h,v 1.1.1.1 2001/06/21 14:55:17 hagel Exp $ // #ifndef BRAT_BrParameterDbManager #define BRAT_BrParameterDbManager #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif // BRAHMS Classes class BrDbObject; class BrParameterDbManager : public TObject { private: enum DbStatus_t { INIT, OPEN, DEFAULT_PARAMETER_SET }; public: static BrParameterDbManager* 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: BrParameterDbManager(); public: ~BrParameterDbManager(); public: void SetDbParameterFileName(Char_t* filename); void SetDebugLevel(Int_t level){fDebugLevel=level;} Bool_t Open(Char_t *filename); void SetOptionDefaultParameters() { fState = DEFAULT_PARAMETER_SET;} TObject* GetDetectorParameters(const Char_t* classname, const Char_t* detector); void List(); private: BrDbObject* GetDbObject(const Char_t* classname, const Char_t* detector); TObjArray* fObjectlist; // List DbStatus_t fState; // State of file Char_t fFileName[132]; // Filename for parameters (fileopen) Int_t fDebugLevel; // Debug Level static BrParameterDbManager* fInstance; ClassDef(BrParameterDbManager,0) // BRAHMS Parameter Database Manager object }; #endif // // $Log: BrParameterDbManager.h,v $ // Revision 1.1.1.1 2001/06/21 14:55:17 hagel // Initial revision of brat2 // // Revision 1.6 2001/06/05 18:39:29 cholm // Removed BrDbInc.h an all references to it // // Revision 1.5 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.4 1999/03/07 00:00:43 hagel // 1. Implemented BrFSTrackingModule. Started with BrMRSTrackingModule and made // appropriate changes to handle the forward spectrometer. It uses the new // track classes as well as extensively using geometry classes. It also uses // new methods and functionality as described below. // 2. Changed BrMagnetVolume // a. Added method SwimBack(BrLine3D &,Double_t momentum): takes a // track at the exit of magnet and given the momentum, calculates // where the track would come into the front of the magnet. // b. Added method GlobalToLocal(BrLine3D &): does a combination of // GlobalToLocal(BrVector3D &,BrVector3D&,0) and // GlobalToLocal(BrVector3D &,BrVector3D&,1) // c. Added method LocalToGlobal(BrLine3D &): does a combination of // LocalToGlobal(BrVector3D &,BrVector3D&,0) and // LocalToGlobal(BrVector3D &,BrVector3D&,1) // d. Changed BrDetectorVolume: same additions of methods GlobalToLocal // and LocalToGlobal as in BrMagnetVolume // 2. Added a parameter base class BrDetectorParamsBase: helps when reading // in database files. Declared ASCII reading routines to be virtual. // Has main ReadASCIIFile which decodes the ASCII parameter files, then // calls the detector specific methods SetASCIIParameter // 3. Implemented SetASCIIParameter in BrDetectorParamsDC, BrDetectorParamsTPC, // BrDetectorParamsTof, BrDetectorParamsBB // 4. Implemented BrParameterDbManager. It currently works similarly to // BrGeometryDbManager and creates the BrDetectorParamsXXX objects when // called. These objects then read in ASCII parameter files with a currently // "well defined" format using the above implemented routines using a constructor: // BrDetectorParamsXXX(Char_t *name, Char_t *title,Char_t *ASCIIFileName); // 5. If no parameter file is specified, it executes the constructor we // have been using so far, namely BrDetectorParamsXXX(Char_t *name,Char_t *title). // These constructors generate default parameters and are semi-intelligent // which means they generate approximately appropriate parameters depending // upon which detector they are. I should say that the parameters were // deemed appropriate at the time of writing the SetDefaultParams routine. // a. It is used in the same way as BrGeometryDbManager, that is: // BrParameterDbManager *gParamDb = BrParameterDbManager::Instance(); // gParamDb->SetDbParameterFileName("DetectorParameters.txt"); // 6. Added a new directory, params, in BRAT. This directory has the file // DetectorParameters.txt in it. If the BrParameterDbManager is started // and the DetectorParameter.txt file is specified, it will look in the // $BRATSYS/params directory if it cannot find the file in the directory // that the user has set default to. // 7. Implemented BrParameterDbManager in DC digitize and tracking code. The // SetDetectorParams methods have been moved to private and can no longer be // used from the macro or program. // 8. Implemented BrParameterDbManager in TPC digitize and tracking code. // 9. Implemented BrParameterDbManager in Tof Calibrate and GeneratePid code. // 10 Changed the GetEntries() in BrDataTable to use the GetLast()+1 method in // TObjArray. This should be much faster, but has the caveat that it assumes // that all slots in TObjArray are full. That seems to me to be the case // in how we use TObjArray at least in BrDataTable, but if problems arise due // to this change, it can always be easily changed back. It has been used a // fair amount before checking in and no problems were found. // // Modified Files: // base/inc/BrBase_LinkDef.h base/inc/BrDataTable.h // base/inc/BrDetectorVolume.h base/inc/BrMagnetVolume.h // base/inc/LinkDefBratBaseINC.h base/src/BrDataTable.cxx // base/src/BrDetectorVolume.cxx base/src/BrEventNode.cxx // base/src/BrMagnetVolume.cxx base/src/BrTableManager.cxx // base/src/Makefile bb/inc/BrDetectorParamsBB.h // bb/src/BrDetectorParamsBB.cxx db/inc/BrParameterDbManager.h // db/src/BrParameterDbManager.cxx dc/inc/BrDetectorParamsDC.h // dc/src/BrDetectorDC.cxx dc/src/BrDetectorParamsDC.cxx // dc/src/BrDigitizeDC.cxx dc/src/BrLocalTrackDC.cxx // geometry/inc/BrPlane3D.h geometry/src/BrPlane3D.cxx // params/DetectorParameters.txt tof/inc/BrDetectorParamsTof.h // tof/src/BrDetectorParamsTof.cxx tof/src/BrGeneratePid.cxx // tpc/inc/BrDetectorParamsTPC.h tpc/src/BrDetectorParamsTPC.cxx // tpc/src/BrDetectorTPC.cxx tpc/src/BrDigitizeTPC.cxx // tpc/src/BrLocalTrackTPC.cxx track/inc/BrDetectorTrack.h // track/inc/BrFSTrackingModule.h // track/inc/BrSpectrometerTracks.h track/src/BrDetectorTrack.cxx // track/src/BrFSTrackingModule.cxx // track/src/BrSpectrometerTracks.cxx // // Revision 1.3 1999/02/24 15:21:22 hagel // Enforce const in arguments // // Revision 1.2 1999/02/17 21:26:01 hagel // Removed cyclic dependencies from BrParameterDbManager. Now all references are // indirect using ROOT infrastructure to get at the classes. If this works, it is // general and should be considered for the other DbManager classes. Or perhaps // in a base DbManager class. // // Revision 1.1 1999/02/04 20:43:31 hagel // Initial revision // See cvs log notes in BrParameterDbManager.cxx for more information // // //