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/Spacer.h"
002 #include "MuonGeoModel/Station.h"
003 #include "MuonGeoModel/MYSQL.h"
004 #include "MuonGeoModel/Technology.h"
005 #include "MuonGeoModel/SpacerComponent.h"
006 #include "GeoModelKernel/GeoTrd.h"
007 #include "GeoModelKernel/GeoTube.h"
008 #include "GeoModelKernel/GeoVPhysVol.h"
009 #include "GeoModelKernel/GeoPhysVol.h"
010 #include "GeoModelKernel/GeoLogVol.h"
011 #include "GeoModelKernel/GeoMaterial.h"
012 #include "GeoModelKernel/GeoNameTag.h"
013 #include "GeoModelKernel/GeoSerialDenominator.h"
014 #include "GeoModelKernel/GeoTransform.h"
015 #include "GeoModelKernel/GeoShapeUnion.h"
016 #include "GeoModelKernel/GeoShapeShift.h"
017 #include "GeoModelKernel/GeoSerialIdentifier.h"
018 #include "CLHEP/Geometry/Transform3D.h"
019 // for cutouts:
020 #include "GeoModelKernel/GeoShapeSubtraction.h"
021 
022 #define skip_spacer false
023 
024 namespace MuonGM {
025 
026 Spacer::Spacer(Component *ss): DetectorElement(ss->name)
027 {
028   SpacerComponent* s = (SpacerComponent*)ss;
029   width = s->dx1;
030   longWidth = s->dx2;
031   MYSQL* mysql = MYSQL::GetPointer();
032   thickness = mysql->GetTechnology(s->name)->thickness;
033   length = s->dy;
034   component = *s;       
035 }
036 
037 
038 GeoVPhysVol* Spacer::build()
039 {
040   int cutoutson = 0;
041   return build(cutoutson);
042 }
043 
044 GeoVPhysVol * Spacer::build(int /*cutoutson*/)
045 {
046   if (name == "SPA06" || name == "SPA01") {
047     double excent = component.excent;
048     double maxwLength = component.maxwdy;
049          
050     const GeoShape* strd = new GeoTrd(thickness/2.,thickness/2.,
051                                       width/2., longWidth/2., maxwLength/2.);
052     // std::cout<< "build SPA06 or SPA01: trapezoid "<<thickness<<" "<<thickness<<" "
053     //          << width << " " << longWidth << " " << maxwLength << std::endl;
054     double upWidth = 0.;
055     if ( excent > length ) upWidth = longWidth*(excent-length)/(excent-maxwLength);
056 //          std::cout<<" SPA6: width, lwidth, length, excent, maxwlength, upWidth "
057 //                   <<width<<" "<<longWidth<<" "<<length<<" "
058 //                   <<excent<<" "<<maxwLength<<" "<<upWidth<<std::endl;
059     if (excent > length){
060              //std::cout<<" Here is an exagonal SPA ***** named "<<name<<" excent = "
061              //         <<excent<<" length = "<<length<<std::endl;
062       GeoTrd* upTrd   = new GeoTrd(thickness/2.,thickness/2., longWidth/2., upWidth/2.,
063                                    (length-maxwLength)/2.);             
064       strd = & ( (strd->add(  (*upTrd) << HepTranslateZ3D( length/2. )) )
065                  << HepTranslateZ3D( (maxwLength - length)/2.) );
066     }
067 
068     const GeoMaterial* mtrd = matManager->getMaterial("std::Aluminium");
069     const GeoLogVol* lspa = new GeoLogVol("CSCspacer", strd, mtrd);
070     GeoPhysVol* pspa = new GeoPhysVol(lspa);
071     return pspa;
072 
073   } else {
074     const GeoShape* strd = new GeoTrd(thickness/2, thickness/2,
075                                       width/2, longWidth/2, length/2);
076     const GeoMaterial* mtrd = matManager->getMaterial("std::Air");
077     GeoLogVol* ltrd = new GeoLogVol("Spacer", strd, mtrd);
078     GeoPhysVol* ptrd = new GeoPhysVol(ltrd);
079         
080     double tckibeam = thickness/5.;
081     double dx = tckibeam;
082     double dy = 3.*tckibeam;
083           
084     GeoVPhysVol *ptrdtemp=NULL;
085 
086     GeoTrd* strd1 = new GeoTrd(dx/2, dx/2, dy/2, dy/2, length/2);
087     const GeoMaterial* mtrd1 = matManager->getMaterial("std::Aluminium");
088     GeoLogVol* ltrd1 = new GeoLogVol("ibeam1", strd1, mtrd1);
089     GeoPhysVol* ptrd1 = new GeoPhysVol(ltrd1);
090   
091     GeoTrd* strd2 = new GeoTrd(dy/2, dy/2, dx/2, dx/2, length/2);
092     const GeoMaterial* mtrd2 = matManager->getMaterial("std::Aluminium");
093     GeoLogVol* ltrd2 = new GeoLogVol("ibeam2", strd2, mtrd2);
094     GeoPhysVol* ptrd2 = new GeoPhysVol(ltrd2);
095 
096     GeoSerialDenominator* sd = new GeoSerialDenominator(name + " ibeam");
097     if (!skip_spacer) {
098       ptrd->add(sd);
099       ptrd->add(new GeoSerialIdentifier(0));
100     }
101     double newpos=-thickness/2.;
102     double wherepos=newpos;
103     double wherewidth=-width/2.;
104     for (int j = 0; j < 3; j++) {
105       for (int i = 0; i < 3; i++) {
106         ptrdtemp = ptrd1;
107         if (i == 1){
108           ptrdtemp = ptrd2;
109           tckibeam = dy;
110         }
111         GeoTransform* xf = new GeoTransform(HepTranslate3D(wherepos + tckibeam/2, wherewidth+dy/2, 0));
112         if (!skip_spacer) {
113           ptrd->add(xf);
114           ptrd->add(ptrdtemp);
115         }
116         wherepos += tckibeam;
117         tckibeam = dx;
118       }
119       wherepos -= thickness;
120       wherewidth += (width/2.-dy/2.);
121     }
122         
123     double vtubl=(width-5*tckibeam)/2.;
124 
125     GeoSerialDenominator* ntube = new GeoSerialDenominator(name + " vbeam");
126     if (!skip_spacer){
127       ptrd->add(ntube);
128       ptrd->add(new GeoSerialIdentifier(0));
129     }
130 
131     for (int k1 = 0; k1 < 2; k1++){
132       for (int k = 0; k < 2; k++){
133         GeoTransform* ttube = new GeoTransform(HepRotateX3D(-90*deg)* HepTranslate3D(
134                                                0.,
135                                                -(vtubl+tckibeam)/2.-(k-1)*(vtubl+tckibeam),
136                                                -length/4.-(k1-1)*length/2));
137         if (!skip_spacer) ptrd->add(ttube);
138       }
139     }
140         
141     return ptrd;        
142   }
143     
144 }
145 
146 void Spacer::print()
147 {
148         std::cout<<"Spacer "<<name<<" :"<<std::endl;
149 }
150                                                                                 
151 } // namespace MuonGM
152 

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!