#ifndef SIDISK_HPP #define SIDISK_HPP // // $Id: SiDisk.hpp,v 1.12 2001/02/03 22:53:36 hobbs Exp $ // // File: SiDisk.hpp // // Purpose: Implement a silicon disk. A disk contains wedge holders, which are // pure positioners and which hold one wedge in F disks and two wedges // in H disks. Within a given disk, wedge holders are numbered from // 1 to N. // // This implementation defines logical subdisks. These are not // part of the standard geometry description, so need not be directly // accessed. The subdisk1 (subdisk2) wedge holders are at // negative (positive) z in the local disk coordinate system // and contain odd (even) numbered wedge holders. // // Created: 18-NOV-1997 Thomas Trippe // // $Revision: 1.12 $ // // // Include files #include #include #include #include #include // Global definitions class SiDisk; /** Implement a silicon subdisk. */ class SiSubDisk: public dgs::Disk { public: /// Default constructor (empty subdisk). SiSubDisk(); /** Instantiate a standard subdisk. @param radius radius of the subdisk. @param nwedgeholders number of wedgeholders attached to the subdisk. @param phi0 phi value of the first wedgeholder. */ SiSubDisk(float radius, int nwedgeholders, float phi0, const SiWedgeHolder* prototype); /** Instantiate a subdisk containing the given wedgeholders. @param radius radius of the subdisk. @param nwedgeholders number of wedgeholders attached to the subdisk. @param phi0 phi value of the first wedgeholder. */ SiSubDisk(float radius, int nwedgeholders, float phi0, const std::vector &wedgeholders); /** Return the address of the children. Used within dgs::GeometryElement and ReferencePoint to do positioning. */ const std::list get_children(); /// Return the number of wedgeholders. int get_wedgeholder_count() const; /// Return constant reference to a wedgeholder. const SiWedgeHolder* get_wedgeholder(int iwedho) const; /// Return modifiable reference to a wedgeholder. SiWedgeHolder* get_mutable_wedgeholder(int iwedho); friend bool operator <(const SiSubDisk& lhs, const SiSubDisk &rhs); friend bool operator ==(const SiSubDisk& lhs, const SiSubDisk &rhs); friend bool operator !=(const SiSubDisk& lhs, const SiSubDisk &rhs); private: /// Vector to hold the wedgeholders. std::vector _wedgeholders; /** Rotate a wedgeholder $180^o$ around the local $y$ axis. */ void flip_wedgeholder(int iwedh); friend class SiDisk; public: D0_OBJECT_SETUP(SiSubDisk); }; /** Implement a silicon disk. A disk contains wedge holders, which are pure positioners and which hold one wedge in F disks and two wedges in H disks. Within a given disk, wedge holders are numbered from 1 to N. This implementation defines logical subdisks. These are not part of the standard geometry description, so need not be directly accessed. The subdisk1 (subdisk2) wedge holders are at negative (positive) z in the local disk coordinate system and contain odd (even) numbered wedge holders. */ class SiDisk: public dgs::ReferencePoint { public: /// Default constructor (empty disk). SiDisk(); /** Instantiate a standard disk. It consists of subdisk 1 at negative z and subdisk 2 at positive z in local disk coordinates. @param radius disk radius. @param phi0 phi value at the center of the first wedgeholders in subdisks 1. @param phi1 phi value at the center of the first wedgeholders in subdisks 2. Constraint: 0 $<=$ phi0 $<=$ phi1 $<=$ pi @param flipped 0 or 1 for p or n side facing the IP. @param separation subdisks 1 (2) are positioned at +(-)separation/2. */ SiDisk(float radius, int nwedgeholders, float phi0, bool flipped, const SiWedgeHolder* prototype, float phi1, float separation, bool spun); /** Instantiate a disk containing the specified wedgeholders. It consists of subdisk 1 at negative z and subdisk 2 at positive z in local disk coordinates. @param radius disk radius. @param phi0 phi value at the center of the first wedgeholders in subdisks 1. @param phi1 phi value at the center of the first wedgeholders in subdisks 2. Constraint: 0 $<=$ phi0 $<=$ phi1 $<=$ pi @param flipped 0 or 1 for p or n side facing the IP. @param separation subdisks 1 (2) are positioned at +(-)separation/2. This constructor uses 'friend' access to SiSubDisk. */ SiDisk(float radius, int nwedgeholders, float phi0, bool flipped, const std::vector& wedgeholders, float phi1, float separation, bool spun); /** Return the address of the children. Used within dgs::GeometryElement and ReferencePoint to do positioning. */ const std::list get_children(); /** Mimic the Disk positioning and resizing by passing them on to subdisks. These will be used during alignment. */ void resize(float dr); /** Vary the separation between subdisks. Used during alignment (not implemented yet). */ void set_separation(float dsep); /// Return the number of subdisks. int get_subdisk_count() const; /// Return constant access to subdisks. const SiSubDisk* get_subdisk(int isub) const; /// Return the number of wedgeholders. int get_wedgeholder_count() const; /** Return a reference to an wedge holder. The wedge holder may not be modified. This uses the silicon numbering scheme: iwedho = 1 to N for wedge holders, internally mapped onto subdisks. In the mapping, subdisk1 (subdisk2) wedge holders correspond to odd (even) numbered D0 wedge holders. */ const SiWedgeHolder* get_wedgeholder(int iwedho) const; /** Return a reference to an wedgeholder. The wedgeholder may be modified as a result. This uses the silicon numbering scheme: iwedho = 1 to N for wedge holders, internally mapped onto subdisks. In the mapping, subdisk1 (subdisk2) wedge holders correspond to odd (even) numbered D0 wedge holders. */ SiWedgeHolder* get_mutable_wedgeholder(int iwedho); /// Text dump a disk. friend std::ostream& operator <<(std::ostream& os, const SiDisk& me); friend bool operator <(const SiDisk& lhs, const SiDisk &rhs); friend bool operator ==(const SiDisk& lhs, const SiDisk &rhs); friend bool operator !=(const SiDisk& lhs, const SiDisk &rhs); private: /// Subdisk at negative local z SiSubDisk _subdisk1; /// Subdisk at positive local z SiSubDisk _subdisk2; public: D0_OBJECT_SETUP(SiDisk); }; // Constructors/Destructors // Accessors inline const SiSubDisk* SiDisk::get_subdisk(int isub) const { if( isub == 1 ) return &_subdisk1; // subdisk at negative local z if( isub == 2 ) return &_subdisk2; // subdisk at positive local z else return 0; } inline int SiDisk::get_subdisk_count() const { int nsubdisks = 2; return nsubdisks; } #endif //SIDISK_HPP