+ TGeoShape* cylinderShape = new TGeoTubeSeg(framelr,framehr,framel/2,0,180);
+ TGeoVolume* cylinderVolume = new TGeoVolume(Form(fgkBackName, fmd2->GetId()),
+ cylinderShape, fC);
+ TGeoShape* coverShape = new TGeoTubeSeg(coverlr,framehr,backth/2,0,180);
+ TGeoVolume* coverVolume = new TGeoVolume(Form(fgkTopName, fmd2->GetId()),
+ coverShape, fC);
+ cylinderVolume->SetTransparency(63);
+ coverVolume->SetTransparency(63);
+
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd2TopVolume : fmd2BotVolume);
+
+ Double_t phi = 360. / 2 * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD2 support rot %d",i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD2 cyl trans %d", i),
+ 0, 0, framelz+framel/2, rot);
+ mother->AddNode(cylinderVolume, i, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 fcov trans %d", i),
+ 0, 0, framelz-backth/2, rot);
+ mother->AddNode(coverVolume, 2*i+0, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 bcov trans %d", i),
+ 0, 0, framelz+framel+backth/2,
+ rot);
+ mother->AddNode(coverVolume, 2*i+1, matrix);
+ }
+
+
+ Double_t f1l = 10;
+ Double_t f1w = 6;
+ Double_t f1d = 1.2;
+
+ TGeoBBox* flange1Shape = new TGeoBBox(f1l/2, f1w/2, f1d/2);
+ TGeoVolume* flange1Volume = new TGeoVolume(Form(fgkFlangeName, fmd2->GetId()),
+ flange1Shape, fAl);
+ TGeoBBox* flange2Shape = new TGeoBBox(f1w/2, f1d/2, (framel+backth)/2);
+ TGeoVolume* flange2Volume = new TGeoVolume(Form("F%dSG", fmd2->GetId()),
+ flange2Shape, fAl);
+ flange1Volume->SetTransparency(42);
+ for (Int_t i = 0; i < 4; i++) {
+ TGeoVolume* mother = (i < 2 ? fmd2TopVolume : fmd2BotVolume);
+
+ Double_t phi = 360. / 4 * i - 45;
+ Double_t rphi = TMath::Pi()*phi/180;
+ Double_t x = (framelr + f1l/2) * TMath::Sin(rphi);
+ Double_t y = (framelr + f1l/2) * TMath::Cos(rphi);
+ TGeoRotation* rot = new TGeoRotation(Form("FMD2 support rot %d",i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD2 flange 1 trans %d", i),
+ x,y, framelz-backth-f1d/2, rot);
+ mother->AddNode(flange1Volume, 2*i+0, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 2 trans %d", i),
+ x,y,framelz+framel+backth+f1d/2,
+ rot);
+ mother->AddNode(flange1Volume, 2*i+1, matrix);
+ Double_t x1 = x - (f1w-f1d) / 2 * TMath::Cos(rphi);
+ Double_t y1 = y + (f1w-f1d) / 2 * TMath::Sin(rphi);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 3 trans %d", i),
+ x1,y1,framelz+framel/2, rot);
+ mother->AddNode(flange2Volume, 2*i+0, matrix);
+ Double_t x2 = x + (f1w-f1d) / 2 * TMath::Cos(rphi);
+ Double_t y2 = y - (f1w-f1d) / 2 * TMath::Sin(rphi);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 4 trans %d", i),
+ x2,y2,framelz+framel/2, rot);
+ mother->AddNode(flange2Volume, 2*i+1, matrix);
+ }
+
+
+