001 #include "MuonGeoModel/Sup.h"
002 #include "MuonGeoModel/SUP_Technology.h"
003 #include "MuonGeoModel/Station.h"
004 #include "MuonGeoModel/SupComponent.h"
005 #include "MuonGeoModel/MYSQL.h"
006 #include "MuonGeoModel/Cutout.h"
007 #include "MuonGeoModel/SimpleVolAction.h"
008 #include "GeoModelKernel/GeoTrd.h"
009 #include "GeoModelKernel/GeoVPhysVol.h"
010 #include "GeoModelKernel/GeoPhysVol.h"
011 #include "GeoModelKernel/GeoShape.h"
012 #include "GeoModelKernel/GeoLogVol.h"
013 #include "GeoModelKernel/GeoMaterial.h"
014 #include "GeoModelKernel/GeoShapeShift.h"
015 #include "GeoModelKernel/GeoShapeSubtraction.h"
016
017 namespace MuonGM {
018
019
020 Sup::Sup(Component* ss): DetectorElement(ss->name)
021 {
022 SupComponent* s = (SupComponent*)ss;
023 width = s->dx1;
024 length = s->dy;
025 MYSQL* mysql = MYSQL::GetPointer();
026 SUP* sup = (SUP*)mysql->GetTechnology(s->name);
027 thickness = sup->thickness;
028 component = s;
029 }
030
031
032 GeoVPhysVol* Sup::build()
033 {
034 std::vector<const GeoShape*> vcutouts;
035 int cutoutson = 0;
036 return build(cutoutson, vcutouts);
037 }
038
039 GeoVPhysVol* Sup::build(int cutoutson,
040 std::vector<const GeoShape*> vcutouts)
041 {
042 MYSQL *mysql=MYSQL::GetPointer();
043 SUP *sup=(SUP *)mysql->GetTechnology(name);
044 std::cout<<" SUP build method for "<<name<<std::endl;
045
046 double totxgm = sup->thickness;
047 double totygm = width;
048 double totzgm = 0.;
049 double eps = 0.01*cm;
050
051 double x0=-sup->largeVerClearance+sup->alHorProfileThickness/2.;
052 std::cout<<"SUP::x0 for everybody "<<x0<<std::endl;
053
054
055 double z0=0.;
056
057 const GeoShape* ssup=NULL;
058 GeoPhysVol *psup=NULL;
059
060
061 const GeoMaterial *msup = matManager->getMaterial("std::Aluminium");
062 if(name.substr(3,1)=="3")
063 {
064 std::cout<<" recognised as type 3"<<std::endl;
065 totzgm = 2.*sup->alHorFlangeLength+sup->alVerProfileThickness+sup->HorClearance;
066 z0 = -sup->alVerProfileThickness-(sup->HorClearance-sup->alVerProfileThickness)/2.;
067 const GeoTrd *suptrd = new GeoTrd(totxgm/2, totxgm/2, totygm/2,
068 totygm/2, totzgm/2);
069 std::cout<<"SUP3::z0 "<<z0<<std::endl;
070 std::cout<<"SUP3::tot_x_y_z_gm, "<<totxgm<<" "<<totygm<<" "<<totzgm<<std::endl;
071
072
073 double xhsiz=sup->alVerFlangeLength/2+eps;
074 double yhsiz=width/2+eps;
075 double zhsiz=(totzgm
076 - sup->alHorFlangeLength
077 - sup->alVerProfileThickness
078 - sup->alFlangeThickness )/2.+eps;
079 const GeoTrd *cuttop = new GeoTrd(xhsiz, xhsiz, yhsiz, yhsiz, zhsiz);
080 std::cout<<"SUP3:: subtracting a box of size "<<xhsiz<<" "<<yhsiz<<" "<<zhsiz<<std::endl;
081 double xc = sup->largeVerClearance+sup->smallVerClearance+sup->alFlangeThickness + xhsiz + x0;
082 double yc = 0.;
083 double zc = sup->alVerProfileThickness+sup->HorClearance+sup->alFlangeThickness + zhsiz + z0;
084
085 ssup=suptrd;
086 ssup = & ( ssup->subtract ( (*cuttop) << HepTranslate3D( xc, yc, zc) ) );
087 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
088
089 xc = -xc;
090 zc = -zc;
091 ssup = & ( ssup->subtract ( (*cuttop)<<HepTranslate3D( xc, yc, zc) ) );
092 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
093
094 zc = zc + sup->HorClearance;
095 xc = -xc;
096 ssup = & ( ssup->subtract ( (*cuttop)<<HepTranslate3D( xc, yc, zc) ) );
097 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
098
099 xc = -xc;
100 zc = -zc;
101 ssup = & ( ssup->subtract ( (*cuttop)<<HepTranslate3D( xc, yc, zc) ) );
102 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
103
104
105
106
107 zc = zc + sup->alHorFlangeLength - sup->alFlangeThickness;
108 xc = xc + xhsiz + 0.5*sup->alFlangeThickness;
109 ssup = & ( ssup->subtract ( (*cuttop)<<HepTranslate3D( xc, yc, zc) ) );
110 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
111 xc = -xc;
112 zc = -zc;
113 ssup = & ( ssup->subtract ( (*cuttop)<<HepTranslate3D( xc, yc, zc) ) );
114 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
115
116
117
118 xhsiz=sup->largeVerClearance/2+10*eps;
119 yhsiz=width/2+10.*eps;
120 zhsiz=sup->alHorFlangeLength/2+10.*eps;
121 std::cout<<"SUP3:: subtracting a box of size "<<xhsiz<<" "<<yhsiz<<" "<<zhsiz<<std::endl;
122 const GeoTrd *cutbig = new GeoTrd(xhsiz, xhsiz, yhsiz, yhsiz, zhsiz);
123 xc = -sup->alHorProfileThickness/2. -2.*eps + xhsiz;
124 yc = 0.;
125 zc = sup->alVerProfileThickness + (sup->HorClearance-sup->alVerProfileThickness)/2. + zhsiz;
126
127 ssup = & ( ssup->subtract ( (*cutbig) << HepTranslate3D( xc, yc, zc) ) );
128 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
129
130 xc = -xc;
131 zc = -zc;
132 ssup = & ( ssup->subtract ( (*cutbig) << HepTranslate3D( -xc, yc, -zc) ) );
133 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
134
135
136 xhsiz=sup->smallVerClearance/2.;
137 yhsiz=width/2+eps;
138 zhsiz=sup->alHorFlangeLength/2+sup->HorClearance/2.+eps;
139 std::cout<<"SUP3:: subtracting a box of size "<<xhsiz<<" "<<yhsiz<<" "<<zhsiz<<std::endl;
140 const GeoTrd *cutsmall = new GeoTrd(xhsiz, xhsiz, yhsiz, yhsiz, zhsiz);
141
142 xc = -sup->alHorProfileThickness/2. - xhsiz;
143 zc = -(sup->HorClearance-sup->alVerProfileThickness)/2. + zhsiz;
144 ssup = & ( ssup->subtract ( (*cutsmall) << HepTranslate3D( -xc, yc, -zc) ) );
145 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
146
147 xc = -xc;
148 zc = -zc;
149 ssup = & ( ssup->subtract ( (*cutsmall) << HepTranslate3D( -xc, yc, -zc) ) );
150 std::cout<<"SUP3:: with centre at "<<xc<<" "<<yc<<" "<<zc<<std::endl;
151 if (cutoutson && vcutouts.size()>0)
152 {
153 for (unsigned int i=0; i<vcutouts.size(); i++)
154 {
155 const GeoShape* sTemp = &(ssup->subtract(*vcutouts[i]));
156 ssup = sTemp;
157 }
158 }
159
160 GeoLogVol *lsup = new GeoLogVol("Sup", ssup, msup);
161 psup = new GeoPhysVol(lsup);
162 }
163 else
164 {
165 std::cout<<" recognised as type 1 or 2"<<std::endl;
166 totzgm = sup->alHorFlangeLength+sup->alVerProfileThickness;
167 GeoTrd *suptrd = new GeoTrd(totxgm/2, totxgm/2, totygm/2,
168 totygm/2, totzgm/2);
169 std::cout<<"SUP12::z0 "<<z0<<std::endl;
170 std::cout<<"SUP12::tot_x_y_z_gm, "<<totxgm<<" "<<totygm<<" "<<totzgm<<std::endl;
171 std::cout<<" big box done"<<std::endl;
172 const GeoTrd* emptybox = new GeoTrd(totxgm/2.-sup->alFlangeThickness,
173 totxgm/2.-sup->alFlangeThickness,
174 totygm/2+eps, totygm/2+eps,
175 totzgm/2);
176 std::cout<<" empty box done"<<std::endl;
177 ssup=suptrd;
178 ssup = & ( ssup->subtract ( (*emptybox) << HepTranslate3D( 0., 0., sup->alVerProfileThickness) ) );
179 std::cout<<" empty subtracted from big box"<<std::endl;
180 if (cutoutson && vcutouts.size()>0)
181 {
182 for (unsigned int i=0; i<vcutouts.size(); i++)
183 {
184 const GeoShape* sTemp = &(ssup->subtract(*vcutouts[i]));
185 ssup = sTemp;
186 }
187 }
188
189 GeoLogVol *lsup = new GeoLogVol("SupModule", ssup, msup);
190 psup = new GeoPhysVol(lsup);
191 if(name.substr(3,2)=="2")
192 {
193 std::cout<<" recognised as type 2"<<std::endl;
194 ssup = & ((*ssup) << HepRotateY3D( 180.*deg ));
195 std::cout<<" in this case:: rotating around y by 180.deg"<<std::endl;
196 }
197 else std::cout<<" recognised as type 1"<<std::endl;
198 }
199 return psup;
200 }
201
202 void Sup::print()
203 {
204 std::cout<<"Sup "<<name<<" :"<<std::endl;
205 }
206 }
207
| 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.
|
|