#ifndef TECALBar_hxx_seen #define TECALBar_hxx_seen // root #include // oaEvent #include #include #include //oaGeomInfo #include namespace COMET { class IECALBar; }; /// Class for managing the geometry information associated with an ECal /// scintillator bar. /// Note that none of the methods are guaranteed to leave the geometry /// manager untouched. The current node, for example, may change. class COMET::IECALBar: public COMET::IScintBarGeom { // Note for contributors: // This class should work on the assumption that the IECalIdFinder in // oaEvent did its job, and all IGeometryId are set properly. // Therefore, no usage of geometry paths should be required. friend class IECALModule; public: /// The ECal bar represented by a GeometryId. /// The orientation (0 is X, 1 is Y) is the axis perpendicular /// to the lie of the bar. /// The number of photosensors that are attached (2, 1, -1) /// where the sign determines read-out end in bar's coord system. IECALBar(COMET::IGeometryId geomId, int orientation, int nsensors, int layer_number, int bar_number); ~IECALBar(){} /// Returns the full length of the bar. double GetLength() const; /// Returns the number of the bar within it's layer. Indexed from 0. int GetBarNumber() const { return fBarNumber; } /// Returns the layer in which the bar lies. Indexed from 0. int GetLayerNumber() const { return fLayerNumber; } /// Returns a position in the global coordinate system of the /// centre of the bar, at the positive end of the bar's length /// if orientation = +1, or at the neagative end of the bar's /// length if orientation = -1. /// Will return a zero vector if orientation is neither +1 nor -1. TVector3 GetEnd(const int orientation) const; private: /// Layer in which the bar lies. /// 0 <= fLayerNumber <= number of layers in the module. int fLayerNumber; /// Number of the bar within it's layer. /// 0 <= fBarNumber <= number of bars in the layer. int fBarNumber; }; #endif