13 TGeoManager *geom =
new TGeoManager(
"Assemblies",
14 "Geometry using assemblies");
17 TGeoMaterial *matVacuum =
new TGeoMaterial(
"Vacuum", 0,0,0);
18 TGeoMaterial *matAl =
new TGeoMaterial(
"Al", 26.98,13,2.7);
20 TGeoMedium *Vacuum =
new TGeoMedium(
"Vacuum",1, matVacuum);
21 TGeoMedium *Al =
new TGeoMedium(
"Aluminium",2, matAl);
24 TGeoVolume *top = geom->MakeBox(
"TOP", Vacuum, 1000., 1000., 100.);
25 geom->SetTopVolume(top);
28 TGeoVolume *tplate =
new TGeoVolumeAssembly(
"TOOTHPLATE");
34 Double_t ytooth = 0.5*yplate/ntooth;
35 Double_t dshift = 2.*xplate + xtooth;
38 TGeoVolume *plate = geom->MakeBox(
"PLATE", Al, xplate,yplate,1);
39 plate->SetLineColor(kBlue);
40 TGeoVolume *tooth = geom->MakeBox(
"TOOTH", Al, xtooth,ytooth,1);
41 tooth->SetLineColor(kBlue);
42 tplate->AddNode(plate,1);
43 for (i=0; i<ntooth; i++) {
45 yt = -yplate + (4*i+1)*ytooth;
46 tplate->AddNode(tooth, i+1,
new TGeoTranslation(xt,yt,0));
48 yt = -yplate + (4*i+3)*ytooth;
49 tplate->AddNode(tooth, ntooth+i+1,
new TGeoTranslation(xt,yt,0));
52 TGeoRotation *rot1 =
new TGeoRotation();
57 TGeoVolume *cell =
new TGeoVolumeAssembly(
"CELL");
60 Double_t phirad = phi*TMath::DegToRad();
61 Double_t xp = dshift*TMath::Sin(phirad);
62 Double_t yp = -dshift*TMath::Cos(phirad);
63 rot =
new TGeoRotation(*rot1);
65 cell->AddNode(tplate,i+1,
new TGeoCombiTrans(xp,yp,0,rot));
71 TGeoVolume *row =
new TGeoVolumeAssembly(
"ROW");
73 for (i=0; i<ncells; i++) {
74 Double_t ycell = (2*i+1)*(dshift+10);
75 row->AddNode(cell, ncells+i+1,
new TGeoTranslation(0,ycell,0));
76 row->AddNode(cell,ncells-i,
new TGeoTranslation(0,-ycell,0));
79 Double_t dxrow = 3.*(dshift+10.)*TMath::Tan(30.*TMath::DegToRad());
80 Double_t dyrow = dshift+10.;
82 for (i=0; i<nrows; i++) {
83 Double_t xrow = 0.5*(2*i+1)*dxrow;
84 Double_t yrow = 0.5*dyrow;
85 if ((i%2)==0) yrow = -yrow;
86 top->AddNode(row, nrows+i+1,
new TGeoTranslation(xrow,yrow,0));
87 top->AddNode(row, nrows-i,
new TGeoTranslation(-xrow,-yrow,0));
91 geom->CloseGeometry();
94 geom->SetVisOption(0);