- gMC->Gspos("L3DO", 1, "ALIC", 0., -30., 0., 0, "MANY");
- gMC->Gspos("L3FR", 1, "L3DO", 0., 0., 0., 0, "MANY");
- gMC->Gspos("L3IR", 1, "L3DO", 0., 0., 0., 0, "MANY");
-
- gMC->Gspos("L3DX", 1, "ALIC", 0., -30., 0., idrotm[300], "MANY");
- gMC->Gspos("L3FX", 1, "L3DX", 0., 0., 0., 0, "MANY");
- gMC->Gspos("L3IX", 1, "L3DX", 0., 0., 0., 0, "MANY");
+ //
+ // 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.));