X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONSt1GeometryBuilderV2.cxx;h=5885f66a23c26fa37416b62fc2ae9598ea1eff0a;hb=44ce6bbe7bd3d0907578777227bea6e8db483261;hp=d60b4390973837e67cd6ace724ec13a217ad1a3f;hpb=d1cd2474744c42fa946c19043eaf56b406342512;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONSt1GeometryBuilderV2.cxx b/MUON/AliMUONSt1GeometryBuilderV2.cxx index d60b4390973..5885f66a23c 100644 --- a/MUON/AliMUONSt1GeometryBuilderV2.cxx +++ b/MUON/AliMUONSt1GeometryBuilderV2.cxx @@ -15,11 +15,13 @@ // $Id$ // +// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay +// // Class AliMUONSt1GeometryBuilderV2 // --------------------------------- // MUON Station1 detailed geometry construction class. -// -// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay +// (Originally defined in AliMUONv2.cxx - now removed.) +// Included in AliRoot 2004/01/23 #ifdef ST1_WITH_STL #include @@ -45,14 +47,16 @@ #include "AliMpMotifMap.h" #include "AliMpMotifPosition.h" +#include "AliRun.h" +#include "AliMagF.h" +#include "AliLog.h" + #include "AliMUONSt1GeometryBuilderV2.h" #include "AliMUONSt1SpecialMotif.h" #include "AliMUON.h" #include "AliMUONChamber.h" -#include "AliMUONChamberGeometry.h" -#include "AliMUONConstants.h" -#include "AliRun.h" -#include "AliMagF.h" +#include "AliMUONGeometryModule.h" +#include "AliMUONGeometryEnvelopeStore.h" ClassImp(AliMUONSt1GeometryBuilderV2) @@ -106,10 +110,13 @@ const char AliMUONSt1GeometryBuilderV2::fgkFoamLayerSuffix='F'; // prefix for const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM"; const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN"; const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF"; +const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000; //______________________________________________________________________________ AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon) - : AliMUONVGeometryBuilder(&muon->Chamber(0), &muon->Chamber(1)), + : AliMUONVGeometryBuilder("st1V2.dat", + muon->Chamber(0).GetGeometry(), + muon->Chamber(1).GetGeometry()), fMUON(muon) { // set path to mapping data files @@ -139,8 +146,7 @@ AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(const AliMUONSt1Geometr { // Dummy copy constructor - Fatal("Copy constructor", - "Copy constructor is not implemented."); + AliFatal("Copy constructor is not implemented."); } //______________________________________________________________________________ @@ -157,8 +163,7 @@ AliMUONSt1GeometryBuilderV2::operator = (const AliMUONSt1GeometryBuilderV2& rhs) // check assignement to self if (this == &rhs) return *this; - Fatal("operator=", - "Assignment operator is not implemented."); + AliFatal("Assignment operator is not implemented."); return *this; } @@ -481,16 +486,16 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber) #ifdef ST1_WITH_STL SpecialMap specialMap; - specialMap[1001] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.); - specialMap[1002] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36)); - specialMap[1003] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)); + 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 #ifdef ST1_WITH_ROOT SpecialMap specialMap; - specialMap.Add(1001, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.)); - specialMap.Add(1002, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36))); - specialMap.Add(1003, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36))); + 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))); + specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36))); #endif AliMpReader reader1(kStation1, kBendingPlane); @@ -502,22 +507,22 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber) #ifdef ST1_WITH_STL specialMap.clear(); - specialMap[4001] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.); - specialMap[4002] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)); - specialMap[4003] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)); - specialMap[4004] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)); - specialMap[4005] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)); - specialMap[4006] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)); + specialMap[76] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.); + specialMap[75] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)); + specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)); + specialMap[20] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)); + specialMap[46] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)); + specialMap[74] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)); #endif #ifdef ST1_WITH_ROOT specialMap.Delete(); - specialMap.Add(4001,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.)); - specialMap.Add(4002,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17))); - specialMap.Add(4003,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18))); - specialMap.Add(4004,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08))); - specialMap.Add(4005,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25))); - specialMap.Add(4006,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21))); + specialMap.Add(76,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.)); + specialMap.Add(75,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17))); + specialMap.Add(47,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18))); + specialMap.Add(20,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08))); + specialMap.Add(46,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25))); + specialMap.Add(74,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21))); #endif AliMpReader reader2(kStation1, kNonBendingPlane); @@ -2132,14 +2137,20 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(AliMpSector* sector,SpecialMap spe // and place all the daughter boards of this segment for (Int_t motifNum=0;motifNumGetNofMotifs();motifNum++) { + + // Copy number Int_t motifPosId = seg->GetMotifPositionId(motifNum); AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId); + Int_t copyNo = motifPosId; + if ( sector->GetDirection() == kX) copyNo += fgkDaughterCopyNoOffset; + // Position posX = where.X() + motifPos->Position().X()/10.+fgkOffsetX; posY = where.Y() + motifPos->Position().Y()/10.+fgkOffsetY; posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); - gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY"); + + gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY"); } segNum++; @@ -2172,19 +2183,23 @@ void AliMUONSt1GeometryBuilderV2::PlaceSector(AliMpSector* sector,SpecialMap spe AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId); + // Copy number + Int_t copyNo = motifPosId; + if ( sector->GetDirection() == kX) copyNo += fgkDaughterCopyNoOffset; + // 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()/10.+spMot.GetDelta().X(); posY = where.Y() + motifPos->Position().Y()/10.+spMot.GetDelta().Y(); posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane); - gMC->Gspos(fgkHoleName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); + 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; posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter()); - gMC->Gspos(fgkDaughterName, motifPosId, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); + gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY"); #ifdef ST1_WITH_STL alreadyDone.push_back(motifPosId);// mark this motif as done @@ -2298,18 +2313,6 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials() // was id: 9 // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18 // ??? same but the last but one argument < 0 - - fMUON->AliMaterial(42, "Copper$", 63.546,29.,8.96,-1.43,9.6); - // was id: 30 - - fMUON->AliMaterial(43, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.); // from DPG - // was id: 31 - - fMUON->AliMaterial(44, "FrameEpoxy",12.24,6.0,1.85,-19.14,999);// use 16.75cm - // was id: 36 - // Density of FrameEpoxy only from manufacturer's specifications - // Frame composite epoxy , X0 in g/cm**2 (guestimation!) - // // --- Define mixtures for GEANT --- // @@ -2351,7 +2354,6 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials() // Not used, to be removed // - fMUON->AliMaterial(49, "Kapton$", 12.01,6,1.42,-28.6,999); // from DPG // was id: 34 // Inox/Stainless Steel (18%Cr, 9%Ni) @@ -2383,12 +2385,7 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials() fMUON->AliMedium(21, "ALU_II$", 41, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin); - // was med: 4 mat: 9 - fMUON->AliMedium(22, "COPPER_II$", 42, 0, iSXFLD, sXMGMX, - tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin); - // was med: 10 mat: 30 - fMUON->AliMedium(23, "FR4_CH$", 43, 0, iSXFLD, sXMGMX, - 10.0, 0.01, 0.1, 0.003, 0.003); + // was med: 15 mat: 31 fMUON->AliMedium(24, "FrameCH$", 44, 1, iSXFLD, sXMGMX, 10.0, 0.001, 0.001, 0.001, 0.001); @@ -2408,9 +2405,7 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials() // Not used, to be romoved // - fMUON->AliMedium(29, "Kapton$", 49, 0, iSXFLD, sXMGMX, - 10.0, 0.01, 1.0, 0.003, 0.003); - // was med: 18 mat: 34 + fMUON->AliMedium(30, "InoxBolts$", 50, 1, iSXFLD, sXMGMX, 10.0, 0.01, 1.0, 0.003, 0.003); // was med: 21 mat: 37 @@ -2423,8 +2418,7 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() { // Create the detailed GEANT geometry for the dimuon arm station1 // -- - cout << "AliMUONSt1GeometryBuilderV2::CreateGeometry()" << endl; - cout << "_________________________________________" << endl; + AliDebug(1,"Called"); // Create basic volumes // @@ -2441,11 +2435,15 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() fMUON->AliMatrix(reflXY, 90., 180., 90., 270., 0., 0.); */ // Define transformations for each quadrant + // In old coordinate system: In new coordinate system: // - // II. | I. - // _____ | ____ - // | - // III. | IV. + // + // II. | I. I. | II. + // | (151) | (100) + // _____ | ____ _____ | ____ + // | | + // III. | IV. IV. | III. + // (150) | (101) // /* Int_t rotm[4]; @@ -2466,6 +2464,12 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() scale[2] = TVector3(-1, -1, 1); // quadrant III scale[3] = TVector3( 1, -1, -1); // quadrant IV + Int_t detElemId[4]; + detElemId[0] = 51; // quadrant I + detElemId[1] = 0; // quadrant II + detElemId[2] = 1; // quadrant III + detElemId[3] = 50; // quadrant IV + // Shift in Z of the middle layer Double_t deltaZ = 6.5/2.; @@ -2490,26 +2494,28 @@ void AliMUONSt1GeometryBuilderV2::CreateGeometry() for (Int_t i=0; i<4; i++) { // Middle layer - GReal_t posx = pos0.X() * scale[i].X(); - GReal_t posy = pos0.Y() * scale[i].Y(); - //GReal_t posz = pos0.Z() * scale[i].Z() + AliMUONConstants::DefaultChamberZ(ich-1); + GReal_t posx, posy, posz; + posx = pos0.X() * scale[i].X(); + posy = pos0.Y() * scale[i].Y(); + //posz = pos0.Z() * scale[i].Z() + AliMUONConstants::DefaultChamberZ(ich-1); //gMC->Gspos(QuadrantMLayerName(ich), i+1, "ALIC", posx, posy, posz, rotm[i], "ONLY"); - GReal_t posz = pos0.Z() * scale[i].Z(); - GetChamber(ich-1)->GetGeometry() - ->AddEnvelope(QuadrantMLayerName(ich), i+1, TGeoTranslation(posx, posy, posz), rotm[i]); + posz = pos0.Z() * scale[i].Z(); + GetEnvelopes(ich-1) + ->AddEnvelope(QuadrantMLayerName(ich), detElemId[i] + ich*100, i+1, + TGeoTranslation(posx, posy, posz), rotm[i]); // Near/far layers Real_t posx2 = posx + shiftXY * scale[i].X(); Real_t posy2 = posy + shiftXY * scale[i].Y(); Real_t posz2 = posz - scale[i].Z()*shiftZ; //gMC->Gspos(QuadrantNLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY"); - GetChamber(ich-1)->GetGeometry() - ->AddEnvelope(QuadrantNLayerName(ich), i+1, TGeoTranslation(posx2, posy2, posz2), rotm[i]); + GetEnvelopes(ich-1) + ->AddEnvelope(QuadrantNLayerName(ich), 0, i+1, TGeoTranslation(posx2, posy2, posz2), rotm[i]); posz2 = posz + scale[i].Z()*shiftZ; //gMC->Gspos(QuadrantFLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY"); - GetChamber(ich-1)->GetGeometry() - ->AddEnvelope(QuadrantFLayerName(ich), i+1, TGeoTranslation(posx2, posy2, posz2), rotm[i]); + GetEnvelopes(ich-1) + ->AddEnvelope(QuadrantFLayerName(ich), 0, i+1, TGeoTranslation(posx2, posy2, posz2), rotm[i]); } } } @@ -2520,12 +2526,12 @@ void AliMUONSt1GeometryBuilderV2::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = GetChamber(0); + AliMUONChamber* iChamber1 = &fMUON->Chamber(0); Double_t zpos1 = - iChamber1->Z(); iChamber1->GetGeometry() ->SetTranslation(TGeoTranslation(0., 0., zpos1)); - AliMUONChamber* iChamber2 = GetChamber(1); + AliMUONChamber* iChamber2 = &fMUON->Chamber(1); Double_t zpos2 = - iChamber2->Z(); iChamber2->GetGeometry() ->SetTranslation(TGeoTranslation(0., 0., zpos2)); @@ -2537,28 +2543,28 @@ void AliMUONSt1GeometryBuilderV2::SetSensitiveVolumes() // Defines the sensitive volumes for station2 chambers. // --- - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SA1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SB1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SC1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SD1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SE1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SF1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SG1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SH1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SI1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SJ1G"); - GetChamber(0)->GetGeometry()->SetSensitiveVolume("SK1G"); + 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"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SA2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SB2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SC2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SD2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SE2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SF2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SG2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SH2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SI2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SJ2G"); - GetChamber(1)->GetGeometry()->SetSensitiveVolume("SK2G"); + 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"); }