Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 #include "MuonGeoModel/Cutout.h"
002 #include "GeoModelKernel/GeoBox.h"
003 #include "GeoModelKernel/GeoPara.h"
004 #include "GeoModelKernel/GeoTrd.h"
005 #include "GeoModelKernel/GeoTrap.h"
006 #include "GeoModelKernel/GeoTransform.h"
007 #include "GeoModelKernel/GeoShapeShift.h"
008 #include "CLHEP/Geometry/Transform3D.h"
009 #include "CLHEP/Units/SystemOfUnits.h"
010 
011 namespace MuonGM {
012 
013 Cutout::Cutout()
014 {
015     dx=dy=widthXs=widthXl=lengthY=excent=dead1=thickness=0.;
016     ijob=subtype=icut=0;
017 }
018 
019 Cutout::Cutout(const Cutout& c)
020 {
021   dx=c.dx;
022   dy=c.dy;
023   widthXs=c.widthXs;
024   widthXl=c.widthXl;
025   lengthY=c.lengthY;
026   excent=c.excent;
027   dead1=c.dead1;
028   ijob=c.ijob;
029   subtype=c.subtype;
030   icut=c.icut;
031   thickness = c.thickness;
032 }
033 
034 void Cutout::setThickness(double compThickness)
035 {
036   thickness = compThickness;
037 }
038 
039 const GeoShape* Cutout::build()
040 {
041   // GeoModel x = chamber thickness (amdb z), y=width (amdb x)
042   //          z= chamber length (amdb y)
043   //  cutout widthXf parallel chamber width, cutout thickness
044   //    = component thickness, cutout lengthY parallel chamber L.
045   // position it with its intrinsic position info:
046   double zpos = dy+lengthY/2.;
047 //  std::cout << "translate 0, "<<dx<<", "<<zpos<<std::endl;
048 //  std::cout << "widthXl="<<widthXl<<" widthXs="<<widthXs<<" lengthY="
049 //          <<lengthY<<" excent="<<excent<<" dead1="<<dead1<<std::endl;
050   HepTransform3D xfTemp = HepTranslate3D(0.,dx,zpos);
051   const GeoShape *sCutout;
052   /*
053   // This is just to make sure we are putting stuff in the right place:
054   GeoBox *cutoutbox = new GeoBox(thickness/2.,widthXl/2.,lengthY/2.);
055   sCutout = & ( (*cutoutbox) <<xfTemp);
056   */
057   // This is the proper way to do it, but not sure if complicated working...
058   if (widthXl==widthXs && dead1 == 0.)
059     {
060       GeoBox *cutoutbox = new GeoBox(thickness/2.,widthXs/2.,lengthY/2.);
061       sCutout = & ( (*cutoutbox) <<xfTemp);
062       cutoutbox->ref();
063       cutoutbox->unref();
064     }
065   else if (dead1 ==0.)
066     {
067       GeoTrd *cutouttrd = new GeoTrd(thickness/2., thickness/2.,
068                                      widthXs/2., widthXl/2.,
069                                      lengthY/2.);
070       sCutout = & ( (*cutouttrd) <<xfTemp);
071     }
072   else if (widthXl==widthXs)
073     {
074       // angle between length-axis and HV/RO ends of chamber:
075       double alpha = atan(2.*excent/lengthY);
076       // polar and azimuthal angles of vector describing offset of
077       //   cutout planes:
078       double theta = -dead1*degree;
079       double phi = -90.*degree;
080       // GeoPara requires the +/- z faces be parallel to the x-y plane,
081       //   so choose x = width, y=length, z=thickness:
082       GeoPara *cutoutpara = new GeoPara(widthXs/2.,lengthY/2.,thickness/2.,
083                                         alpha,theta,phi);
084       // now rotate it so thickness is x-axis, width is y-axis, length z-axis:
085       HepTransform3D xRot = HepRotateX3D(-90.*degree)*
086         HepRotateY3D(-90.*degree);
087       xfTemp = xfTemp * xRot;
088       sCutout = & ( (*cutoutpara) <<xfTemp);
089       cutoutpara->ref();
090       cutoutpara->unref();
091     }
092   else  
093     {
094       GeoTrap *cutouttrap = new GeoTrap(thickness/2.,dead1*degree,90.*degree,
095                                         excent,widthXs/2.,widthXl/2.,
096                                         atan((2.*excent+(widthXl-widthXs)/2.)/
097                                              lengthY),
098                                         excent,widthXs/2.,widthXl/2.,
099                                         atan((2.*excent+(widthXl-widthXs)/2.)/
100                                              lengthY)
101                                         );
102       // now rotate it so thickness is x-axis, width is y-axis, length z-axis:
103       HepTransform3D xRot = HepRotateX3D(-90.*degree)*
104         HepRotateY3D(-90.*degree);
105       xfTemp = xfTemp * xRot;
106       sCutout = & ( (*cutouttrap) <<xfTemp);
107       cutouttrap->ref();
108       cutouttrap->unref();
109     }
110   
111   return sCutout;
112 }
113 
114 
115 std::ostream& operator<<(std::ostream &os, const Cutout& p)
116 {
117         os<<" Cutout: "
118           <<" x/y/width_s/width_l/length/excent/dead1: "
119           <<p.dx<<" "
120           <<p.dy<<" "
121           <<p.widthXs<<" "
122           <<p.widthXl<<" "
123           <<p.lengthY<<" "
124           <<p.excent<<" "
125           <<p.dead1
126           <<" component index="<<p.ijob;
127         
128         return os;
129 }
130 } // namespace MuonGM
131 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!