#ifndef HGEOSET_H #define HGEOSET_H #include "hgeoparam.h" #include "hnamedlist.h" #include "hgeoinfo.h" #include "hgeomedia.h" #include "hgeoshapes.h" #include "hadexitcodes.h" // // base class for Cave, sectors, coils and all detectors; // // It is implemented as a linked list via the template class HNamedList. // Each listelement has a name and a value (class) of type HGeoParam. The // listelements are accessed by their names. // Successively all volumes of a detector are read and appended to the list with // their names and values. // All derived classes must have functions readDet(...) to read the geometrical // informations from database or file. // Also all derived classes must have a function createDet(...) to create the // detector and a funtion createHits(...) if this detector contains // sensitive volumes. // All other functions in this baseclass are helperfunctions used in the derived // classes to build these virtual functions. (minimizes codewriting) // // The elements keepinNmame, detName, eleName are defined in the derived classes. // ( keepinNmame must not be defined if the detector has no special keepin-volume // or it can be used to read parts on an other detectors for exemple in Tof.) // // The element pShapes is a pointer to the class HGeoShapes, which is used in // all detector-classes for shapedependent reads and calculations. This class // is instantiated only once in hgeocreatesetup.cc. // class HGeoSet : public HNamedList { public: HGeoSet() : HNamedList() {pShapes=0;} ~HGeoSet(){} // reads the detector from the database; // code in the derived classes; virtual int readDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia) { return HFAILURE; } // reads the detector from file // code in the derived classes; virtual int readDet(HGeoInfo & geoInfo) { return HFAILURE; } // creates detector // code in the derived classes; virtual int createDet(HGeoInfo & geoInfo, HGeoMedia & geoMedia){ return HFAILURE; } // defines sensitive detector and hitparameter // code in the derived classes; virtual int createHits(HString & copyName) { return HFAILURE; } // reads 6 volumes (one in each sector) with the substring keepinName // in its name from file // (used for example to read keepin-volumes of shower detectors) int readKeepIn(HGeoInfo & geoInfo); // reads a module with the substring detName in its name from file // (used for example to read one driftchamber) int readModule(HGeoInfo & geoInfo); // reads mother, shape, material, points and coordiate-system from file int readParam(HGeoInfo & geoInfo, HGeoParam & ele); // reads mother and coordiate-system from file // (used to read the copies of a volume) int readCopy(HGeoInfo & geoInfo, HGeoParam & ele); // reads inout-flag from file void readInout(HGeoInfo & geoInfo, HGeoParam & ele); // reads points and coordiate-system from file int readVol(HGeoInfo & geoInfo, HGeoParam & ele); // reads 6 volumes (one in each sector) with the substring keepinName // in its name from the database int readKeepIn(HGeoInfo & geoInfo, HGeoMedia & geoMedia); // reads a module with the substring detName in its name from the // database int readModule(HGeoInfo & geoInfo, HGeoMedia & geoMedia); // reads mother, shape, material, points and coordiate-system from the // database int readParam(HGeoInfo & geoInfo, HString & volName, HGeoParam & ele, HGeoMedia & geoMedia); // reads all informations of all daughters of a mothervolume from the // database int readDaughters(HGeoInfo & geoInfo, HString & moName, HGeoMedia & geoMedia); // reads points and coordiate-system from the database int readVol(HGeoInfo & geoInfo, HString & volName, HGeoParam & ele); // creates all volumes with the substring keepinName in its name int createKeepIn(HGeoInfo & geoInfo,HGeoMedia & geoMedia); // creates all volumes of a module with the substring detName in its name int createModule(HGeoInfo & geoInfo,HGeoMedia & geoMedia); // showes name and input-parameters of a volume void showAll(HString & volName, HGeoParam & ele); // shows the element keepinName; HString showKeepinName(){return keepinName;} // shows the element detName; HString showDetName(){return detName;} // shows the element eleName; HString showEleName(){return eleName;} protected: // unique substring of the name of the keepin-volume HString keepinName; // unique substring of the name of the module HString detName; // substring of the names of all daughtervolumes of the module HString eleName; // pointer to the class HGeoShapes // All shapedependent reads and calculations are done within this class. HGeoShapes *pShapes; }; #endif