Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:24

0001 #ifndef DETECTOR_DESCRIPTION_CORE_DD_POS_DATA_H
0002 #define DETECTOR_DESCRIPTION_CORE_DD_POS_DATA_H
0003 
0004 #include "DetectorDescription/Core/interface/DDTransform.h"
0005 #include "DetectorDescription/Core/interface/DDTranslation.h"
0006 #include "DetectorDescription/Core/interface/DDDivision.h"
0007 
0008 //! Relative position of a child-volume inside a parent-volume
0009 /**
0010   simple struct to collect information concerning the relative
0011   position of a child inside its parent.
0012 */
0013 struct DDPosData {
0014   //! Creates a new relative position
0015   /** \arg \c t relative translation std::vector
0016       \arg \c r relative rotation matrix
0017       \arg \c c copy number
0018       
0019       Users normally don't create DDPosData themselves. They get read access
0020       to relative positionings via DDPosData in DDCompactView.
0021   */
0022   DDPosData(const DDTranslation& t, const DDRotation& r, int c, const DDDivision* d = nullptr)
0023       : trans_(t), rot_(r), copyno_(c), div_(d) {}
0024   DDPosData() = delete;
0025   DDPosData& operator=(const DDPosData&) = delete;
0026 
0027   const DDTranslation& translation() const { return trans_; }
0028   const DDTranslation& trans() const { return trans_; }
0029 
0030   const DDRotationMatrix& rotation() const { return rot_.rotation(); }
0031   const DDRotationMatrix& rot() const { return rot_.rotation(); }
0032   const DDRotation& ddrot() const { return rot_; }
0033   int copyno() const { return copyno_; }
0034 
0035   const DDDivision& div() const { return *div_; }
0036   const DDDivision& division() const { return *div_; }
0037 
0038 private:
0039   DDTranslation trans_;   /**< relative translation std::vector */
0040   DDRotation rot_;        /**< relative rotation matrix */
0041   int copyno_;            /**< copy number */
0042   const DDDivision* div_; /**< provides original division that created this pos */
0043 };
0044 
0045 #endif