+ //
+ // Define Barrel Mother
+ //
+ TGeoPgon* shBMother = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
+ shBMother->DefineSection(0, -kLBMother, kRBMotherInner, kRBMotherOuter);
+ shBMother->DefineSection(1, kLBMother, kRBMotherInner, kRBMotherOuter);
+ //
+ TGeoVolumeAssembly* voBMother = new TGeoVolumeAssembly("L3BM");
+ //
+ // Define Thermal Shield
+ //
+ // Only one layer
+ // This can be improved: replace by (protection - shield - insulation) !
+ //
+ TGeoPgon* shThermSh = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
+ shThermSh->DefineSection(0, -kLCoil, kRThermalShieldInner, kRThermalShieldOuter);
+ shThermSh->DefineSection(1, kLCoil, kRThermalShieldInner, kRThermalShieldOuter);
+ //
+ TGeoVolume* voThermSh = new TGeoVolume("L3TS", shThermSh, medAluI);
+ voBMother->AddNode(voThermSh, 1, new TGeoTranslation(0., 0., 0.));
+ //
+ // Define Coils and cooling circuits
+ //
+ TGeoPgon* shCoilMother = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
+ shCoilMother->DefineSection(0, -kLCoil, kRCoilInner - 2. * kRCoolingOuter, kRCoilOuter + 2. * kRCoolingOuter);
+ shCoilMother->DefineSection(1, kLCoil, kRCoilInner - 2. * kRCoolingOuter, kRCoilOuter + 2. * kRCoolingOuter);
+ //
+ // Coils
+ TGeoVolume* voCoilMother = new TGeoVolume("L3CM", shCoilMother, medAir);
+ voBMother->AddNode(voCoilMother, 1, new TGeoTranslation(0., 0., 0.));
+ // Devide into the 168 turns
+ TGeoVolume* voCoilTurn = voCoilMother->Divide("L3CD", 3, 168, 0., 0.);
+ TGeoPgon* shCoils = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
+ shCoils->DefineSection(0, -3., kRCoilInner, kRCoilOuter);
+ shCoils->DefineSection(1, 3., kRCoilInner, kRCoilOuter);
+ //
+ TGeoVolume* voCoils = new TGeoVolume("L3C0", shCoils, medAlu);
+ voCoilTurn->AddNode(voCoils, 1, new TGeoTranslation(0., 0., 0.));
+ //
+ // Hexagonal Cooling circuits
+ //
+ const Float_t kRCC = kRCoolingOuter;
+ const Float_t kRCW = kRCoolingInner;
+ const Float_t kRCL = kRCC * TMath::Tan(30. / 180. * TMath::Pi());
+ const Float_t kRWL = kRCW * TMath::Tan(30. / 180. * TMath::Pi());
+ // Outer Circuits
+ //
+ // Pipe
+ TGeoPgon* shCoolingPipeO = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
+ shCoolingPipeO->DefineSection(0, -kRCC, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
+ shCoolingPipeO->DefineSection(1, -kRCL, kRCoilOuter, kRCoilOuter + 2. * kRCC);
+ shCoolingPipeO->DefineSection(2, kRCL, kRCoilOuter, kRCoilOuter + 2. * kRCC);
+ shCoolingPipeO->DefineSection(3, kRCC, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
+ //
+ TGeoVolume* voCoolingPipeO = new TGeoVolume("L3CCO", shCoolingPipeO, medAlu);
+ voCoilTurn->AddNode(voCoolingPipeO, 1, new TGeoTranslation(0., 0., 0.));
+ //
+ TGeoPgon* shCoolingWaterO = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
+ shCoolingWaterO->DefineSection(0, -kRCW, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
+ shCoolingWaterO->DefineSection(1, -kRWL, kRCoilOuter + (kRCC - kRCW), kRCoilOuter + kRCC + kRCW);
+ shCoolingWaterO->DefineSection(2, kRWL, kRCoilOuter + (kRCC - kRCW), kRCoilOuter + kRCC + kRCW);
+ shCoolingWaterO->DefineSection(3, kRCW, kRCoilOuter + kRCC, kRCoilOuter + kRCC + 0.01);
+ //
+ TGeoVolume* voCoolingWaterO = new TGeoVolume("L3CWO", shCoolingWaterO, medWater);
+ voCoolingPipeO->AddNode(voCoolingWaterO, 1, new TGeoTranslation(0., 0., 0.));
+
+ // Inner Circuits
+ //
+ // Pipe
+ TGeoPgon* shCoolingPipeI = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
+ shCoolingPipeI->DefineSection(0, -kRCC, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
+ shCoolingPipeI->DefineSection(1, -kRCL, kRCoilInner - 2. * kRCC, kRCoilInner);
+ shCoolingPipeI->DefineSection(2, kRCL, kRCoilInner - 2. * kRCC, kRCoilInner);
+ shCoolingPipeI->DefineSection(3, kRCC, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
+ //
+ TGeoVolume* voCoolingPipeI = new TGeoVolume("L3CCI", shCoolingPipeI, medAlu);
+ voCoilTurn->AddNode(voCoolingPipeI, 1, new TGeoTranslation(0., 0., 0.));
+ //
+ TGeoPgon* shCoolingWaterI = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
+ shCoolingWaterI->DefineSection(0, -kRCW, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
+ shCoolingWaterI->DefineSection(1, -kRWL, kRCoilInner - kRCC - kRCW, kRCoilInner - (kRCC - kRCW));
+ shCoolingWaterI->DefineSection(2, kRWL, kRCoilInner - kRCC - kRCW, kRCoilInner - (kRCC - kRCW));
+ shCoolingWaterI->DefineSection(3, kRCW, kRCoilInner - kRCC, kRCoilInner - kRCC + 0.01);
+ //
+ TGeoVolume* voCoolingWaterI = new TGeoVolume("L3CWI", shCoolingWaterI, medWater);
+ voCoolingPipeI->AddNode(voCoolingWaterI, 1, new TGeoTranslation(0., 0., 0.));
+
+ //
+ // Define Yoke
+ //
+ TGeoPgon* shYoke = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
+ shYoke->DefineSection(0, -kLYoke, kRYokeInner, kRYokeOuter);
+ shYoke->DefineSection(1, +kLYoke, kRYokeInner, kRYokeOuter);
+ //
+ TGeoVolume* voYoke = new TGeoVolume("L3YO", shYoke, medSteel);
+ voBMother->AddNode(voYoke, 1, new TGeoTranslation(0., 0., 0.));
+
+ //
+ // Define Crown
+ //
+ TGeoPgon* shCrown = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
+ shCrown->DefineSection(0, kLCrown1, kRCrownInner, kRYokeInner);
+ shCrown->DefineSection(1, kLCrown2, kRCrownInner, kRYokeInner);
+ shCrown->DefineSection(2, kLCrown2, kRCrownInner, kRCrownOuter);
+ shCrown->DefineSection(3, kLCrown3, kRCrownInner, kRCrownOuter);
+ //
+ TGeoVolume* voCrown = new TGeoVolume("L3CR", shCrown, medSteel);
+
+ //
+ // Door including "Plug"
+ //
+ Float_t slo = 2. * kRDoorOuter * TMath::Tan(22.5 * kDegRad);
+ Float_t sli = 2. * kRPlugInner * TMath::Tan(22.5 * kDegRad);
+ Double_t xpol1[12], xpol2[12], ypol1[12], ypol2[12];
+
+ xpol1[ 0] = 2. ; ypol1[ 0] = kRDoorOuter;
+ xpol1[ 1] = slo/2. ; ypol1[ 1] = kRDoorOuter;
+ xpol1[ 2] = kRDoorOuter; ypol1[ 2] = slo/2.;
+ xpol1[ 3] = kRDoorOuter; ypol1[ 3] = -slo/2.;
+ xpol1[ 4] = slo/2. ; ypol1[ 4] = -kRDoorOuter;
+ xpol1[ 5] = 2. ; ypol1[ 5] = -kRDoorOuter;
+ xpol1[ 6] = 2. ; ypol1[ 6] = -kRPlugInner - os;
+ xpol1[ 7] = sli/2. ; ypol1[ 7] = -kRPlugInner - os;
+ xpol1[ 8] = kRPlugInner; ypol1[ 8] = -sli/2. - os;
+ xpol1[ 9] = kRPlugInner; ypol1[ 9] = sli/2. - os;
+ xpol1[10] = sli/2. ; ypol1[10] = kRPlugInner - os;
+ xpol1[11] = 2. ; ypol1[11] = kRPlugInner - os;