]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliDIPOv3.cxx
cosmetics
[u/mrichter/AliRoot.git] / STRUCT / AliDIPOv3.cxx
index f3a8b2c3988f2db79add9f82780f76fb69450ae1..40081f0bd1415c68f485b851e31676d011e6981e 100644 (file)
@@ -20,6 +20,7 @@
 #include <TGeoVolume.h>
 #include <TGeoMedium.h>
 #include <TGeoMatrix.h>
+#include <TGeoArb8.h>
 #include <TGeoBBox.h>
 #include <TGeoTube.h>
 #include <TGeoCone.h>
@@ -77,9 +78,9 @@ void AliDIPOv3::CreateSpectrometerDipole()
 // 
     Float_t alhc = 0.794;
     
-    TGeoRotation* rotxz      = new TGeoRotation("rotxz",     90.,   0., 90.,  90.,  180., 0.);
+    TGeoRotation* rotxz      = new TGeoRotation("rotxz",    270.,   0., 90.,  90.,  180., 0.);
+    TGeoRotation* rotiz      = new TGeoRotation("rotiz",     90.,   0., 90.,  90.,  180., 0.);
     TGeoRotation* rotxzlhc   = new TGeoRotation("rotxzlhc", 180.,  180. + alhc, 0.);
-    TGeoRotation* rotlhc     = new TGeoRotation("rotlhc",   0.,  alhc, 0.);
 
     TGeoRotation* rotxz108   = new TGeoRotation("rotxz108", 90., 108., 90., 198.,  180.,   0.);
     TGeoRotation* rotxz180   = new TGeoRotation("rotxz180", 90., 180., 90., 270.,  180.,   0.);
@@ -115,34 +116,61 @@ void AliDIPOv3::CreateSpectrometerDipole()
     
 
     //
-    // Mother volume
+    // Mother volume for muon spectrometer tracking station 3
+
+    Float_t z30 =  825.;
+    Float_t zst = 1052.;
+
+    Float_t rcD0 = (kZDipoleF - 5.)  * TMath::Tan(9. * kDegrad);
     Float_t rcD1 = kZDipole * TMath::Tan(9. * kDegrad);
-    TGeoPcon* shDDIP1 =  new TGeoPcon("shDDIP1", 0., 360., 4);
-    shDDIP1->DefineSection(0, -dipoleL/2. - 5., 0., (kZDipoleF -5.)  * TMath::Tan(9. * kDegrad));
-    shDDIP1->DefineSection(1,          0., 0., rcD1);
     Float_t rcD2 = rcD1 + dipoleL/2. * TMath::Tan(10.1 * kDegrad);
-    shDDIP1->DefineSection(2, +dipoleL/2.,      0., rcD2);
-    shDDIP1->DefineSection(3, +dipoleL/2. + 5., 0., rcD2);
-
-    TGeoCombiTrans* trDDIP = new TGeoCombiTrans("trDDIP", 0., dipoleL/2. * TMath::Tan(alhc * kDegrad), 0., rotlhc);
-    trDDIP->RegisterYourself();
-     
-    TGeoBBox* shDDIP2 =  new TGeoBBox(164., 182., 25.);
+    Float_t rc30 = z30 * TMath::Tan(9. * kDegrad);
+    Float_t rcst = rcD1  + (zst - kZDipole) * TMath::Tan(10.1 * kDegrad);
+    
+    Float_t riD0 = (kZDipoleF - 5.)  * TMath::Tan(2. * kDegrad) + 0.2;
+    Float_t riD1 = 28.9;
+    Float_t riD2 = 35.8;
+    Float_t riD3 = riD2 + (kZDipoleR - zst)      * TMath::Tan(2. * kDegrad);
+    Float_t riD4 = riD2 + (kZDipoleR - zst + 5.) * TMath::Tan(2. * kDegrad);
+    
+
+    TGeoPcon* shDDIP1 =  new TGeoPcon("shDDIP1", 0., 360., 7);
+
+    shDDIP1->DefineSection(0,  (kZDipoleF - 5.), riD0, rcD0);
+    shDDIP1->DefineSection(1,  z30            , riD1, rc30);
+    shDDIP1->DefineSection(2,  kZDipole       , riD1, rcD1);
+    shDDIP1->DefineSection(3,  zst            , riD1, rcst);
+    shDDIP1->DefineSection(4,  zst            , riD2, rcst);
+    shDDIP1->DefineSection(5,  kZDipoleR      , riD3, rcD2);
+    shDDIP1->DefineSection(6, (kZDipoleR + 5.), riD4, rcD2);
+
+         // JC Ch6 is 2x5cm longer than Ch5
+    //    TGeoBBox* shDDIP2 =  new TGeoBBox(164., 182., 36.);    
+         Double_t xD0 = 162.;
+         Double_t xD1 = 171.;
+         Double_t yD0 = 182.;
+         Double_t zD0 = 36.;
+       
+       Double_t xy[16] = {0};
+         xy[0]  = -xD0; xy[1]  = -yD0; 
+         xy[2]  = -xD0; xy[3]  =  yD0; 
+         xy[4]  =  xD0; xy[5]  =  yD0;
+         xy[6]  =  xD0; xy[7]  = -yD0;
+         xy[8]  = -xD1; xy[9]  = -yD0; 
+         xy[10] = -xD1; xy[11] =  yD0; 
+         xy[12] =  xD1; xy[13] =  yD0;
+         xy[14] =  xD1; xy[15] = -yD0; 
+         TGeoArb8* shDDIP2 =  new TGeoArb8(zD0, xy); 
     shDDIP2->SetName("shDDIP2");
-    TGeoPcon* shDDIP3 =  new TGeoPcon(  0., 360.,  5);
+    TGeoTranslation* trDDIP2 = new TGeoTranslation("trDDIP2", 0., 0., kZDipole - 12.);
+    trDDIP2->RegisterYourself();
+
+    TGeoTube* shDDIP3 =  new TGeoTube(0., 30., 40.);
     shDDIP3->SetName("shDDIP3");
-    Float_t z30 =  825. - kZDipole;
-    Float_t zst = 1052. - kZDipole;
-    
-    
-    shDDIP3->DefineSection(0, -dipoleL/2. - 10., 0., (kZDipoleF - 10.)  * TMath::Tan(2. * kDegrad) + 0.2);
-    shDDIP3->DefineSection(1,              z30, 0.,  28.8 + 0.2);
-    shDDIP3->DefineSection(2,              zst, 0.,  28.8 + 0.2);
-    shDDIP3->DefineSection(3,              zst, 0.,  35.8);
-    shDDIP3->DefineSection(4, +dipoleL/2. + 10., 0.,   35.8 + (dipoleL/2. + 10. - zst) * TMath::Tan(2. * kDegrad));
-    
-    TGeoCompositeShape*  shDDIP = new TGeoCompositeShape("shDDIP", "(shDDIP2 + shDDIP1:trDDIP) - shDDIP3:trDDIP");
 
+
+    TGeoCompositeShape*  shDDIP = new TGeoCompositeShape("shDDIP", "shDDIP1+(shDDIP2:trDDIP2-shDDIP3:trDDIP2)");
     TGeoVolume*  voDDIP = new TGeoVolume("DDIP", shDDIP, kMedAir);
 //
 // Yoke
@@ -150,14 +178,14 @@ void AliDIPOv3::CreateSpectrometerDipole()
 
     TGeoVolumeAssembly* asYoke = new TGeoVolumeAssembly("DYoke");      
 // Base
-    char name[32];
+    char name[16];
     Float_t lx0 = gapWidthFront + 2. * blockHeight;
     Float_t lx  = lx0;
     
     TGeoVolumeAssembly* asYokeBase = new TGeoVolumeAssembly("DYokeBase");      
     for (Int_t i = 0; i < 7; i++) {
-       sprintf(name, "DYokeBaseBlock%1d", i);
-       TGeoVolume*  voBaseBlock = new TGeoVolume(name,
+      snprintf(name, 16, "DYokeBaseBlock%1d", i);
+      TGeoVolume*  voBaseBlock = new TGeoVolume(name,
                                                  new TGeoBBox(lx/2., blockHeight/2., blockLength/2.),
                                                  kMedSteel);
        asYokeBase->AddNode(voBaseBlock, 1, new TGeoTranslation(0., 0., Float_t(i - 3) * blockLength));
@@ -180,7 +208,7 @@ void AliDIPOv3::CreateSpectrometerDipole()
 
 
     asYoke->AddNode(asYokeSide, 1, new TGeoTranslation(+lx0/2. + 3. * dGap - blockHeight/2., 0., 0.));
-    asYoke->AddNode(asYokeSide, 2, new TGeoCombiTrans( -lx0/2. - 3. * dGap + blockHeight/2., 0., 0., rotxz));
+    asYoke->AddNode(asYokeSide, 2, new TGeoCombiTrans( -lx0/2. - 3. * dGap + blockHeight/2., 0., 0., rotiz));
 
 //    
 // Coils
@@ -314,7 +342,7 @@ void AliDIPOv3::CreateSpectrometerDipole()
                                         new TGeoTubeSeg(coilRo, coilRo + 3.125, sW/2., 21., 51.),
                                         kMedAlu);
     TGeoVolume* voDCS021 = new TGeoVolume("DCS021", 
-                                        new TGeoConeSeg(sW/2., coilRo, 320., coilRo, coilRo + 2., 21., 21.4),
+                                        new TGeoConeSeg(sW/2., coilRo + 3.124, 320., coilRo + 3.125, coilRo + 5.125, 21., 21.4),
                                         kMedAlu);
     
 
@@ -336,11 +364,11 @@ void AliDIPOv3::CreateSpectrometerDipole()
     asDCoilSupport->AddNode(voDCS04, 1, gGeoIdentity);    
     for (Int_t i = 0; i < 9; i++) 
     {
-       char name[16];
-       sprintf(name, "rotdcs%1d", i);
+       char nameR[16];
+       snprintf(nameR, 16, "rotdcs%1d", i);
        Float_t phi = Float_t(i) * 3.75;
-       TGeoRotation* rot   = new TGeoRotation(name, 90., phi, 90., 90. + phi,    0.,   0.);    
-       asDCoilSupport->AddNode(voDCS021, i, new TGeoCombiTrans(0., 0., -(sW - coilH)/2., rot));    
+       TGeoRotation* rot   = new TGeoRotation(nameR, 90., phi, 90., 90. + phi,    0.,   0.);   
+       asDCoilSupport->AddNode(voDCS021, i, new TGeoCombiTrans(0., 0.004, -(sW - coilH)/2., rot));    
     }
     
 
@@ -364,6 +392,7 @@ void AliDIPOv3::CreateSpectrometerDipole()
     
     rmin1 = (zHanger1 - 13.) * TMath::Tan(2. * kDegrad);
     rmin2 = rmin1 + 26. * TMath::Tan( 2.0 * kDegrad);
+
     rmax1 = (zHanger1 - 13.) * TMath::Tan(9. * kDegrad);
     rmax2 = rmax1 + 26. * TMath::Tan(9. * kDegrad);
 
@@ -378,8 +407,9 @@ void AliDIPOv3::CreateSpectrometerDipole()
     TGeoBBox* shHanger21  = new TGeoBBox(3.5/2., 250., 25./2.);
     shHanger21->SetName("shHanger21");
 
-    rmin1 = 35.8 + (zHanger2 - 13. - zst - kZDipole) * TMath::Tan(2. * kDegrad);
+    rmin1 = 35.8 + (zHanger2 - 13. - zst) * TMath::Tan(2. * kDegrad);
     rmin2 = rmin1 + 26. * TMath::Tan( 2.0 * kDegrad);
+
     rmax1 = rcD1 + (zHanger2 - 13. - kZDipole) * TMath::Tan(10.1 * kDegrad);
     rmax2 = rmax1 + 26. * TMath::Tan(10.1 * kDegrad);
     TGeoCone* shHanger22  = new TGeoCone(13., rmin1, rmax1, rmin2, rmax2);
@@ -394,7 +424,7 @@ void AliDIPOv3::CreateSpectrometerDipole()
     
     TGeoVolume* voHS1 = new TGeoVolume("DHS1", new TGeoBBox( 1.5, 12.5, hsLength/2.), kMedSteel);
     TGeoVolume* voHS2 = new TGeoVolume("DHS2", new TGeoBBox(12.5,  1.5, hsLength/2.), kMedSteel);
-    Float_t hsH = gapHeight/2. + blockHeight - (rmax1+rmax2)/2.;
+    Float_t hsH = gapHeight/2. + blockHeight - (rmax1+rmax2)/2. - 2.;
     
     TGeoVolume* voHS3 = new TGeoVolume("DHS3", new TGeoBBox(3.5/2., hsH/2., 25./2.),    kMedSteel);
 
@@ -402,17 +432,15 @@ void AliDIPOv3::CreateSpectrometerDipole()
     asHS->AddNode(voHS1, 1, gGeoIdentity);
     asHS->AddNode(voHS2, 1, new TGeoTranslation(0., +14., 0.));
     asHS->AddNode(voHS2, 2, new TGeoTranslation(0., -14., 0.));
-    asHS->AddNode(voHS3, 1, new TGeoTranslation(0., -hsH/2. - 14., hsLength/2. - 25./2.));
+    asHS->AddNode(voHS3, 1, new TGeoTranslation(0., -hsH/2. - 14. -1.5, hsLength/2. - 25./2.));
     
     
 
-    dz = zHanger1 - kZDipole;
-    dy = -(kZDipoleR - zHanger1) * TMath::Tan(alhc * kDegrad);
-    voDDIP->AddNode(voHanger1, 1, new TGeoCombiTrans(0., dy, dz, rotlhc));
+    dz = zHanger1;
+    voDDIP->AddNode(voHanger1, 1, new TGeoTranslation(0., 0., dz));
 
-    dz = zHanger2 - kZDipole;
-    dy = -(kZDipoleR - zHanger2) * TMath::Tan(alhc * kDegrad);
-    voDDIP->AddNode(voHanger2, 1, new TGeoCombiTrans(0., dy, dz, rotlhc));
+    dz = zHanger2;
+    voDDIP->AddNode(voHanger2, 1, new TGeoTranslation(0., 0., dz));
     
     
     
@@ -433,7 +461,7 @@ void AliDIPOv3::CreateSpectrometerDipole()
     asDipole->AddNode(asDCoilSupport, 3, new TGeoCombiTrans( 0., 0., dz, rotxy108));
     asDipole->AddNode(asDCoilSupport, 4, new TGeoCombiTrans( 0., 0., dz, rotxy288));
     
-    asDipole->AddNode(asDCoilSupport, 5, new TGeoCombiTrans( 0., 0., -dz, rotxz));
+    asDipole->AddNode(asDCoilSupport, 5, new TGeoCombiTrans( 0., 0., -dz, rotiz));
     asDipole->AddNode(asDCoilSupport, 6, new TGeoCombiTrans( 0., 0., -dz, rotxz108));
     asDipole->AddNode(asDCoilSupport, 7, new TGeoCombiTrans( 0., 0., -dz, rotxz180));
     asDipole->AddNode(asDCoilSupport, 8, new TGeoCombiTrans( 0., 0., -dz, rotxz288));
@@ -441,14 +469,14 @@ void AliDIPOv3::CreateSpectrometerDipole()
     // Hanger (Support)
     dy = gapHeight/2. + blockHeight + 14.;
     
-    asDipole->AddNode(asHS, 1, new TGeoTranslation(0., dy, ((zHanger2 - kZDipole - yokeLength/2.) + 25./2.)/2.));
+    asDipole->AddNode(asHS, 1, new TGeoTranslation(0., dy + 1.5, ((zHanger2 - kZDipole - yokeLength/2.) + 25./2.)/2.));
     
     
     asDipole->SetVisContainers(1);
     voDDIP->SetVisibility(0);
 
-    top->AddNode(asDipole, 1, new TGeoCombiTrans(0., dipoleL / 2. * TMath::Tan(alhc * kDegrad), -kZDipole, rotxzlhc));
-    top->AddNode(voDDIP,   1, new TGeoCombiTrans(0., dipoleL / 2. * TMath::Tan(alhc * kDegrad), -kZDipole, rotxzlhc));
+    top->AddNode(asDipole, 1, new TGeoCombiTrans(0.,  dipoleL / 2. * TMath::Tan(alhc * kDegrad), -kZDipole, rotxzlhc));
+    top->AddNode(voDDIP,   1, new TGeoCombiTrans(0., 0., 0., rotxz));
 }