#ifndef TSMRDGeom_hxx_seen #define TSMRDGeom_hxx_seen #include #include #include #include #include #include #include #include "IScintBarGeom.hxx" #include "IGeomBase.hxx" namespace COMET { OA_EXCEPTION(ENoSuchSMRDBarGeom, EoaGeomInfo); class ISMRDGeom; class TSMRDGeomVisitor; class IGeomInfo; }; /// Minimal sub-detector ROOT geometry info class used in IGeomInfo. This /// contains useful information about the scintillator bars geometry and layout. /// All of the information is derived from the ROOT TGeoManager geometry /// description of the off-axis detector. Each subdetectors can be accessed /// with the following call : /// IGeomInfo::Get().P0D() to access the IP0DGeom object /// IGeomInfo::Get().FGD() to access the IFGDGeom object /// IGeomInfo::Get().ECAL() to access the IECALGeom object /// IGeomInfo::Get().SMRD() to access the ISMRDGeom object class COMET::ISMRDGeom: public COMET::IGeomBase { friend class TSMDGeomVisitor; friend class IGeomInfo; public: typedef std::map BarMap; ISMRDGeom(const char* mothervolname, const char* layername, const char* barname); virtual ~ISMRDGeom(); /// Return the scintillator bar information const IScintBarGeom& GetBar(COMET::IGeometryId geomId) const; /// Return a vector of nodes for bars that are part of this sub-detector. const BarMap& GetBars() const; /// Return the scintillator bar information void ls(const char* opt); /// clear the geometry information void Clear(); /// fill the scintlillator bars geometry information. This void Fill(); ///Return true if the hit is in the left clam bool IsInLeftClam(COMET::IHandle hit); ///Return true if the hit is in the left clam bool IsInRightClam(COMET::IHandle hit); ///Return true if the hit is in the SMRD arm - top of bottom bool IsSMRDArm(COMET::IHandle hit); ///Return true if the hit is in one of the SMRD sides - left or right bool IsSMRDSide(COMET::IHandle hit); ///Return true if the hit is in upper part of the SMRD bool IsSMRDTop(COMET::IHandle hit); ///Return true if the hit is in lower part of the SMRD bool IsSMRDBottom(COMET::IHandle hit); ///Return true if the hit is in upper wall of the SMRD bool IsSMRDTopWall(COMET::IHandle hit); ///Return true if the hit is in lower wall of the SMRD bool IsSMRDBottomWall(COMET::IHandle hit); ///Return true if the hit is in left wall of the SMRD bool IsSMRDLeftWall(COMET::IHandle hit); ///Return true if the hit is in right wall of the SMRD bool IsSMRDRightWall(COMET::IHandle hit); ///Return the ring number of the smrd modules. Ring is defined ///as a layer of scintilator modules placed with respect to the inner detectors. ///Ring No 1 is the most inner one. Ring No 6 is the most outer one. int GetSMRDRingNumber(COMET::IHandle hit); ///Return the number of magnet yoke. There are 16 yokes. ///Yoke No 1 is on the left side upstream and ///yoke No 16 is on the right side downstream. int GetMagnetYokeNumber(COMET::IHandle hit); ///Return the number of yoke ring. There are 8 rings. ///Yoke ring no 1 is the most upstream and yokering no 8 is the most downstream one. int GetYokeRingNumber(COMET::IHandle hit); ///Return the number of SMRD tower. Tower No 1 is placed in left-top and ///numbers are assigned clockwise. int GetSMRDTowerNumber(COMET::IHandle hit); ///Return the number of the SMRD scintillator(counter) in each wall in single yoke. ///For vertically oriented counters (MRDSide) we have 20 counters and for horizontally oriented 16. int GetSMRDScintNumber(COMET::IHandle hit); ///Return the number of scintillator bar in the module. There are 4 scintillator ///bars for horizontal and 5 for vertical modules. int GetSMRDBarNumber(COMET::IHandle hit); ///A flag for the hits in gaps which will be instumented in the SMRD. ///In SimG4's SMRD geometry there are six layers of scintillator ///in all yokes, but only part of them are instrumented. bool IsSMRD(COMET::IHandle hit); private: Bool_t FindModuleBars(); BarMap fBarList; std::string fMotherVol; std::string fLayerName; std::string fBarName; std::string Left; std::string Right; void setUpNames(); }; #endif