X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONSt1GeometryBuilderV2.cxx;h=a6fb1e64ae8cf8369825d629d67033c6840b88fe;hb=dfbacac8a06b1c2f1aa95db0aa29615065ede580;hp=d1fc74b24f0be9fffcb3fb93c0eff0b01491b5e8;hpb=fdbaed6e2d98ba00ef217812bea10892fe1344e5;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONSt1GeometryBuilderV2.cxx b/MUON/AliMUONSt1GeometryBuilderV2.cxx index d1fc74b24f0..a6fb1e64ae8 100644 --- a/MUON/AliMUONSt1GeometryBuilderV2.cxx +++ b/MUON/AliMUONSt1GeometryBuilderV2.cxx @@ -33,10 +33,8 @@ #include "AliMpSegmentation.h" #include "AliMpDEManager.h" -#include "AliMpContainers.h" #include "AliMpConstants.h" #include "AliMpCDB.h" -#include "AliMpSectorSegmentation.h" #include "AliMpSector.h" #include "AliMpRow.h" #include "AliMpVRowSegment.h" @@ -48,25 +46,20 @@ #include "AliMagF.h" #include "AliLog.h" -#include -#include -#include -#include #include -#include -#include +#include +#include +#include #include -#include +#include #include -#include - -#ifdef WITH_STL - #include -#endif - -#ifdef WITH_ROOT - #include "TArrayI.h" -#endif +#include +#include +#include +#include +#include +#include +#include /// \cond CLASSIMP ClassImp(AliMUONSt1GeometryBuilderV2) @@ -110,7 +103,7 @@ const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxDaughter=2.3/2.; const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyDaughter=6.3/2.; const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetX=1.46; const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetY=0.71; -const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamX=1.46; +const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamX=1.00; const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamY=0.051; const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaQuadLHC=2.6; // LHC Origin wrt Quadrant Origin @@ -127,6 +120,7 @@ const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantEnvelopeName="SE"; const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM"; const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN"; const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF"; +const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMFLayerName="SQMF"; const Int_t AliMUONSt1GeometryBuilderV2::fgkFoamBoxNameOffset=200; const Int_t AliMUONSt1GeometryBuilderV2::fgkFR4BoxNameOffset=400; const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000; @@ -257,217 +251,52 @@ void AliMUONSt1GeometryBuilderV2::CreateInnerLayers() { /// Create the layer of sensitive volumes with gas /// and the copper layer. +/// The shape of the sensitive area is defined as an extruded +/// solid substracted with tube (to get inner circular shape). -// Gas Medium - Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099; - Int_t idArCO2 = idtmed[1108]; // medium 9 (ArCO2 80%) - //Int_t idCopper = idtmed[1109]; // medium 10 = copper - //Int_t idArCO2 = idtmed[1124]; // medium 25 (ArCO2 80%) - Int_t idCopper = idtmed[1121]; // medium 22 = copper + TGeoMedium* kMedArCO2 = gGeoManager->GetMedium("MUON_ARG_CO2"); + TGeoMedium* kMedCopper = gGeoManager->GetMedium("MUON_COPPER_II"); - Float_t par[11]; + Double_t rmin = 0.0; + Double_t rmax = fgkMotherIR1; + Double_t hz = fgkHzPadPlane + fgkHzGas; + new TGeoTube("cutTube",rmin, rmax, hz); -//Make gas volume - composed of 11 trapezoids -// section 1 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 71.33/2.; - par[4] = 9.76/2.; - par[5] = 48.77/2.; - par[6] = 15.3; - par[7] = 71.33/2.; - par[8] = 9.76/2.; - par[9] = 48.77/2.; - par[10] = 15.3; - - gMC->Gsvolu("SA1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SA2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SA1C", "TRAP", idCopper,par, 11); - -// section 2 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 79.68/2.; - par[4] = 10.4/2.; - par[5] = 57.0/2.; - par[6] = 0.; - par[7] = 79.68/2.; - par[8] = 10.4/2.; - par[9] = 57.0/2.; - par[10] = 0.; - gMC->Gsvolu("SB1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SB2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SB1C", "TRAP", idCopper,par, 11); - -// section 3 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 71.33/2.; - par[4] = 48.77/2.; - par[5] = 9.73/2.; - par[6] = -15.3; - par[7] = 71.33/2.; - par[8] = 48.77/2.; - par[9] = 9.73/2.; - par[10] = -15.3; - - gMC->Gsvolu("SC1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SC2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SC1C", "TRAP", idCopper,par, 11); - -// section 4 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 6.00/2.; - par[4] = 0.; - par[5] = 1.56/2.; - par[6] = 7.41; - par[7] = 6.00/2.; - par[8] = 0.; - par[9] = 1.56/2.; - par[10] = 7.41; - gMC->Gsvolu("SD1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SD2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SD1C", "TRAP", idCopper,par, 11); - -// section 5 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 1.516/2.; - par[4] = 0.; - par[5] = 0.829/2.; - par[6] = 15.3; - par[7] = 1.516/2.; - par[8] = 0.; - par[9] = 0.829/2.; - par[10] = 15.3; - gMC->Gsvolu("SE1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SE2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SE1C", "TRAP", idCopper,par, 11); - -// section 6 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 3.92/2.; - par[4] = 0.; - par[5] = 0.562/2.; - par[6] = -4.1; - par[7] = 3.92/2.; - par[8] = 0.; - par[9] = 0.562/2.; - par[10] = -4.1; - gMC->Gsvolu("SF1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SF2G", "TRAP", idArCO2, par, 11); + Double_t maxXY = 89.0; + Double_t xy1 = 77.33; + Double_t xy2 = 48.77; + Double_t dxy1 = maxXY - xy1; - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SF1C", "TRAP", idCopper,par, 11); - -// section 7 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 0.941/2.; - par[4] = 0.562/2.; - par[5] = 0.; - par[6] = -16.6; - par[7] = 0.941/2.; - par[8] = 0.562/2.; - par[9] = 0.; - par[10] =-16.6; - gMC->Gsvolu("SG1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SG2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SG1C", "TRAP", idCopper,par, 11); - -// section 8 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 3.94/2.; - par[4] = 0.57/2.; - par[5] = 0.; - par[6] = 4.14; - par[7] = 3.94/2.; - par[8] = 0.57/2.; - par[9] = 0.; - par[10] = 4.14; - gMC->Gsvolu("SH1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SH2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SH1C", "TRAP", idCopper,par, 11); - -// section 9 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 0.95/2.; - par[4] = 0.; - par[5] = 0.57/2; - par[6] = 16.7; - par[7] = 0.95/2.; - par[8] = 0.; - par[9] = 0.57/2; - par[10] = 16.7; - gMC->Gsvolu("SI1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SI2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SI1C", "TRAP", idCopper,par, 11); - -// section 10 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 1.49/2.; - par[4] = 0.; - par[5] = 0.817/2.; - par[6] = -15.4; - par[7] = 1.49/2.; - par[8] = 0.; - par[9] = 0.817/2.; - par[10] = -15.4; - gMC->Gsvolu("SJ1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SJ2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SJ1C", "TRAP", idCopper,par, 11); - -// section 11 of 11 - par[0] = fgkHzGas; - par[1] = 0.; - par[2] = 0.; - par[3] = 5.93/2.; - par[4] = 0.; - par[5] = 1.49/2.; - par[6] = -7.16; - par[7] = 5.93/2.; - par[8] = 0.; - par[9] = 1.49/2.; - par[10] = -7.16; - gMC->Gsvolu("SK1G", "TRAP", idArCO2, par, 11); - gMC->Gsvolu("SK2G", "TRAP", idArCO2, par, 11); - - par[0] = fgkHzPadPlane; - gMC->Gsvolu("SK1C", "TRAP", idCopper,par, 11); -} + Int_t nz = 2; + Int_t nv = 6; + Double_t vx[6] = { 0.0, 0.0, xy2, maxXY, maxXY, dxy1 }; + Double_t vy[6] = { dxy1, maxXY, maxXY, xy2, 0.0, 0.0 }; + + TGeoXtru* xtruS1 = new TGeoXtru(nz); + xtruS1->SetName("xtruS1"); + xtruS1->DefinePolygon(nv, vx, vy); + xtruS1->DefineSection(0, -fgkHzGas, 0.0, 0.0, 1.0); + xtruS1->DefineSection(1, fgkHzGas, 0.0, 0.0, 1.0); + TGeoCompositeShape* layerS1 = new TGeoCompositeShape("layerS1", "xtruS1-cutTube"); + new TGeoVolume("SA1G", layerS1, kMedArCO2 ); + + TGeoXtru* xtruS2 = new TGeoXtru(nz); + xtruS2->SetName("xtruS2"); + xtruS2->DefinePolygon(nv, vx, vy); + xtruS2->DefineSection(0, -fgkHzGas, 0.0, 0.0, 1.0); + xtruS2->DefineSection(1, fgkHzGas, 0.0, 0.0, 1.0); + TGeoCompositeShape* layerS2 = new TGeoCompositeShape("layerS2", "xtruS2-cutTube"); + new TGeoVolume("SA2G", layerS2, kMedArCO2 ); + + TGeoXtru* xtruS3 = new TGeoXtru(nz); + xtruS3->SetName("xtruS3"); + xtruS3->DefinePolygon(nv, vx, vy); + xtruS3->DefineSection(0, -fgkHzPadPlane, 0.0, 0.0, 1.0); + xtruS3->DefineSection(1, fgkHzPadPlane, 0.0, 0.0, 1.0); + TGeoCompositeShape* layerS3 = new TGeoCompositeShape("layerS3", "xtruS3-cutTube"); + new TGeoVolume("SA1C", layerS3, kMedCopper ); +} + //______________________________________________________________________________ void AliMUONSt1GeometryBuilderV2::CreateSpacer0() @@ -481,6 +310,7 @@ void AliMUONSt1GeometryBuilderV2::CreateSpacer0() /// 6 BOX EPOXY 408.2 437.9 519.76 5.75 15.0 1.0 /// 6P BOX EPOXY 408.2 437.9 525.06 5.75 15.0 1.0 /// 7 CYL INOX 408.2 437.9 522.41 r=3.0 hz=20.63 +/// // tracking medias Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099; @@ -536,10 +366,10 @@ void AliMUONSt1GeometryBuilderV2::CreateSpacer() GReal_t par[3]; par[0] = 0.510; par[1] = 0.170; - par[2] = 1.275; + par[2] = 1.1515; gMC->Gsvolu("Spacer5A","BOX",idFrameEpoxy,par,3); - par[0] = 0.575; + par[0] = 0.510; par[1] = 1.500; par[2] = 0.100; gMC->Gsvolu("Spacer6","BOX",idFrameEpoxy,par,3); @@ -561,40 +391,27 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber) /// Create the quadrant (bending and non-bending planes) /// for the given chamber - CreateFrame(chamber); + // CreateQuadrantLayersAsVolumes(chamber); + CreateQuadrantLayersAsAssemblies(chamber); -#ifdef WITH_STL - SpecialMap specialMap; - specialMap[76] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.); - specialMap[75] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36)); - specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)); -#endif + CreateFrame(chamber); -#ifdef WITH_ROOT - SpecialMap specialMap; - specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.)); - specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36))); + TExMap specialMap; + specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.72), 90.)); + specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.7, 0.36))); specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36))); -#endif // Load mapping from OCDB if ( ! AliMpSegmentation::Instance() ) { AliFatal("Mapping has to be loaded first !"); } - const AliMpSectorSegmentation* kSegmentation1 - = dynamic_cast( - AliMpSegmentation::Instance() - ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane))); - if ( ! kSegmentation1 ) { + const AliMpSector* kSector1 + = AliMpSegmentation::Instance()->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane)); + if ( ! kSector1 ) { AliFatal("Could not access sector segmentation !"); } - - const AliMpSector* kSector1 = kSegmentation1->GetSector(); -/* - AliMpSectorReader reader1(AliMp::kStation1, AliMp::kBendingPlane); - AliMpSector* kSector1 = reader1.BuildSector(); -*/ + //Bool_t reflectZ = true; Bool_t reflectZ = false; //TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.); @@ -602,58 +419,50 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber) fgkDeltaQuadLHC + fgkPadYOffsetBP, 0.); PlaceSector(kSector1, specialMap, where, reflectZ, chamber); -#ifdef WITH_STL - specialMap.clear(); - specialMap[76] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.); - specialMap[75] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)); - specialMap[47] = AliMUONSt1SpecialMotif(TVector2(2.18,-0.98)); - specialMap[20] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)); - specialMap[46] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)); - specialMap[74] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)); - // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector - // in the true position) - // Was: specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)); -#endif - -#ifdef WITH_ROOT Int_t nb = AliMpConstants::ManuMask(AliMp::kNonBendingPlane); + TExMapIter it(&specialMap); +#if ROOT_SVN_REVISION >= 29598 + Long64_t key; + Long64_t value; +#else + Long_t key; + Long_t value; +#endif + + while ( it.Next(key,value) == kTRUE ) { + delete reinterpret_cast(value); + } specialMap.Delete(); - specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.)); - specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17))); - specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.18,-0.98))); + specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.51),90.)); + specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.20,-0.08))); + specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.40,-1.11))); specialMap.Add(20 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08))); - specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25))); - specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21))); + specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.92 , 0.17))); + specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.405, -0.10))); // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector // in the true position) - // Was: specialMap.Add(47,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18))); -#endif -/* - AliMpSectorReader reader2(AliMp::kStation1, AliMp::kNonBendingPlane); - AliMpSector* sector2 = reader2.BuildSector(); -*/ - const AliMpSectorSegmentation* kSegmentation2 - = dynamic_cast( - AliMpSegmentation::Instance() - ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane))); - if ( ! kSegmentation2 ) { - AliFatal("Could not access sector segmentation !"); + + const AliMpSector* kSector2 + = AliMpSegmentation::Instance() + ->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane)); + if ( ! kSector2 ) { + AliFatal("Could not access sector !"); } - - const AliMpSector* kSector2 = kSegmentation2->GetSector(); //reflectZ = false; reflectZ = true; - TVector2 offset = kSector2->Position(); + TVector2 offset = TVector2(kSector2->GetPositionX(), kSector2->GetPositionY()); where = TVector3(where.X()+offset.X(), where.Y()+offset.Y(), 0.); // Add the half-pad shift of the non-bending plane wrt bending plane // (The shift is defined in the mapping as sector offset) // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2 PlaceSector(kSector2, specialMap, where, reflectZ, chamber); -#ifdef WITH_ROOT + it.Reset(); + while ( it.Next(key,value) == kTRUE ) { + delete reinterpret_cast(value); + } specialMap.Delete(); -#endif } //______________________________________________________________________________ @@ -728,22 +537,28 @@ void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber, FoamBoxName(segNumber) == "S309" || FoamBoxName(segNumber) == "S351" ) { - GReal_t posX = 12.6; - GReal_t posY = 0.75; - GReal_t posZ = 0.0; + GReal_t posX = 12.6; + GReal_t posY = 0.75; + GReal_t posZ = -0.1; + if ( FoamBoxName(segNumber) == "S267" || + FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP; gMC->Gspos("Spacer5A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY"); posY = -0.75; + if ( FoamBoxName(segNumber) == "S267" || + FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP; gMC->Gspos("Spacer5A", 2, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY"); posY = 0.0; posZ = 1.1515; if ( FoamBoxName(segNumber) == "S267" || - FoamBoxName(segNumber) == "S351" ) posZ *= -1.0; + FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP; gMC->Gspos("Spacer6", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY"); posY = 0.0; posZ = 0.0; + if ( FoamBoxName(segNumber) == "S267" || + FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP; gMC->Gspos("Spacer7A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY"); } @@ -751,12 +566,129 @@ void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber, GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X(); GReal_t posY = 0.; GReal_t posZ = 0.; - + gMC->Gspos(fgkHoleName,holeNum+1, FoamBoxName(segNumber).Data(),posX,posY,posZ,0,"ONLY"); } } +//______________________________________________________________________________ +void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsVolumes(Int_t chamber) +{ +/// Create the three main layers as real volumes. +/// Not used anymore. + + // tracking medias + Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099; + Int_t idAir = idtmed[1100]; // medium 1 + + Float_t par[11]; + Float_t posX,posY,posZ; + +// Quadrant volume TUBS1, positioned at the end + par[0] = fgkMotherIR1; + par[1] = fgkMotherOR1; + par[2] = fgkMotherThick1; + par[3] = fgkMotherPhiL1; + par[4] = fgkMotherPhiU1; + gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5); + // gMC->Gsvolu(QuadrantMFLayerName(chamber),"TUBS",idAir,par,5); + +// Replace the volume shape with a composite shape +// with substracted overlap with beam shield (YMOT) + + if ( gMC->IsRootGeometrySupported() ) { + + // Get shape + TGeoVolume* mlayer + = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber)); + if ( !mlayer ) { + AliErrorStream() + << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found" + << endl; + } + else { + TGeoShape* quadrant = mlayer->GetShape(); + quadrant->SetName("quadrant"); + + // Beam shield recess + par[0] = 0; + par[1] = 15.4; + par[2] = fgkMotherThick1; + new TGeoTube("shield_tube", par[0], par[1], par[2]); + + // Displacement + posX = 2.6; + posY = 2.6; + posZ = 0; + TGeoTranslation* displacement + = new TGeoTranslation("TR", posX, posY, posZ); + displacement->RegisterYourself(); + + // Composite shape + TGeoShape* composite + = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR"); + + // Reset shape to volume + mlayer->SetShape(composite); + } + + TGeoVolume* malayer + = gGeoManager->FindVolumeFast(QuadrantMFLayerName(chamber)); + if ( !malayer ) { + AliErrorStream() + << "Quadrant volume " << QuadrantMFLayerName(chamber) << " not found" + << endl; + } + else { + TGeoShape* quadrant = malayer->GetShape(); + quadrant->SetName("quadrant"); + + // Beam shield recess + par[0] = 0; + par[1] = 15.4; + par[2] = fgkMotherThick1; + new TGeoTube("shield_tube", par[0], par[1], par[2]); + + // Displacement + posX = 2.6; + posY = 2.6; + posZ = 0; + TGeoTranslation* displacement + = new TGeoTranslation("TR", posX, posY, posZ); + displacement->RegisterYourself(); + + // Composite shape + TGeoShape* composite + = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR"); + + // Reset shape to volume + malayer->SetShape(composite); + } + } + +// Quadrant volume TUBS2, positioned at the end + par[0] = fgkMotherIR2; + par[1] = fgkMotherOR2; + par[2] = fgkMotherThick2; + par[3] = fgkMotherPhiL2; + par[4] = fgkMotherPhiU2; + + gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5); + gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5); +} + +//______________________________________________________________________________ +void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsAssemblies(Int_t chamber) +{ +/// Create the three main layers as assemblies + + gGeoManager->MakeVolumeAssembly(QuadrantMLayerName(chamber).Data()); + gGeoManager->MakeVolumeAssembly(QuadrantMFLayerName(chamber).Data()); + gGeoManager->MakeVolumeAssembly(QuadrantNLayerName(chamber).Data()); + gGeoManager->MakeVolumeAssembly(QuadrantFLayerName(chamber).Data()); +} + //______________________________________________________________________________ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) { @@ -787,12 +719,18 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) /// SQNx is the Quadrant Near side layer for chamber \a chamber ( posZ in [-6.25,3-.25) ), and /// SQFx is the Quadrant Far side layer for chamber \a chamber ( posZ in (3.25,6.25] ). + // TString quadrantMLayerName = QuadrantMLayerName(chamber); + + TString quadrantMLayerName = QuadrantMFLayerName(chamber); + TString quadrantNLayerName = QuadrantNLayerName(chamber); + TString quadrantFLayerName = QuadrantFLayerName(chamber); + const Float_t kNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin // tracking medias Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099; - Int_t idAir = idtmed[1100]; // medium 1 + //Int_t idAir = idtmed[1100]; // medium 1 //Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730 //Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe) //Int_t idFR4 = idtmed[1110]; // medium 11 FR4 @@ -805,21 +743,21 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) Int_t idAlu = idtmed[1120]; // medium 21 Aluminium + TGeoMedium* kMedEpoxy = gGeoManager->GetMedium("MUON_FrameCH$"); + TGeoMedium* kMedInox = gGeoManager->GetMedium("MUON_Kapton"); + TGeoMedium* kMedAlu = gGeoManager->GetMedium("MUON_ALU_II$"); + + // Rotation Matrices - Int_t rot1, rot2, rot3; + Int_t rot1, rot2, rot3, rot4; // Rotation matrices fMUON->AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane fMUON->AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane fMUON->AliMatrix(rot3, 90., 45., 90., 315.,180., 0.); // +45 deg in x-y + rotation 180° around y + fMUON->AliMatrix(rot4, 90., 315., 90., 45., 0., 0.); // -45 deg in x-y plane -// Translation matrices ... NOT USED -// fMUON->AliMatrix(trans1, 90., 0., 90., 90., 0., 0.); // X-> X; Y -> Y; Z -> Z -// fMUON->AliMatrix(trans2, 90., 180., 90., 90., 180., 0.); // X->-X; Y -> Y; Z ->-Z -// fMUON->AliMatrix(trans3, 90., 180., 90., 270., 0., 0.); // X->-X; Y ->-Y; Z -> Z -// fMUON->AliMatrix(trans4, 90., 0., 90., 270., 180., 0.); // X-> X; Y ->-Y; Z ->-Z -// - // ___________________Volume thicknesses________________________ +// ___________________Volume thicknesses________________________ const Float_t kHzFrameThickness = 1.59/2.; //equivalent thickness const Float_t kHzOuterFrameEpoxy = 1.19/2.; //equivalent thickness @@ -847,7 +785,7 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) const Float_t kHzVertBarSteel = 0.198/2.; //equivalent thickness const Float_t kHzVertEarthProfCu = 1.1/2.; //equivalent thickness - //_______________Parameter definitions in sequence _________ +//_______________Parameter definitions in sequence _________ // InVFrame parameters const Float_t kHxInVFrame = 1.85/2.; @@ -890,34 +828,12 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) const Float_t kHzTFAE = kHzOuterFrameEpoxy; // layer 1 thickness const Float_t kHzTFAI = kHzOuterFrameInox; // layer 3 thickness -// TopFrameAnodeA parameters - trapezoid, 2 layers - const Float_t kHzFAAE = kHzOuterFrameEpoxy; // layer 1 thickness - const Float_t kHzFAAI = kHzOuterFrameInox; // layer 3 thickness - const Float_t kTetFAA = 0.; - const Float_t kPhiFAA = 0.; +// TopFrameAnode parameters - 2 trapezoids, 2 layers +// (redefined with TGeoXtru shape) const Float_t kH1FAA = 8.7/2.; - const Float_t kBl1FAA = 4.35/2.; - const Float_t kTl1FAA = 7.75/2.; - const Float_t kAlp1FAA = 11.06; - const Float_t kH2FAA = 8.7/2.; - const Float_t kBl2FAA = 4.35/2.; - const Float_t kTl2FAA = 7.75/2.; - const Float_t kAlp2FAA = 11.06; - -// TopFrameAnodeB parameters - trapezoid, 2 layers - const Float_t kHzFABE = kHzOuterFrameEpoxy; // layer 1 thickness - const Float_t kHzFABI = kHzOuterFrameInox; // layer 3 thickness - const Float_t kTetFAB = 0.; - const Float_t kPhiFAB = 0.; - const Float_t kH1FAB = 8.70/2.; - const Float_t kBl1FAB = 0.; const Float_t kTl1FAB = 4.35/2.; - const Float_t kAlp1FAB = 14.03; - const Float_t kH2FAB = 8.70/2.; - const Float_t kBl2FAB = 0.; - const Float_t kTl2FAB = 4.35/2.; - const Float_t kAlp2FAB = 14.03; - + const Float_t kTl1FAA = 7.75/2.; + // TopAnode parameters - cuboid (part 1 of 3 parts) const Float_t kHxTA1 = 16.2/2.; const Float_t kHyTA1 = 3.5/2.; @@ -996,60 +912,15 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) const Float_t kHzTGS = kHzTopGasSupportAl; // OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material +// (redefined with TGeoXtru shape) // -//--- - -// Trapezoid 1 - const Float_t kHzOETFE = kHzOuterFrameEpoxy; // layer 1 - const Float_t kHzOETFI = kHzOuterFrameInox; // layer 3 - - const Float_t kTetOETF = 0.; // common to all 4 trapezoids - const Float_t kPhiOETF = 0.; // common to all 4 trapezoids - const Float_t kH1OETF = 7.196/2.; // common to all 4 trapezoids - const Float_t kH2OETF = 7.196/2.; // common to all 4 trapezoids - - const Float_t kBl1OETF1 = 3.75/2; - const Float_t kTl1OETF1 = 3.996/2.; - const Float_t kAlp1OETF1 = 0.98; + const Float_t kTl1OETF1 = 3.996/2.; // Trapezoid 1 + const Float_t kTl1OETF2 = 3.75/2; // Trapezoid 2 + const Float_t kTl1OETF3 = 3.01/2.; // Trapezoid 3 + const Float_t kTl1OETF4 = 1.77/2.; // Trapezoid 4 + - const Float_t kBl2OETF1 = 3.75/2; - const Float_t kTl2OETF1 = 3.996/2.; - const Float_t kAlp2OETF1 = 0.98; - -// Trapezoid 2 - const Float_t kBl1OETF2 = 3.01/2.; - const Float_t kTl1OETF2 = 3.75/2; - const Float_t kAlp1OETF2 = 2.94; - - const Float_t kBl2OETF2 = 3.01/2.; - const Float_t kTl2OETF2 = 3.75/2; - const Float_t kAlp2OETF2 = 2.94; - -// Trapezoid 3 - //const Float_t kBl1OETF3 = 1.767/2.; - //const Float_t kTl1OETF3 = 3.01/2.; - const Float_t kBl1OETF3 = 1.117/2.; - const Float_t kTl1OETF3 = 2.36/2.; - const Float_t kAlp1OETF3 = 4.94; - // Fix (5) - overlap of SQ21 with 041M and 125M - - //const Float_t kBl2OETF3 = 1.767/2.; - //const Float_t kTl2OETF3 = 3.01/2.; - const Float_t kBl2OETF3 = 1.117/2.; - const Float_t kTl2OETF3 = 2.36/2.; - const Float_t kAlp2OETF3 = 4.94; - // Fix (5) - overlap of SQ21 with 041M and 125M - -// Trapezoid 4 - const Float_t kBl1OETF4 = 0.; - const Float_t kTl1OETF4 = 1.77/2.; - const Float_t kAlp1OETF4 = 7.01; - - const Float_t kBl2OETF4 = 0.; - const Float_t kTl2OETF4 = 1.77/2.; - const Float_t kAlp2OETF4 = 7.01; - // Frame Structure (OutVFrame): // // OutVFrame and corner (OutVFrame cuboid, OutVFrame trapezoid) @@ -1134,44 +1005,12 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) const Float_t kHzLPNF = kHzLatPosInoxProfNF; // near and far layers // VertCradle, 3 layers (copies), each composed of 4 trapezoids -// VertCradleA - const Float_t kHzVC1 = kHzVerticalCradleAl; - const Float_t kTetVC1 = 0.; - const Float_t kPhiVC1 = 0.; - const Float_t kH1VC1 = 10.25/2.; - const Float_t kBl1VC1 = 3.70/2.; - const Float_t kTl1VC1 = 0.; - const Float_t kAlp1VC1 = -10.23; - const Float_t kH2VC1 = 10.25/2.; - const Float_t kBl2VC1 = 3.70/2.; - const Float_t kTl2VC1 = 0.; - const Float_t kAlp2VC1 = -10.23; - -// VertCradleB - const Float_t kHzVC2 = kHzVerticalCradleAl; - const Float_t kTetVC2 = 0.; - const Float_t kPhiVC2 = 0.; - const Float_t kH1VC2 = 10.25/2.; - const Float_t kBl1VC2 = 6.266/2.; - const Float_t kTl1VC2 = 3.70/2.; - const Float_t kAlp1VC2 = -7.13; - const Float_t kH2VC2 = 10.25/2.; - const Float_t kBl2VC2 = 6.266/2.; - const Float_t kTl2VC2 = 3.70/2.; - const Float_t kAlp2VC2 = -7.13; - -// VertCradleC - const Float_t kHzVC3 = kHzVerticalCradleAl; - const Float_t kTetVC3 = 0.; - const Float_t kPhiVC3 = 0.; - const Float_t kH1VC3 = 10.25/2.; - const Float_t kBl1VC3 = 7.75/2.; - const Float_t kTl1VC3 = 6.266/2.; - const Float_t kAlp1VC3 = -4.14; - const Float_t kH2VC3 = 10.25/2.; - const Float_t kBl2VC3 = 7.75/2.; - const Float_t kTl2VC3 = 6.266/2.; - const Float_t kAlp2VC3 = -4.14; +// (redefined with TGeoXtru shape) +// + const Float_t kH1VC1 = 10.25/2.; // all cradles + const Float_t kBl1VC1 = 3.70/2.; // VertCradleA + const Float_t kBl1VC2 = 6.266/2.; // VertCradleB + const Float_t kBl1VC3 = 7.75/2.; // VertCradleC // VertCradleD const Float_t kHzVC4 = kHzVerticalCradleAl; @@ -1185,7 +1024,7 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) const Float_t kBl2VC4 = 8.273/2.; const Float_t kTl2VC4 = 7.75/2.; const Float_t kAlp2VC4 = -1.46; - + // LateralSightSupport - single trapezoid const Float_t kHzVSS = kHzLateralSightAl; const Float_t kTetVSS = 0.; @@ -1245,64 +1084,6 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) Float_t par[11]; Float_t posX,posY,posZ; -// Quadrant volume TUBS1, positioned at the end - par[0] = fgkMotherIR1; - par[1] = fgkMotherOR1; - par[2] = fgkMotherThick1; - par[3] = fgkMotherPhiL1; - par[4] = fgkMotherPhiU1; - gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5); - -// Replace the volume shape with a composite shape -// with substracted overlap with beam shield (YMOT) - - if ( gMC->IsRootGeometrySupported() ) { - - // Get shape - TGeoVolume* mlayer - = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber)); - if ( !mlayer ) { - AliErrorStream() - << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found" - << endl; - } - else { - TGeoShape* quadrant = mlayer->GetShape(); - quadrant->SetName("quadrant"); - - // Beam shield recess - par[0] = 0; - par[1] = 15.4; - par[2] = fgkMotherThick1; - new TGeoTube("shield_tube", par[0], par[1], par[2]); - - // Displacement - posX = 2.6; - posY = 2.6; - posZ = 0; - TGeoTranslation* displacement - = new TGeoTranslation("TR", posX, posY, posZ); - displacement->RegisterYourself(); - - // Composite shape - TGeoShape* composite - = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR"); - - // Reset shape to volume - mlayer->SetShape(composite); - } - } - -// Quadrant volume TUBS2, positioned at the end - par[0] = fgkMotherIR2; - par[1] = fgkMotherOR2; - par[2] = fgkMotherThick2; - par[3] = fgkMotherPhiL2; - par[4] = fgkMotherPhiU2; - - gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5); - gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5); - if (chamber==1) { // InVFrame par[0] = kHxInVFrame; @@ -1332,41 +1113,47 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) par[2] = kHzTFAI; gMC->Gsvolu("SQ03","BOX",idInox,par,3); - // TopFrameAnodeA - layer 1 of 2 - par[0] = kHzFAAE; - par[1] = kTetFAA; - par[2] = kPhiFAA; - par[3] = kH1FAA; - par[4] = kBl1FAA; - par[5] = kTl1FAA; - par[6] = kAlp1FAA; - par[7] = kH2FAA; - par[8] = kBl2FAA; - par[9] = kTl2FAA; - par[10] = kAlp2FAA; - gMC->Gsvolu("SQ04","TRAP",idFrameEpoxy,par,11); - - // TopFrameAnodeA - layer 2 of 2 - par[0] = kHzFAAI; - gMC->Gsvolu("SQ05","TRAP",idInox,par,11); - - // TopFrameAnodeB - layer 1 of 2 - par[0] = kHzFABE; - par[1] = kTetFAB; - par[2] = kPhiFAB; - par[3] = kH1FAB; - par[4] = kBl1FAB; - par[5] = kTl1FAB; - par[6] = kAlp1FAB; - par[7] = kH2FAB; - par[8] = kBl2FAB; - par[9] = kTl2FAB; - par[10] = kAlp2FAB; - gMC->Gsvolu("SQ06","TRAP",idFrameEpoxy,par,11); - - // OutTopTrapFrameB - layer 2 of 2 - par[0] = kHzFABI; - gMC->Gsvolu("SQ07","TRAP",idInox,par,11); + + // Common declarations for TGeoXtru parameters + Double_t dx, dx0, dx1, dx2, dx3; + Double_t dy, dy1, dy2, dy3, dy4; + Double_t vx[16]; + Double_t vy[16]; + Int_t nz; + Int_t nv; + + // SQ04to06 and SQ05to07 + + dx = 2.*kH1FAA; + dy1 = 2.*kTl1FAA; + dy2 = 2.*kTl1FAB; + + nz = 2; + nv = 5; + vx[0] = 0.0; vy[0] = 0.0; + vx[1] = 0.0; vy[1] = dy1; + vx[2] = dx; vy[2] = dy2; + vx[3] = 2*dx; vy[3] = 0.0; + vx[4] = dx; vy[4] = 0.0; + + // Shift center in the middle + for ( Int_t i=0; iDefinePolygon(nv, vx, vy); + xtruS5->DefineSection(0, -kHzOuterFrameEpoxy, 0.0, 0.0, 1.0); + xtruS5->DefineSection(1, kHzOuterFrameEpoxy, 0.0, 0.0, 1.0); + new TGeoVolume("SQ04toSQ06", xtruS5, kMedEpoxy); + + TGeoXtru* xtruS6 = new TGeoXtru(nz); + xtruS6->DefinePolygon(nv, vx, vy); + xtruS6->DefineSection(0, -kHzOuterFrameInox, 0.0, 0.0, 1.0); + xtruS6->DefineSection(1, kHzOuterFrameInox, 0.0, 0.0, 1.0); + new TGeoVolume("SQ05toSQ07", xtruS6, kMedInox); + // TopAnode1 - layer 1 of 2 par[0] = kHxTA1; @@ -1376,7 +1163,7 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) // TopAnode1 - layer 2 of 2 par[2] = kHzTA12; - gMC->Gsvolu("SQ09","BOX",idFR4,par,11); + gMC->Gsvolu("SQ09","BOX",idFR4,par,3); // TopAnode2 - layer 1 of 2 par[0] = kHzTA21; @@ -1460,68 +1247,51 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) // // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox) -// +// (redefined with TGeoXtru shape ) //--- - // Trapezoid 1 - 2 layers - par[1] = kTetOETF; - par[2] = kPhiOETF; - par[3] = kH1OETF; - par[4] = kBl1OETF1; - par[5] = kTl1OETF1; - par[6] = kAlp1OETF1; - par[7] = kH2OETF; - par[8] = kBl2OETF1; - par[9] = kTl2OETF1; - par[10] = kAlp2OETF1; - - par[0] = kHzOETFE; - gMC->Gsvolu("SQ17","TRAP",idFrameEpoxy,par,11); - par[0] = kHzOETFI; - gMC->Gsvolu("SQ18","TRAP",idInox,par,11); - - // Trapezoid 2 - 2 layers - par[4] = kBl1OETF2; - par[5] = kTl1OETF2; - par[6] = kAlp1OETF2; - - par[8] = kBl2OETF2; - par[9] = kTl2OETF2; - par[10] = kAlp2OETF2; - - par[0] = kHzOETFE; - gMC->Gsvolu("SQ19","TRAP",idFrameEpoxy,par,11); - par[0] = kHzOETFI; - gMC->Gsvolu("SQ20","TRAP",idInox,par,11); - - // Trapezoid 3 - 2 layers - par[4] = kBl1OETF3; - par[5] = kTl1OETF3; - par[6] = kAlp1OETF3; - - par[8] = kBl2OETF3; - par[9] = kTl2OETF3; - par[10] = kAlp2OETF3; - - par[0] = kHzOETFE; - gMC->Gsvolu("SQ21","TRAP",idFrameEpoxy,par,11); - par[0] = kHzOETFI; - gMC->Gsvolu("SQ22","TRAP",idInox,par,11); - - // Trapezoid 4 - 2 layers - par[4] = kBl1OETF4; - par[5] = kTl1OETF4; - par[6] = kAlp1OETF4; + dx = 2.*kH1OETF; + dy1 = 2.*kTl1OETF4; + dy2 = 2.*kTl1OETF3; + dy3 = 2.*kTl1OETF2; + dy4 = 2.*kTl1OETF1; + + nz = 2; + nv = 16; + vx[0] = -4*dx; vy[0] = 0.0; + vx[1] = -3*dx; vy[1] = dy1; + vx[2] = -2*dx; vy[2] = dy2; + vx[3] = -1*dx; vy[3] = dy3; + vx[4] = 0.0; vy[4] = dy4; + vx[5] = dx; vy[5] = dy3; + vx[6] = 2*dx; vy[6] = dy2; + vx[7] = 3*dx; vy[7] = dy1; + vx[8] = 4*dx; vy[8] = 0.0; + vx[9] = 3*dx; vy[9] = 0.0; + vx[10] = 2*dx; vy[10] = 0.0; + vx[11] = dx; vy[11] = 0.0; + vx[12] = 0.0; vy[12] = 0.0; + vx[13] = -1*dx; vy[13] = 0.0; + vx[14] = -2*dx; vy[14] = 0.0; + vx[15] = -3*dx; vy[15] = 0.0; + + // Shift center in the middle + for ( Int_t i=0; iDefinePolygon(nv, vx, vy); + xtruS1->DefineSection(0, -kHzOuterFrameEpoxy, 0.0, 0.0, 1.0); + xtruS1->DefineSection(1, kHzOuterFrameEpoxy, 0.0, 0.0, 1.0); + new TGeoVolume("SQ17to23", xtruS1, kMedEpoxy ); + + TGeoXtru* xtruS2 = new TGeoXtru(nz); + xtruS2->DefinePolygon(nv, vx, vy); + xtruS2->DefineSection(0, -kHzOuterFrameInox, 0.0, 0.0, 1.0); + xtruS2->DefineSection(1, kHzOuterFrameInox, 0.0, 0.0, 1.0); + new TGeoVolume("SQ18to24", xtruS2, kMedInox ); - par[8] = kBl2OETF4; - par[9] = kTl2OETF4; - par[10] = kAlp2OETF4; - - par[0] = kHzOETFE; - gMC->Gsvolu("SQ23","TRAP",idFrameEpoxy,par,11); - par[0] = kHzOETFI; - gMC->Gsvolu("SQ24","TRAP",idInox,par,11); - +// +// OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox) //--- // OutVFrame par[0] = kHxOutVFrame; @@ -1608,47 +1378,63 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) par[2] = kHzLPNF; gMC->Gsvolu("SQ33","BOX",idInox,par,3); // near and far layers - // VertCradleA - 1st trapezoid - par[0] = kHzVC1; - par[1] = kTetVC1; - par[2] = kPhiVC1; - par[3] = kH1VC1; - par[4] = kBl1VC1; - par[5] = kTl1VC1; - par[6] = kAlp1VC1; - par[7] = kH2VC1; - par[8] = kBl2VC1; - par[9] = kTl2VC1; - par[10] = kAlp2VC1; - gMC->Gsvolu("SQ34","TRAP",idAlu,par,11); + dy = 2.*kH1VC1; + dx0 = 2.*kBl1VC4; + dx1 = 2.*kBl1VC3; + dx2 = 2.*kBl1VC2; + dx3 = 2.*kBl1VC1; - // VertCradleB - 2nd trapezoid - par[0] = kHzVC2; - par[1] = kTetVC2; - par[2] = kPhiVC2; - par[3] = kH1VC2; - par[4] = kBl1VC2; - par[5] = kTl1VC2; - par[6] = kAlp1VC2; - par[7] = kH2VC2; - par[8] = kBl2VC2; - par[9] = kTl2VC2; - par[10] = kAlp2VC2; - gMC->Gsvolu("SQ35","TRAP",idAlu,par,11); - - // VertCradleC - 3rd trapezoid - par[0] = kHzVC3; - par[1] = kTetVC3; - par[2] = kPhiVC3; - par[3] = kH1VC3; - par[4] = kBl1VC3; - par[5] = kTl1VC3; - par[6] = kAlp1VC3; - par[7] = kH2VC3; - par[8] = kBl2VC3; - par[9] = kTl2VC3; - par[10] = kAlp2VC3; - gMC->Gsvolu("SQ36","TRAP",idAlu,par,11); + // VertCradle + // (Trapezoids SQ34 to SQ36 or SQ37 redefined with TGeoXtru shape) + + nz = 2; + nv = 7; + vx[0] = 0.0; vy[0] = 0.0; + vx[1] = 0.0; vy[1] = dy; + vx[2] = 0.0; vy[2] = 2*dy; + vx[3] = 0.0; vy[3] = 3*dy; + vx[4] = dx3; vy[4] = 2*dy; + vx[5] = dx2; vy[5] = dy; + vx[6] = dx1; vy[6] = 0.0; + + // Shift center in the middle + for ( Int_t i=0; iDefinePolygon(nv, vx, vy); + xtruS3->DefineSection(0, -kHzVerticalCradleAl, 0.0, 0.0, 1.0); + xtruS3->DefineSection(1, kHzVerticalCradleAl, 0.0, 0.0, 1.0); + new TGeoVolume("SQ34to36", xtruS3, kMedAlu); + + // Trapezoids SQ34 to SQ37; + // (keeping the same coordinate system as for SQ34to36) + + nz = 2; + nv = 9; + vx[0] = 0.0; vy[0] =-1.0*dy; + vx[1] = 0.0; vy[1] = 0.0; + vx[2] = 0.0; vy[2] = dy; + vx[3] = 0.0; vy[3] = 2*dy; + vx[4] = 0.0; vy[4] = 3*dy; + vx[5] = dx3; vy[5] = 2*dy; + vx[6] = dx2; vy[6] = dy; + vx[7] = dx1; vy[7] = 0.0; + vx[8] = dx0; vy[8] =-1.0*dy; + + // Shift center in the middle (of SQ34to36!!) + for ( Int_t i=0; iDefinePolygon(nv, vx, vy); + xtruS4->DefineSection(0, -kHzVerticalCradleAl, 0.0, 0.0, 1.0); + xtruS4->DefineSection(1, kHzVerticalCradleAl, 0.0, 0.0, 1.0); + new TGeoVolume("SQ34to37", xtruS4, kMedAlu); // VertCradleD - 4th trapezoid par[0] = kHzVC4; @@ -1734,7 +1520,7 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = kHxInVFrame; posY = 2.0*kHyInHFrame+2.*kHyH1mm+kIAF+kHyInVFrame; posZ = 0.; - gMC->Gspos("SQ00",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ00",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // keep memory of the mid position. Used for placing screws const GReal_t kMidVposX = posX; @@ -1745,148 +1531,98 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = 2.0*kHxInVFrame+kHxV1mm; posY = 2.0*kHyInHFrame+2.*kHyH1mm+kIAF+kHyV1mm; posZ = 0.; - gMC->Gspos("SQ01",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); + gMC->Gspos("SQ01",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY"); // TopFrameAnode place 2 layers of TopFrameAnode cuboids posX = kHxTFA; posY = 2.*kHyInHFrame+2.*kHyH1mm+kIAF+2.*kHyInVFrame+kHyTFA; - posZ = kHzOuterFrameInox; - gMC->Gspos("SQ02",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY"); - posZ = posZ+kHzOuterFrameInox; - gMC->Gspos("SQ03",1,QuadrantMLayerName(chamber),posX, posY, posZ,0,"ONLY"); - - // place 2 layers of TopFrameAnodeA trapezoids - posX = 35.8932+fgkDeltaQuadLHC; - posY = 92.6745+fgkDeltaQuadLHC; - posZ = kHzOuterFrameInox; - gMC->Gspos("SQ04",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); - posZ = posZ+kHzOuterFrameInox; - gMC->Gspos("SQ05",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + posZ = -kHzOuterFrameInox; + gMC->Gspos("SQ02",1,quadrantMLayerName,posX, posY, posZ,0,"ONLY"); + posZ = kHzOuterFrameEpoxy; + gMC->Gspos("SQ03",1,quadrantMLayerName,posX, posY, posZ,0,"ONLY"); - // place 2 layers of TopFrameAnodeB trapezoids - posX = 44.593+fgkDeltaQuadLHC; - posY = 90.737+fgkDeltaQuadLHC; - posZ = kHzOuterFrameInox; - gMC->Gspos("SQ06",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); - posZ = posZ+kHzOuterFrameInox; - gMC->Gspos("SQ07",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + // TopFrameAnode - place 2 layers of 2 trapezoids + // (SQ04 - SQ07) + posX += kHxTFA + 2.*kH1FAA; + posZ = -kHzOuterFrameInox; + gMC->Gspos("SQ04toSQ06",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); + posZ = kHzOuterFrameEpoxy; + gMC->Gspos("SQ05toSQ07",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); // TopAnode1 place 2 layers posX = 6.8+fgkDeltaQuadLHC; posY = 99.85+fgkDeltaQuadLHC; posZ = -1.*kHzAnodeFR4; - gMC->Gspos("SQ08",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); - posZ = posZ+kHzTopAnodeSteel1; - gMC->Gspos("SQ09",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ08",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); + posZ = kHzTopAnodeSteel1; + gMC->Gspos("SQ09",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); // TopAnode2 place 2 layers posX = 18.534+fgkDeltaQuadLHC; posY = 99.482+fgkDeltaQuadLHC; posZ = -1.*kHzAnodeFR4; - gMC->Gspos("SQ10",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); - posZ = posZ+kHzTopAnodeSteel2; - gMC->Gspos("SQ11",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + // shift up to solve overlap with SQ14 + posY += 0.1; + gMC->Gspos("SQ10",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); + posZ = kHzTopAnodeSteel2; + gMC->Gspos("SQ11",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); // TopAnode3 place 1 layer - posX = 25.80+fgkDeltaQuadLHC; + posX = 25.804+fgkDeltaQuadLHC; posY = 98.61+fgkDeltaQuadLHC; posZ = 0.; - gMC->Gspos("SQ12",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + gMC->Gspos("SQ12",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); // TopEarthFace - 2 copies posX = 23.122+fgkDeltaQuadLHC; posY = 96.90+fgkDeltaQuadLHC; posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+kHzTopEarthFaceCu; - gMC->Gspos("SQ13",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ13",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); posZ = -1.*posZ; - gMC->Gspos("SQ13",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ13",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); // TopEarthProfile posX = 14.475+fgkDeltaQuadLHC; posY = 97.900+fgkDeltaQuadLHC; posZ = kHzTopEarthProfileCu; - gMC->Gspos("SQ14",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ14",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ14",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ14",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); // TopGasSupport - 2 copies posX = 4.9500+fgkDeltaQuadLHC; posY = 96.200+fgkDeltaQuadLHC; posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+kHzTopGasSupportAl; - gMC->Gspos("SQ15",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ15",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); posZ = -1.*posZ; - gMC->Gspos("SQ15",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ15",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); // TopPositioner parameters - single Stainless Steel trapezoid - 2 copies posX = 7.60+fgkDeltaQuadLHC; posY = 98.98+fgkDeltaQuadLHC; posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+2.*kHzTopGasSupportAl+kHzTopPositionerSteel; - gMC->Gspos("SQ16",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + gMC->Gspos("SQ16",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); posZ = -1.*posZ; - gMC->Gspos("SQ16",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + gMC->Gspos("SQ16",2,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); // OutEdgeFrame - Float_t xCenter[8]; - Float_t yCenter[8]; - - xCenter[0] = 73.201 + fgkDeltaQuadLHC; - xCenter[1] = 78.124 + fgkDeltaQuadLHC; - //xCenter[2] = 82.862 + fgkDeltaQuadLHC; - xCenter[2] = 83.102 + fgkDeltaQuadLHC; - xCenter[3] = 87.418 + fgkDeltaQuadLHC; - // Fix (5) - overlap of SQ21 with 041M and 125M - - yCenter[0] = 68.122 + fgkDeltaQuadLHC; - yCenter[1] = 62.860 + fgkDeltaQuadLHC; - //yCenter[2] = 57.420 + fgkDeltaQuadLHC; - yCenter[2] = 57.660 + fgkDeltaQuadLHC; - yCenter[3] = 51.800 + fgkDeltaQuadLHC; - // Fix (5) - overlap of SQ21 with 041M and 125M - - xCenter[4] = 68.122 + fgkDeltaQuadLHC; - xCenter[5] = 62.860 + fgkDeltaQuadLHC; - xCenter[6] = 57.420 + fgkDeltaQuadLHC; - xCenter[7] = 51.800 + fgkDeltaQuadLHC; - - yCenter[4] = 73.210 + fgkDeltaQuadLHC; - yCenter[5] = 78.124 + fgkDeltaQuadLHC; - yCenter[6] = 82.862 + fgkDeltaQuadLHC; - yCenter[7] = 87.418 + fgkDeltaQuadLHC; - - posZ = -1.0*kHzOuterFrameInox; - gMC->Gspos("SQ17",1,QuadrantMLayerName(chamber), xCenter[0], yCenter[0], posZ, rot2,"ONLY"); - gMC->Gspos("SQ17",2,QuadrantMLayerName(chamber), xCenter[4], yCenter[4], posZ, rot3,"ONLY"); - gMC->Gspos("SQ19",1,QuadrantMLayerName(chamber), xCenter[1], yCenter[1], posZ, rot2,"ONLY"); - gMC->Gspos("SQ19",2,QuadrantMLayerName(chamber), xCenter[5], yCenter[5], posZ, rot3,"ONLY"); - - gMC->Gspos("SQ21",1,QuadrantMLayerName(chamber), xCenter[2], yCenter[2], posZ, rot2,"ONLY"); - gMC->Gspos("SQ21",2,QuadrantMLayerName(chamber), xCenter[6], yCenter[6], posZ, rot3,"ONLY"); - - gMC->Gspos("SQ23",1,QuadrantMLayerName(chamber), xCenter[3], yCenter[3], posZ, rot2,"ONLY"); - gMC->Gspos("SQ23",2,QuadrantMLayerName(chamber), xCenter[7], yCenter[7], posZ, rot3,"ONLY"); + posZ = -1.0*kHzOuterFrameInox; + //Double_t xCenterAll = 70.6615; + Double_t xCenterAll = 70.500; + Double_t yCenterAll = 70.350; + gMC->Gspos("SQ17to23",1,quadrantMLayerName, xCenterAll, yCenterAll, posZ, rot4,"ONLY"); - posZ = posZ+kHzOuterFrameEpoxy; - - gMC->Gspos("SQ18",1,QuadrantMLayerName(chamber), xCenter[0], yCenter[0], posZ, rot2,"ONLY"); - gMC->Gspos("SQ18",2,QuadrantMLayerName(chamber), xCenter[4], yCenter[4], posZ, rot3,"ONLY"); + posZ = kHzOuterFrameEpoxy; + gMC->Gspos("SQ18to24",1,quadrantMLayerName, xCenterAll, yCenterAll, posZ, rot4,"ONLY"); - gMC->Gspos("SQ20",1,QuadrantMLayerName(chamber), xCenter[1], yCenter[1], posZ, rot2,"ONLY"); - gMC->Gspos("SQ20",2,QuadrantMLayerName(chamber), xCenter[5], yCenter[5], posZ, rot3,"ONLY"); - - gMC->Gspos("SQ22",1,QuadrantMLayerName(chamber), xCenter[2], yCenter[2], posZ, rot2,"ONLY"); - gMC->Gspos("SQ22",2,QuadrantMLayerName(chamber), xCenter[6], yCenter[6], posZ, rot3,"ONLY"); - - gMC->Gspos("SQ24",1,QuadrantMLayerName(chamber), xCenter[3], yCenter[3], posZ, rot2,"ONLY"); - gMC->Gspos("SQ24",2,QuadrantMLayerName(chamber), xCenter[7], yCenter[7], posZ, rot3,"ONLY"); - //--- // OutVFrame posX = 2.*kHxInVFrame+kIAF+2.*kHxInHFrame-kHxOutVFrame+2.*kHxV1mm; posY = 2.*kHyInHFrame+kHyOutVFrame; posZ = 0.; - gMC->Gspos("SQ25",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ25",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // keep memory of the mid position. Used for placing screws const GReal_t kMidOVposX = posX; @@ -1900,112 +1636,90 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = kOUTX; posY = kTOPY+((kBl1OCTF+kTl1OCTF)/2.); posZ = 0.; - gMC->Gspos("SQ26",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1,"ONLY"); + // shift to solve overlap with SQ17to23 and SQ18to24 + posX += 0.02; + gMC->Gspos("SQ26",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY"); // VertEarthFaceCu - 2 copies posX = 89.4000+fgkDeltaQuadLHC; posY = 25.79+fgkDeltaQuadLHC; posZ = kHzFrameThickness+2.0*kHzFoam+kHzVertEarthFaceCu; - gMC->Gspos("SQ27",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ27",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ27",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ27",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); // VertEarthSteel - 2 copies posX = 91.00+fgkDeltaQuadLHC; posY = 30.616+fgkDeltaQuadLHC; posZ = kHzFrameThickness+2.0*kHzFoam+kHzVertBarSteel; - gMC->Gspos("SQ28",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ28",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ28",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ28",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); // VertEarthProfCu - 2 copies posX = 92.000+fgkDeltaQuadLHC; posY = 29.64+fgkDeltaQuadLHC; posZ = kHzFrameThickness; - gMC->Gspos("SQ29",1,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ29",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ29",2,QuadrantMLayerName(chamber),posX, posY, posZ, rot1, "ONLY"); + gMC->Gspos("SQ29",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY"); // SuppLateralPositionner - 2 copies posX = 90.2-kNearFarLHC; posY = 5.00-kNearFarLHC; posZ = kHzLateralPosnAl-fgkMotherThick2; - gMC->Gspos("SQ30",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ30",1,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ30",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ30",2,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); // LateralPositionner - 2 copies - Face view posX = 92.175-kNearFarLHC-2.*kHxLPP; posY = 5.00-kNearFarLHC; posZ =2.0*kHzLateralPosnAl+kHzLateralPosnInoxFace-fgkMotherThick2; - gMC->Gspos("SQ31",1,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ31",1,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ31",2,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ31",2,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); // LateralPositionner - Profile view posX = 92.175+fgkDeltaQuadLHC+kHxLPF-kHxLPP; posY = 5.00+fgkDeltaQuadLHC; posZ = 0.; - gMC->Gspos("SQ32",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // middle layer + gMC->Gspos("SQ32",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // middle layer posX = 92.175-kNearFarLHC+kHxLPF-kHxLPP; posY = 5.0000-kNearFarLHC; posZ = fgkMotherThick2-kHzLPNF; - gMC->Gspos("SQ33",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // near layer + gMC->Gspos("SQ33",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); // near layer posZ = -1.*posZ; - gMC->Gspos("SQ33",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // far layer + gMC->Gspos("SQ33",2,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); // far layer -// VertCradleA 1st Trapezoid - 3 copies - posX = 95.73+fgkDeltaQuadLHC; - posY = 33.26+fgkDeltaQuadLHC; - posZ = 0.; - gMC->Gspos("SQ34",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - posX = 95.73-kNearFarLHC; - posY = 33.26-kNearFarLHC; - posZ = 2.0*kHzLateralSightAl+kHzVerticalCradleAl-fgkMotherThick2; - gMC->Gspos("SQ34",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - posZ = -1.0*posZ; - gMC->Gspos("SQ34",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); +// VertCradle - 3 (or 4 ) trapezoids redefined with TGeoXtru shape -// VertCradleB 2nd Trapezoid - 3 copies posX = 97.29+fgkDeltaQuadLHC; posY = 23.02+fgkDeltaQuadLHC; - posZ = 0.; - gMC->Gspos("SQ35",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posZ = 0.; + posX += 1.39311; + gMC->Gspos("SQ34to37",2,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); posX = 97.29-kNearFarLHC; posY = 23.02-kNearFarLHC; posZ = 2.0*kHzLateralSightAl+kHzVerticalCradleAl-fgkMotherThick2; - gMC->Gspos("SQ35",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - posZ = -1.0*posZ; - gMC->Gspos("SQ35",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + posX += 1.39311; + gMC->Gspos("SQ34to36",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); + + posZ = -1.0*posZ; + gMC->Gspos("SQ34to36",3,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); -// OutVertCradleC 3rd Trapeze - 3 copies - posX = 98.31+fgkDeltaQuadLHC; - posY = 12.77+fgkDeltaQuadLHC; - posZ = 0.; - gMC->Gspos("SQ36",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - - posX = 98.05-kNearFarLHC; - posY = 12.77-kNearFarLHC; - posZ = 2.0*kHzLateralSightAl+kHzVerticalCradleAl-fgkMotherThick2; - // Fix (2) of extrusion SQ36 from SQN1, SQN2, SQF1, SQF2 - // (was posX = 98.31 ...) - gMC->Gspos("SQ36",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - posZ = -1.0*posZ; - gMC->Gspos("SQ36",3,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); // OutVertCradleD 4th Trapeze - 3 copies + posX = 98.81+fgkDeltaQuadLHC; posY = 2.52+fgkDeltaQuadLHC; - posZ = 0.; - gMC->Gspos("SQ37",2,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); - posZ = fgkMotherThick1-kHzVerticalCradleAl; - gMC->Gspos("SQ37",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ37",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ37",3,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ37",3,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // LateralSightSupport - 2 copies posX = 98.33-kNearFarLHC; @@ -2013,15 +1727,15 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posZ = kHzLateralSightAl-fgkMotherThick2; // Fix (3) of extrusion SQ38 from SQN1, SQN2, SQF1, SQF2 // (was posX = 98.53 ...) - gMC->Gspos("SQ38",1,QuadrantNLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ38",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); posZ = -1.0*posZ; - gMC->Gspos("SQ38",2,QuadrantFLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ38",2,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); // Mire placement posX = 92.84+fgkDeltaQuadLHC; posY = 8.13+fgkDeltaQuadLHC; posZ = 0.; - gMC->Gspos("SQ39",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0,"ONLY"); + gMC->Gspos("SQ39",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY"); //--- @@ -2029,7 +1743,7 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = 2.0*kHxInVFrame+2.*kHxV1mm+kIAF+kHxInHFrame; posY = kHyInHFrame; posZ = 0.; - gMC->Gspos("SQ40",1,QuadrantMLayerName(chamber),posX, posY, posZ, 0, "ONLY"); + gMC->Gspos("SQ40",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // keep memory of the mid position. Used for placing screws const GReal_t kMidHposX = posX; @@ -2040,13 +1754,13 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = 2.0*kHxInVFrame+2.*kHxV1mm+kIAF+kHxH1mm; posY = 2.0*kHyInHFrame+kHyH1mm; posZ = 0.; - gMC->Gspos("SQ41",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); + gMC->Gspos("SQ41",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY"); // InArcFrame posX = 2.0*kHxInVFrame+2.*kHxV1mm; posY = 2.0*kHyInHFrame+2.*kHyH1mm; posZ = 0.; - gMC->Gspos("SQ42",1,QuadrantMLayerName(chamber),posX, posY, posZ,0, "ONLY"); + gMC->Gspos("SQ42",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY"); // keep memory of the mid position. Used for placing screws const GReal_t kMidArcposX = posX; @@ -2076,10 +1790,10 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = fgkDeltaQuadLHC + scruX[i]; posY = fgkDeltaQuadLHC + scruY[i]; posZ = 0.; - gMC->Gspos("SQ43",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); if (chamber==1) gMC->Gspos("SQ44",i+1,"SQ40",posX+0.1-kMidHposX, posY+0.1-kMidHposY, posZ-kMidHposZ, 0, "ONLY"); - gMC->Gspos("SQ45",i+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ45",i+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); } // special screw coordinates scruX[63] = 16.3; @@ -2087,10 +1801,10 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = fgkDeltaQuadLHC + scruX[63]; posY = fgkDeltaQuadLHC + scruY[63]; posZ = 0.; - gMC->Gspos("SQ43",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ43",64,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); if (chamber==1) gMC->Gspos("SQ44",64,"SQ40",posX+0.1-kMidHposX, posY+0.1-kMidHposY, posZ-kMidHposZ, 0, "ONLY"); - gMC->Gspos("SQ45",64,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ45",64,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); // Screws on the IVEpoxyFrame @@ -2115,10 +1829,10 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = fgkDeltaQuadLHC + scruX[i+lastScrew-1]; posY = fgkDeltaQuadLHC + scruY[i+lastScrew-1]; posZ = 0.; - gMC->Gspos("SQ43",i+lastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+lastScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); if (chamber==1) gMC->Gspos("SQ44",i+lastScrew,"SQ00",posX+0.1-kMidVposX, posY+0.1-kMidVposY, posZ-kMidVposZ, 0, "ONLY"); - gMC->Gspos("SQ45",i+lastScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ45",i+lastScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); } // Screws on the OVEpoxyFrame @@ -2142,11 +1856,11 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = fgkDeltaQuadLHC + scruX[i+firstScrew-1]; posY = fgkDeltaQuadLHC + scruY[i+firstScrew-1]; posZ = 0.; - gMC->Gspos("SQ43",i+firstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+firstScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); // ?? if (chamber==1) gMC->Gspos("SQ44",i+firstScrew,"SQ25",posX+0.1-kMidOVposX, posY+0.1-kMidOVposY, posZ-kMidOVposZ, 0, "ONLY"); - gMC->Gspos("SQ45",i+firstScrew,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ45",i+firstScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); } // special case for 1st screw, inside the horizontal frame (volume 40) posX = fgkDeltaQuadLHC + scruX[firstScrew-1]; @@ -2166,112 +1880,29 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber) posX = fgkDeltaQuadLHC + scruX[i+58]; posY = fgkDeltaQuadLHC + scruY[i+58]; posZ = 0.; - gMC->Gspos("SQ43",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); + gMC->Gspos("SQ43",i+58+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY"); if (chamber==1) gMC->Gspos("SQ44",i+58+1,"SQ42",posX+0.1-kMidArcposX, posY+0.1-kMidArcposY, posZ-kMidArcposZ, 0, "ONLY"); - gMC->Gspos("SQ45",i+58+1,QuadrantMLayerName(chamber),posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); + gMC->Gspos("SQ45",i+58+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY"); } } - //______________________________________________________________________________ void AliMUONSt1GeometryBuilderV2::PlaceInnerLayers(Int_t chamber) { /// Place the gas and copper layers for the specified chamber. -// Rotation Matrices - Int_t rot1, rot2, rot3, rot4; - - fMUON->AliMatrix(rot1, 90., 315., 90., 45., 0., 0.); // -45 deg - fMUON->AliMatrix(rot2, 90., 90., 90., 180., 0., 0.); // 90 deg - fMUON->AliMatrix(rot3, 90., 270., 90., 0., 0., 0.); // -90 deg - fMUON->AliMatrix(rot4, 90., 45., 90., 135., 0., 0.); // deg - - GReal_t x; - GReal_t y; - GReal_t zg = 0.; - GReal_t zc = fgkHzGas + fgkHzPadPlane; - Int_t dpos = (chamber-1)*2; - TString name; - - x = 14.53 + fgkDeltaQuadLHC; - y = 53.34 + fgkDeltaQuadLHC; - name = GasVolumeName("SAG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); - gMC->Gspos("SA1C", 1+dpos, QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); - gMC->Gspos("SA1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); - - x = 40.67 + fgkDeltaQuadLHC; - y = 40.66 + fgkDeltaQuadLHC; - name = GasVolumeName("SBG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot1,"ONLY"); - gMC->Gspos("SB1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot1,"ONLY"); - gMC->Gspos("SB1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,rot1,"ONLY"); - - x = 53.34 + fgkDeltaQuadLHC; - y = 14.52 + fgkDeltaQuadLHC; - name = GasVolumeName("SCG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot2,"ONLY"); - gMC->Gspos("SC1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot2,"ONLY"); - gMC->Gspos("SC1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot2,"ONLY"); - - x = 5.83 + fgkDeltaQuadLHC; - y = 17.29 + fgkDeltaQuadLHC; - name = GasVolumeName("SDG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY"); - gMC->Gspos("SD1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY"); - gMC->Gspos("SD1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY"); - - x = 9.04 + fgkDeltaQuadLHC; - y = 16.91 + fgkDeltaQuadLHC; - name = GasVolumeName("SEG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); - gMC->Gspos("SE1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); - gMC->Gspos("SE1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); - - x = 10.12 + fgkDeltaQuadLHC; - y = 14.67 + fgkDeltaQuadLHC; - name = GasVolumeName("SFG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); - gMC->Gspos("SF1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); - gMC->Gspos("SF1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); - - x = 8.2042 + fgkDeltaQuadLHC; - y = 16.19 + fgkDeltaQuadLHC; - name = GasVolumeName("SGG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); - gMC->Gspos("SG1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); - gMC->Gspos("SG1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); - - x = 14.68 + fgkDeltaQuadLHC; - y = 10.10 + fgkDeltaQuadLHC; - name = GasVolumeName("SHG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); - gMC->Gspos("SH1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); - gMC->Gspos("SH1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); - - x = 16.21 + fgkDeltaQuadLHC; - y = 8.17 + fgkDeltaQuadLHC; - name = GasVolumeName("SIG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot4,"ONLY"); - gMC->Gspos("SI1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot4,"ONLY"); - gMC->Gspos("SI1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot4,"ONLY"); - - x = 16.92 + fgkDeltaQuadLHC; - y = 9.02 + fgkDeltaQuadLHC; - name = GasVolumeName("SJG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,rot3,"ONLY"); - gMC->Gspos("SJ1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,rot3,"ONLY"); - gMC->Gspos("SJ1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,rot3,"ONLY"); - - x = 17.30 + fgkDeltaQuadLHC; - y = 5.85 + fgkDeltaQuadLHC; - name = GasVolumeName("SKG", chamber); - gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); - gMC->Gspos("SK1C", 1+dpos ,QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); - gMC->Gspos("SK1C", 2+dpos ,QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); + GReal_t x = fgkDeltaQuadLHC; + GReal_t y = fgkDeltaQuadLHC; + GReal_t zg = 0.0; + GReal_t zc = fgkHzGas + fgkHzPadPlane; + Int_t dpos = (chamber-1)*2; + + TString name = GasVolumeName("SAG", chamber); + gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY"); + gMC->Gspos("SA1C", 1+dpos, QuadrantMLayerName(chamber),x,y, zc,0,"ONLY"); + gMC->Gspos("SA1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY"); } - //______________________________________________________________________________ void AliMUONSt1GeometryBuilderV2::PlaceSpacer0(Int_t chamber) { @@ -2291,39 +1922,40 @@ void AliMUONSt1GeometryBuilderV2::PlaceSpacer0(Int_t chamber) x = 40.82 - mx; y = 43.04 - my; z = 522.41 - mz; - cout << "spacer05 pos1: " << x << ", " << y << ", " << z << endl; + AliDebugStream(2) << "spacer05 pos1: " << x << ", " << y << ", " << z << endl; gMC->Gspos("Spacer05", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY"); y = 44.54 - my; - cout << "spacer05 pos2: " << x << ", " << y << ", " << z << endl; + AliDebugStream(2) << "spacer05 pos2: " << x << ", " << y << ", " << z << endl; gMC->Gspos("Spacer05", 2, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY"); x = 40.82 - mx; y = 43.79 - my; z = 519.76 - mz; - cout << "spacer06 pos1: " << x << ", " << y << ", " << z << endl; + AliDebugStream(2) << "spacer06 pos1: " << x << ", " << y << ", " << z << endl; gMC->Gspos("Spacer06", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY"); z = 525.06 - mz; - cout << "spacer06 pos2: " << x << ", " << y << ", " << z << endl; + AliDebugStream(2) << "spacer06 pos2: " << x << ", " << y << ", " << z << endl; gMC->Gspos("Spacer06", 2, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY"); x = 40.82 - mx; y = 43.79 - my; z = 522.41 - mz; - cout << "spacer07 pos1: " << x << ", " << y << ", " << z << endl; + AliDebugStream(2) << "spacer07 pos1: " << x << ", " << y << ", " << z << endl; gMC->Gspos("Spacer07", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY"); } //______________________________________________________________________________ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, - SpecialMap specialMap, + TExMap specialMap, const TVector3& where, Bool_t reflectZ, Int_t chamber) { /// Place all the segments in the mother volume, at the position defined -/// by the sector's data. - -/// \cond SKIP +/// by the sector's data. \n +/// The lines with comments COMMENT OUT BEGIN/END indicates blocks +/// which can be commented out in order to reduce the number of volumes +/// in a sector to the plane segments corresponding to regular motifs only. static Int_t segNum=1; Int_t sgn; @@ -2342,14 +1974,8 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, GReal_t posX,posY,posZ; -#ifdef WITH_STL - vector alreadyDone; -#endif - -#ifdef WITH_ROOT TArrayI alreadyDone(20); Int_t nofAlreadyDone = 0; -#endif for (Int_t irow=0;irowGetNofRows();irow++){ // for each row AliMpRow* row = sector->GetRow(irow); @@ -2358,29 +1984,23 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, for (Int_t iseg=0;isegGetNofRowSegments();iseg++){ // for each row segment AliMpVRowSegment* seg = row->GetRowSegment(iseg); -#ifdef WITH_STL - SpecialMap::iterator iter - = specialMap.find(seg->GetMotifPositionId(0)); - - if ( iter == specialMap.end()){ //if this is a normal segment (ie. not part of ) -#endif - -#ifdef WITH_ROOT Long_t value = specialMap.GetValue(seg->GetMotifPositionId(0)); if ( value == 0 ){ //if this is a normal segment (ie. not part of ) -#endif // create the cathode part - CreatePlaneSegment(segNum, seg->Dimensions(), seg->GetNofMotifs()); + CreatePlaneSegment(segNum, TVector2(seg->GetDimensionX(),seg->GetDimensionY()), + seg->GetNofMotifs()); - posX = where.X() + seg->Position().X(); - posY = where.Y() + seg->Position().Y(); + posX = where.X() + seg->GetPositionX(); + posY = where.Y() + seg->GetPositionY(); posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane); gMC->Gspos(PlaneSegmentName(segNum).Data(), 1, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY"); // and place all the daughter boards of this segment + +// COMMENT OUT BEGIN for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) { // Copy number @@ -2391,28 +2011,23 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, if ( sector->GetDirection() == AliMp::kX) copyNo += fgkDaughterCopyNoOffset; // Position - posX = where.X() + motifPos->Position().X() + fgkOffsetX; - posY = where.Y() + motifPos->Position().Y() + fgkOffsetY; + posX = where.X() + motifPos->GetPositionX() + fgkOffsetX; + posY = where.Y() + motifPos->GetPositionY() + fgkOffsetY; posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); - gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY"); } +// COMMENT OUT END + segNum++; } else { +// COMMENT OUT BEGIN // if this is a special segment for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) {// for each motif Int_t motifPosId = seg->GetMotifPositionId(motifNum); -#ifdef WITH_STL - if (find(alreadyDone.begin(),alreadyDone.end(),motifPosId) - != alreadyDone.end()) continue; // don't treat the same motif twice - - AliMUONSt1SpecialMotif spMot = specialMap[motifPosId]; -#endif -#ifdef WITH_ROOT Bool_t isDone = false; Int_t i=0; while (iGetMotifMap()->FindMotifPosition(motifPosId); @@ -2435,32 +2048,38 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector, // place the hole for the motif, wrt the requested rotation angle Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? reflZ:rotMat; - posX = where.X() + motifPos->Position().X() + spMot.GetDelta().X(); - posY = where.Y() + motifPos->Position().Y() + spMot.GetDelta().Y(); + posX = where.X() + motifPos->GetPositionX() + spMot.GetDelta().X(); + posY = where.Y() + motifPos->GetPositionY() + spMot.GetDelta().Y(); posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane); + // Shift the hole for special motif 46 to avoid debording into S047 + if ( copyNo == 2070 ) { + posX -= 0.1; + posY -= 0.1; + } gMC->Gspos(fgkHoleName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); // then place the daughter board for the motif, wrt the requested rotation angle posX = posX+fgkDeltaFilleEtamX; posY = posY+fgkDeltaFilleEtamY; + // Do not shift the daughter board + if ( copyNo == 2070 ) { + posX += 0.1; + posY += 0.1; + } posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); -#ifdef WITH_STL - alreadyDone.push_back(motifPosId);// mark this motif as done -#endif -#ifdef WITH_ROOT if (nofAlreadyDone == alreadyDone.GetSize()) alreadyDone.Set(2*nofAlreadyDone); alreadyDone.AddAt(motifPosId, nofAlreadyDone++); -#endif - // check - // cout << chamber << " processed motifPosId: " << motifPosId << endl; + + AliDebugStream(2) << chamber << " processed motifPosId: " << motifPosId << endl; } +// COMMENT OUT END + }// end of special motif case } } -/// \endcond } //______________________________________________________________________________ @@ -2591,8 +2210,8 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials() GReal_t maxStepAlu = fMUON->GetMaxStepAlu(); GReal_t maxDestepAlu = fMUON->GetMaxDestepAlu(); // GReal_t maxStepGas = fMUON->GetMaxStepGas(); - Int_t iSXFLD = gAlice->Field()->PrecInteg(); - Float_t sXMGMX = gAlice->Field()->Max(); + Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg(); + Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); fMUON->AliMedium(21, "ALU_II$", 41, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin); @@ -2672,10 +2291,10 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() rotm[3] = TGeoRotation("reflYZ", 90., 0., 90.,-90., 180., 0.); TVector3 scale[4]; - scale[0] = TVector3( 1, 1, 1); // quadrant I - scale[1] = TVector3(-1, 1, -1); // quadrant II - scale[2] = TVector3(-1, -1, 1); // quadrant III - scale[3] = TVector3( 1, -1, -1); // quadrant IV + scale[0] = TVector3( 1, 1, -1); // quadrant I + scale[1] = TVector3(-1, 1, 1); // quadrant II + scale[2] = TVector3(-1, -1, -1); // quadrant III + scale[3] = TVector3( 1, -1, 1); // quadrant IV Int_t detElemId[4]; detElemId[0] = 1; // quadrant I @@ -2696,6 +2315,7 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() // Build two chambers // for (Int_t ich=1; ich<3; ich++) { + //for (Int_t ich=1; ich<2; ich++) { // Create quadrant volume CreateQuadrant(ich); @@ -2705,7 +2325,7 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() // Place the quadrant for (Int_t i=0; i<4; i++) { - + //for (Int_t i=1; i<2; i++) { // DE envelope GReal_t posx0, posy0, posz0; posx0 = fgkPadXOffsetBP * scale[i].X(); @@ -2723,6 +2343,9 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() GetEnvelopes(ich-1) ->AddEnvelopeConstituent(QuadrantMLayerName(ich), QuadrantEnvelopeName(ich,i), i+1, TGeoTranslation(posx, posy, posz)); + GetEnvelopes(ich-1) + ->AddEnvelopeConstituent(QuadrantMFLayerName(ich), QuadrantEnvelopeName(ich,i), + i+5, TGeoTranslation(posx, posy, posz)); // Near/far layers GReal_t posx2 = posx + shiftXY;; @@ -2738,7 +2361,7 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() GetEnvelopes(ich-1) ->AddEnvelopeConstituent(QuadrantFLayerName(ich), QuadrantEnvelopeName(ich,i), i+1, TGeoTranslation(posx2, posy2, posz2)); - + // Place spacer in global coordinates in the first non rotated quadrant // if ( detElemId[i] == 0 ) PlaceSpacer0(ich); // !! This placement should be used only to find out the right mother volume @@ -2750,9 +2373,9 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() } //______________________________________________________________________________ -void AliMUONSt1GeometryBuilderV2::SetTransformations() +void AliMUONSt1GeometryBuilderV2::SetVolumes() { -/// Define the transformations for the station2 chambers. +/// Define the volumes for the station2 chambers. if (gAlice->GetModule("SHIL")) { SetMotherVolume(0, "YOUT1"); @@ -2761,6 +2384,12 @@ void AliMUONSt1GeometryBuilderV2::SetTransformations() SetVolume(0, "SC01", true); SetVolume(1, "SC02", true); +} + +//______________________________________________________________________________ +void AliMUONSt1GeometryBuilderV2::SetTransformations() +{ +/// Define the transformations for the station2 chambers. Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(0); SetTranslation(0, TGeoTranslation(0., 0., zpos1)); @@ -2775,27 +2404,6 @@ void AliMUONSt1GeometryBuilderV2::SetSensitiveVolumes() /// Define the sensitive volumes for station2 chambers. GetGeometry(0)->SetSensitiveVolume("SA1G"); - GetGeometry(0)->SetSensitiveVolume("SB1G"); - GetGeometry(0)->SetSensitiveVolume("SC1G"); - GetGeometry(0)->SetSensitiveVolume("SD1G"); - GetGeometry(0)->SetSensitiveVolume("SE1G"); - GetGeometry(0)->SetSensitiveVolume("SF1G"); - GetGeometry(0)->SetSensitiveVolume("SG1G"); - GetGeometry(0)->SetSensitiveVolume("SH1G"); - GetGeometry(0)->SetSensitiveVolume("SI1G"); - GetGeometry(0)->SetSensitiveVolume("SJ1G"); - GetGeometry(0)->SetSensitiveVolume("SK1G"); - GetGeometry(1)->SetSensitiveVolume("SA2G"); - GetGeometry(1)->SetSensitiveVolume("SB2G"); - GetGeometry(1)->SetSensitiveVolume("SC2G"); - GetGeometry(1)->SetSensitiveVolume("SD2G"); - GetGeometry(1)->SetSensitiveVolume("SE2G"); - GetGeometry(1)->SetSensitiveVolume("SF2G"); - GetGeometry(1)->SetSensitiveVolume("SG2G"); - GetGeometry(1)->SetSensitiveVolume("SH2G"); - GetGeometry(1)->SetSensitiveVolume("SI2G"); - GetGeometry(1)->SetSensitiveVolume("SJ2G"); - GetGeometry(1)->SetSensitiveVolume("SK2G"); }