001
002 #include "GeoModelKernel/GeoTrd.h"
003 #include "GeoModelKernel/GeoShapeShift.h"
004 #include "GeoModelKernel/GeoShapeUnion.h"
005 #include "GeoModelKernel/GeoPhysVol.h"
006 #include "GeoModelKernel/GeoMaterial.h"
007 #include "GeoModelKernel/GeoNameTag.h"
008 #include "GeoModelKernel/GeoTransform.h"
009 #include "GeoModelKernel/GeoIdentifierTag.h"
010 #include "MuonGeoModel/MYSQL.h"
011 #include "MuonGeoModel/Csc.h"
012 #include "MuonGeoModel/CSC_Technology.h"
013 #include "MuonGeoModel/CscMultiLayer.h"
014 #include "MuonGeoModel/Cutout.h"
015
016 #include <vector>
017
018 #include "GeoModelKernel/GeoShapeSubtraction.h"
019
020 namespace MuonGM {
021
022 CscMultiLayer::CscMultiLayer(std::string n): DetectorElement(n)
023 {
024 MYSQL* amdb = MYSQL::GetPointer();
025 CSC* md =(CSC*)amdb->GetTechnology(name);
026 nrOfLayers = md->numOfLayers;
027 cscthickness = md->totalThickness;
028 thickness = cscthickness;
029 }
030
031 GeoVPhysVol* CscMultiLayer::build()
032 {
033 std::vector<Cutout*> vcutdef;
034 int cutoutson = 0;
035 return build(cutoutson, vcutdef);
036 }
037
038 GeoVPhysVol*
039 CscMultiLayer::build(int , std::vector<Cutout*> )
040 {
041 MYSQL* amdb = MYSQL::GetPointer();
042 CSC* md = (CSC*)amdb->GetTechnology(name);
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057 double hon_thick=md->honeycombthick;
058 double gasThickness=2.0*md->anocathodist;
059 double newpos=cscthickness/2.;
060 double g10thi = (2.*md->g10thick+md->honeycombthick);
061
062
063
064
065
066
067
068
069
070
071 const GeoShape* sml = new GeoTrd(thickness/2., thickness/2., width/2.,
072 longWidth/2., maxwLength/2.);
073 if (excent != length) {
074 const GeoShape* smlt = new GeoTrd(thickness/2., thickness/2., longWidth/2.,
075 upWidth/2., (physicalLength-maxwLength)/2.);
076 sml = & ( (sml->add( (*smlt) << HepTranslateZ3D(physicalLength/2.) ) )
077 << HepTranslateZ3D((maxwLength - physicalLength)/2.) );
078 }
079
080 const GeoMaterial* mhon = matManager->getMaterial("muo::Honeycomb");
081 const GeoLogVol* lml = new GeoLogVol("CscMultilayer",sml,mhon);
082 GeoPhysVol* pml = new GeoPhysVol(lml);
083
084
085 const GeoShape* shon = new GeoTrd(hon_thick/2., hon_thick/2., width/2.,
086 longWidth/2., maxwLength/2.);
087 const GeoShape* sg10hon = new GeoTrd(g10thi/2., g10thi/2., width/2.,
088 longWidth/2., maxwLength/2.);
089 if (excent != length) {
090 const GeoShape* shont = new GeoTrd(hon_thick/2., hon_thick/2., longWidth/2.,
091 upWidth/2., (physicalLength-maxwLength)/2.);
092 shon = &( (shon->add( (*shont) << HepTranslateZ3D(physicalLength/2.) ) )
093 << HepTranslateZ3D((maxwLength - physicalLength)/2.) );
094 const GeoShape* sg10hont = new GeoTrd(g10thi/2., g10thi/2., longWidth/2.,
095 upWidth/2., (physicalLength-maxwLength)/2.);
096 sg10hon = &( (sg10hon->add( (*sg10hont) << HepTranslateZ3D(physicalLength/2.) ) )
097 << HepTranslateZ3D((maxwLength - physicalLength)/2.) );
098 }
099
100 const GeoLogVol* lhon = new GeoLogVol("Honeycomb",shon,mhon);
101 GeoPhysVol* phon = new GeoPhysVol(lhon);
102
103 const GeoMaterial* mg10 = matManager->getMaterial("std::G10");
104 const GeoLogVol* lg10hon = new GeoLogVol("G10",sg10hon,mg10);
105 GeoPhysVol* pg10hon = new GeoPhysVol(lg10hon);
106
107 pg10hon->add(phon);
108
109
110 const GeoShape* sgas = NULL;
111 double beta = atan((longWidth-width)/(2.*maxwLength) );
112 double gShortWidth = width - 2*md->fullwirefixbarwidth*
113 (1-sin(beta))/cos(beta);
114 double gLongWidth = longWidth - 2*md->fullwirefixbarwidth*
115 (1+sin(beta))/cos(beta);
116 if (excent == length) {
117 double gLength = maxwLength - 2*md->fullwirefixbarwidth;
118 sgas = new GeoTrd(gasThickness/2.,gasThickness/2.,
119 gShortWidth/2.,gLongWidth/2.,gLength/2.);
120 } else {
121 double alpha = atan((excent-maxwLength)/(longWidth/2.) );
122 double gmaxwLength = maxwLength - md->fullwirefixbarwidth;
123 double gLength = length - 2.*md->fullwirefixbarwidth;
124 double gupWidth = upWidth - 2*md->fullwirefixbarwidth*
125 (1-cos(alpha))/sin(alpha);
126
127 sgas = new GeoTrd(gasThickness/2., gasThickness/2.,
128 gShortWidth/2., gLongWidth/2., gmaxwLength/2.);
129 const GeoShape* sgast = new GeoTrd(gasThickness/2.,gasThickness/2., gLongWidth/2.,
130 gupWidth/2., (gLength-gmaxwLength)/2.);
131 sgas = &( (sgas->add( (*sgast) << HepTranslateZ3D(gLength/2.) ) )
132 << HepTranslateZ3D((gmaxwLength - gLength)/2.) );
133 }
134 const GeoMaterial* mgas = matManager->getMaterial("muo::CscArCO2");
135 const GeoLogVol* lgas = NULL;
136
137
138
139 for (int i = 0; i < nrOfLayers+1; i++) {
140
141 GeoNameTag* np = new GeoNameTag("panel");
142 GeoTransform* xp = new GeoTransform(HepTranslateX3D(newpos-g10thi/2.));
143 pml->add(new GeoIdentifierTag(i));
144 pml->add(np);
145 pml->add(xp);
146 pml->add(pg10hon);
147 newpos -= g10thi;
148
149 if (i < nrOfLayers) {
150 lgas = new GeoLogVol("CscArCO2", sgas, mgas);
151 GeoPhysVol* pgas = new GeoPhysVol(lgas);
152
153
154 GeoNameTag* ng = new GeoNameTag("CscArCO2");
155 GeoTransform* xg = new GeoTransform(HepTranslateX3D(newpos-gasThickness/2.));
156 pml->add(new GeoIdentifierTag(i));
157 pml->add(ng);
158 pml->add(xg);
159 pml->add(pgas);
160 newpos -= gasThickness;
161 }
162 }
163
164 return pml;
165 }
166
167 void CscMultiLayer::print()
168 {
169 std::cout << "CscMulti Layer:: CscMulti Layer " << name << " :" << std::endl;
170 }
171
172 }
173
| 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.
|
|