18 #include "TGeoManager.h"
19 #include "TGeoMatrix.h"
21 #include "gearxml/GearXML.h"
22 #include "gearimpl/GearMgrImpl.h"
23 #include "gearimpl/FTDParametersImpl.h"
30 int main(
int argc,
char *argv[])
34 std::cout <<
"usage: " << argv[0] <<
" gearfile.xml" << std::endl;
47 TGeoManager * ftdgeom =
new TGeoManager(
"FTD",
"The FTD sub-detector geometry from GEAR");
51 TGeoMaterial * vacuum =
new TGeoMaterial(
"vacuum",0.0,0.0,0.0);
52 TGeoMaterial * vacuumTrans =
new TGeoMaterial(
"vacuum_trans",0.0,0.0,0.0);
53 vacuumTrans->SetTransparency(50);
56 TGeoMedium * Air =
new TGeoMedium(
"Vacuum",0,vacuum);
57 TGeoMedium * AirTrans =
new TGeoMedium(
"Vacuum_Trans",0,vacuumTrans);
61 TGeoVolume *top = ftdgeom->MakeBox(
"top",Air,12000,12000,12000);
62 ftdgeom->SetTopVolume(top);
63 ftdgeom->SetTopVisible(0);
67 speRot.SetAngles(90,180,0);
75 double ZstartOuterShell = -1;
76 double ZendOuterShell = -1;
77 TGeoRotation petalRot;
85 TGeoVolume * disk = ftdgeom->MakeTube(
"Air disk",AirTrans,
89 disk->SetLineColor(kBlue-5);
90 disk->SetFillColor(kBlue-5);
91 disk->SetAttVisibility(0);
93 top->AddNode(disk,i+1,
new TGeoTranslation(0,0,zposition-halfthickness) );
94 TGeoHMatrix hm = speRot*TGeoTranslation(0,0,zposition-halfthickness);
95 top->AddNode(disk,-(i+1),
new TGeoHMatrix(hm) );
98 ZstartOuterShell = zposition-halfthickness;
102 ZendOuterShell = zposition+halfthickness;
110 TGeoVolume * petal = ftdgeom->MakeTrap(
"Petal Support",AirTrans,
122 petal->SetLineColor(kGray-3);
123 petal->SetFillColor(kGray-3);
124 petal->SetVisibility(0);
130 TGeoVolume * sensor = ftdgeom->MakeTrap(
"Petal Support",AirTrans,
142 sensor->SetLineColor(kOrange-5);
143 sensor->SetFillColor(kOrange-5);
158 int zsign = pow(-1,j);
159 petalRot.SetAngles(2.0*phi*j,0.0,0.0);
161 TGeoHMatrix hmpetal = petalRot*TGeoTranslation(0.0,diskRinn+dy_half,
163 disk->AddNode(petal,j+1,
new TGeoHMatrix(hmpetal));
173 const double half_z= (ZendOuterShell-ZstartOuterShell)/2.0;
175 TGeoVolume *outerShield = ftdgeom->MakeTube(
"outer_shell",AirTrans,
180 outerShield->SetLineColor(kBlue-3);
181 outerShield->SetFillColor(kBlue-3);
182 outerShield->SetAttVisibility(0);
184 top->AddNodeOverlap(outerShield,1,
new TGeoTranslation(0,0,ZstartOuterShell+half_z) );
185 TGeoHMatrix hmO = speRot*TGeoTranslation(0,0,ZstartOuterShell+half_z);
186 top->AddNodeOverlap(outerShield,2,
new TGeoHMatrix(hmO) );
193 const double half_zInner= (ZendOuterShell-ZstartInnerShell)/2.0;
195 TGeoVolume *innerShield = ftdgeom->MakeCone(
"inner_shell",AirTrans,
202 innerShield->SetLineColor(kBlue-3);
203 innerShield->SetFillColor(kBlue-3);
204 innerShield->SetAttVisibility(0);
206 top->AddNodeOverlap(innerShield,1,
new TGeoTranslation(0,0,ZstartInnerShell+half_zInner) );
207 TGeoHMatrix hmI = speRot*TGeoTranslation(0,0,ZstartInnerShell+half_zInner);
208 top->AddNodeOverlap(innerShield,2,
new TGeoHMatrix(hmI) );
211 ftdgeom->CloseGeometry();
212 ftdgeom->Export(
"testFTD.root");
virtual double getSupportLengthMax(int layerIndex) const =0
The length (x-direction) of the largest edge of the trapezoid support in layer layerIndex - layer ind...
virtual const FTDParameters & getFTDParameters() const =0
Get the FTD parameters.
virtual double getSensitiveThickness(int layerIndex) const =0
The thickness in mm of the sensitive area in petals in layer layerIndex.
GearMgr * createGearMgr()
Creates an instance of GearMgr from the data given in the XML file.
virtual double getSupportRinner(int layerIndex) const =0
The R-min of the support petals in the XY-plane in mm, for the layer layerIndex - layer indexing star...
virtual double getSupportLengthMin(int layerIndex) const =0
The length (x-direction) of the smallest edge of the trapezoid support in layer layerIndex - layer in...
Implementation of GEAR using XML.
virtual double getZposition(const int &layerIndex) const =0
The z-position of the centroid of the disk structure.
virtual double getSupportThickness(int layerIndex) const =0
The thickness in mm of the supports in layerIndex - layer indexing starting at 0 for the layer closes...
virtual double getPhiHalfDistance(int layerIndex) const =0
Angular half-width of the petals of a layer - half of the opening angle of the trapezoid.
virtual int getNPetals(int layerIndex) const =0
The number of petals in the layer layerIndex - layer indexing starts at 0 for the layer closest to IP...
Abstract description of layers in a FTD detector.
virtual double getZoffset(const int &layerIndex) const =0
Z-offset of the petals in a staggered setup - the z position of the even numbered petals is getZposit...
virtual const FTDLayerLayout & getFTDLayerLayout() const =0
The layer layout in the Vertex.
virtual double getSensitiveLengthMax(int layerIndex) const =0
Same as getPetalLengthMax() except for the sensitive part of the petal.
virtual double getSensitiveLengthMin(int layerIndex) const =0
Same as getPetalLengthMin() except for the sensitive part of the petal.
Geometry properties of a FTD detector needed for reconstruction code.
virtual double getSupportWidth(int layerIndex) const =0
The width of the support in layer in mm for petals in layer layerIndex - layer indexing starting at 0...
virtual int getNLayers() const =0
The total number of layers.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
virtual double getSensitiveWidth(int layerIndex) const =0
The width of the sensitive area in petals in layer layerIndex in mm.