#ifndef SIBARREL_HPP #define SIBARREL_HPP // // $Id: SiBarrel.hpp,v 1.10 2001/02/03 22:53:35 hobbs Exp $ // // File: SiBarrel.hh // Purpose: // Created: 10-OCT-1997 John Hobbs // // $Revision: 1.10 $ // // // Include files #include #include #include #include // Global definitions /** Barrel section of the SMT. A SiBarrel is used to position the eight layers of silicon detector units (i.e. ladders) composing each of the SMT barrels. */ class SiBarrel: public dgs::ReferencePoint { public: /// Default constructor (empty barrel). SiBarrel(); /** Construct a barrel containing the given layers. If the ladders are spun to be anti-parallel to the global $z$ direction, flip them around here. @param spun If spun is false, then the (ideal) ladder local $z$ axis is parallel to global $z$. If true, local $z$ is anti-parallel to global $z$. */ SiBarrel(const std::vector &layers, bool spun=false); /** Return the address of the children. Used within dgs::GeometryElement and ReferencePoint to do positioning. */ const std::list get_children(); // Accessors and some I/O /// Return the number of layers. int get_layer_count() const; /// Return a constant reference to the ilayer-th layer. const SiLayer* get_layer(int ilayer) const; /// Return a modifiable reference to the ilayer-th layer. SiLayer* get_mutable_layer(int ilayer); /// Text dump a barrel. friend std::ostream& operator <<(std::ostream& os, const SiBarrel& me); friend bool operator<(const SiBarrel& lhs, const SiBarrel &rhs); /// Test that the barrels have the same layers (number and contents) friend bool operator==(const SiBarrel& lhs, const SiBarrel &rhs); friend bool operator!=(const SiBarrel& lhs, const SiBarrel &rhs); private: /// Vector to hold the layers. std::vector _layers; /// Rotate a ladder of $180^o$ around the local $y$ axis. void flip_ladders(); public: D0_OBJECT_SETUP(SiBarrel); }; // Inlines #include #endif //SIBARREL_HPP