00001 #ifndef DDPixFwdBlades_h 00002 #define DDPixFwdBlades_h 00003 00004 /* 00005 00006 == CMS Forward Pixels Geometry == 00007 00008 @version 3.02.01 May 30, 2006 00009 @created Dmitry Onoprienko 00010 00011 == ALGORITHM DESCRIPTION: == 00012 00013 Algorithm for placing one-per-blade components 00014 Also computes parameters necessary for defining the "nipple" geometry. 00015 00016 == Parameters : == 00017 00018 "Endcap" - +1 if placing the child volume into +Z disk, -1 if placing into -Z disk. 00019 "Child" - name of a child volume being places (should be in the form "file:volume") 00020 In no child name is given, the algorithm simply calculates Nipple parameters. 00021 "ChildRotation" - rotation of the child volume with respect to the "blade frame". [OPTIONAL] 00022 "ChildTranslation" - vector defining translation of the child volume with respect to the 00023 "blade frame". [OPTIONAL] 00024 "FlagString" - string of 24 characters, used to indicate blades into which the child volume 00025 should be placed. [OPTIONAL] 00026 "FlagSelector" - 1 character string, key to interpreting "FlagString". 00027 Positions in "BladeFlag" that have this character will get the child volume. 00028 00029 If "Child" parameter is omitted, the algorithm computes rotation needed for describing 00030 coolant "nipples" but does not do any placements. 00031 00032 If "Child" is "PixelForwardNippleZPlus" or "PixelForwardNippleZMinus" and no rotation or translation 00033 is supplied, correct rotations and translations are automatically computed. 00034 00035 Blade frame: origin on the axis of the blade at a distance "ancorRadius" from the beam line 00036 (it therefore coincides with the ancor point of a blade). 00037 Y along blade axis pointing away from beam line, Z perpendicular to blade plane and pointing away from IP. 00038 (That assumes the axes of ZPlus disk are aligned with CMS global reference frame, and ZMinus disk 00039 is rotated around Y by 180 degrees.) 00040 00041 == Example of use : == 00042 00043 <Algorithm name="track:DDPixFwdBlades"> 00044 <rParent name="pixfwdDisk:PixelForwardDiskZMinus"/> 00045 <Numeric name="Endcap" value="-1." /> 00046 <String name="Child" value="pixfwdPanel:PixelForwardPanel4Left"/> 00047 <Vector name="ChildTranslation" type="numeric" nEntries="3"> 0., -[pixfwdPanel:AncorY], [zPanel] </Vector> 00048 <String name="ChildRotation" value="pixfwdCommon:Y180"/> 00049 <String name="FlagString" value="LRRRRLRRRRRRLRRRRLRRRRRR" /> <!-- Panel Layout ZMinus 4 --> 00050 <String name="FlagSelector" value="L" /> 00051 </Algorithm> 00052 00053 */ 00054 00055 #include <map> 00056 #include <string> 00057 #include <vector> 00058 #include "DetectorDescription/Base/interface/DDTypes.h" 00059 #include "DetectorDescription/Algorithm/interface/DDAlgorithm.h" 00060 #include "DetectorDescription/Core/interface/DDTransform.h" 00061 #include "CLHEP/Vector/ThreeVector.h" 00062 #include "CLHEP/Vector/Rotation.h" 00063 00064 class DDPixFwdBlades : public DDAlgorithm { 00065 00066 public: 00067 00068 // Constructors & Destructor : -------------------------------------------------------- 00069 00070 DDPixFwdBlades(); 00071 virtual ~DDPixFwdBlades(); 00072 00073 // Initialization & Execution : ------------------------------------------------------- 00074 00075 void initialize(const DDNumericArguments & nArgs, 00076 const DDVectorArguments & vArgs, 00077 const DDMapArguments & mArgs, 00078 const DDStringArguments & sArgs, 00079 const DDStringVectorArguments & vsArgs); 00080 00081 void execute(DDCompactView& cpv); 00082 00083 // ------------------------------------------------------------------------------------- 00084 00085 private: 00086 00087 // -- Input geometry parameters : ----------------------------------------------------- 00088 00089 int nBlades; // Number of blades 00090 double bladeAngle; // Angle of blade rotation around axis perpendicular to beam 00091 double zPlane; // Common shift in Z for all blades (with respect to disk center plane) 00092 double bladeZShift; // Shift in Z between the axes of two adjacent blades 00093 00094 double ancorRadius; // Distance from beam line to ancor point defining center of "blade frame" 00095 00096 // Coordinates of Nipple ancor points J and K in "blade frame" : 00097 00098 double jX; 00099 double jY; 00100 double jZ; 00101 double kX; 00102 double kY; 00103 double kZ; 00104 00105 // -- Algorithm parameters : ---------------------------------------------------------- 00106 00107 double endcap; // +1 for Z Plus endcap disks, -1 for Z Minus endcap disks 00108 00109 std::string flagString; // String of flags 00110 std::string flagSelector; // Character that means "yes" in flagString 00111 00112 std::string childName; // Child volume name 00113 00114 std::vector<double> childTranslationVector; // Child translation with respect to "blade frame" 00115 std::string childRotationName; // Child rotation with respect to "blade frame" 00116 00117 // ------------------------------------------------------------------------------------- 00118 00119 std::string idNameSpace; //Namespace of this and ALL sub-parts 00120 00121 std::map<std::string, int> copyNumbers; 00122 00123 CLHEP::HepRotation* nippleRotationZPlus; 00124 CLHEP::HepRotation* nippleRotationZMinus; 00125 double nippleTranslationX, nippleTranslationY, nippleTranslationZ; 00126 00127 // -- Helper functions : -------------------------------------------------------------- 00128 00129 int issueCopyNumber(); 00130 00131 void computeNippleParameters(double endcap); 00132 00133 // ------------------------------------------------------------------------------------- 00134 00135 }; 00136 00137 #endif