]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerGeometryBuilder.cxx
Pass detElemId to enevelopes (working week effort)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerGeometryBuilder.cxx
index 34e2ae2c8836fe8bbea459bce30690b191cf2b17..3eaa2bf98b34740de539f385cd8bac3665944065 100644 (file)
@@ -1,3 +1,18 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
 // $Id$
 //
 // Class AliMUONTriggerGeometryBuilder
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
+#include "AliMUONGeometryEnvelopeStore.h"
 
 ClassImp(AliMUONTriggerGeometryBuilder)
 
 //______________________________________________________________________________
 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
- : AliMUONVGeometryBuilder(&muon->Chamber(10), &muon->Chamber(11),&muon->Chamber(12),&muon->Chamber(13)),
+ : AliMUONVGeometryBuilder("trigger.dat",
+                           &muon->Chamber(10), &muon->Chamber(11),
+                           &muon->Chamber(12),&muon->Chamber(13)),
    fMUON(muon)
 {
 // Standard constructor
@@ -38,6 +56,8 @@ AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder()
 AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(const AliMUONTriggerGeometryBuilder& rhs)
   : AliMUONVGeometryBuilder(rhs)
 {
+// Protected copy constructor
+
   Fatal("Copy constructor", 
         "Copy constructor is not implemented.");
 }
@@ -51,6 +71,8 @@ AliMUONTriggerGeometryBuilder::~AliMUONTriggerGeometryBuilder() {
 AliMUONTriggerGeometryBuilder& 
 AliMUONTriggerGeometryBuilder::operator = (const AliMUONTriggerGeometryBuilder& rhs) 
 {
+// Protected assignement operator
+
   // check assignement to self
   if (this == &rhs) return *this;
 
@@ -82,6 +104,7 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
     Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
     Int_t idAir= idtmed[1100]; // medium 1
     Int_t idAlu1=idtmed[1103]; // medium 4
+    Int_t detElemId=0;          // Detection Element Number    
     Float_t tpar[3];
     Double_t dpar[3];    
     
@@ -90,9 +113,10 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
 // main distances for chamber definition in first plane/first station
     const Float_t kXMIN=34.;       
     const Float_t kXMED=51.;                                
-    const Float_t kXMAX=272.; 
-// kXMAX will become 255. in real life. segmentation to be updated accordingly
+    const Float_t kXMAX=255.; 
+// 090704 kXMAX changed from 272 to 255.
 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
+// segmentation updated accordingly
     const Float_t kYMIN=34.;                              
     const Float_t kYMAX=51.;                              
 // inner/outer radius of flange between beam shield. and chambers (1/station)
@@ -131,7 +155,8 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3);     // Al
             // changed by ivana
            //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
-           iChamber->GetGeometry()->AddEnvelope(volFlange, false, "MANY");
+           iChamber->GetGeometry()->GetEnvelopeStore()
+             ->AddEnvelope(volFlange, 0, false, "MANY");
            
 // scaling factor
            Float_t zRatio = zpos / zpos1;
@@ -146,9 +171,9 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
                    tpar[0] = (kXMAX/2.) * zRatio;
                    if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
                    if (icolumn==0) 
-                       sprintf(volEnv[i],"S%dL%d",icount,iline);
-                   else
                        sprintf(volEnv[i],"S%dR%d",icount,iline);
+                   else
+                       sprintf(volEnv[i],"S%dL%d",icount,iline);
                    gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0); 
                    i++;
                }
@@ -186,11 +211,13 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
            dpar[1] = kYMIN * zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[4], true, TGeoTranslation(xEnv,yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[13], true, TGeoTranslation(-xEnv,yEnvP,kZp));
+           detElemId = (10+icount+1)*100+4;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvM,kZm));
+           detElemId = (10+icount+1)*100+50+4;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvP,kZp));
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);         
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);      
 
 // chamber type B (plus envelope chambers B & C)   
            xEnv = (kDXZERO+kXMAX/2.)*zRatio;
@@ -203,15 +230,19 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            xpos = kXMIN/2. * zRatio;
            ypos = (kYMIN - kYMIN/4.) * zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[3], true, TGeoTranslation( xEnv,-yEnvP,kZp));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[5], true, TGeoTranslation( xEnv, yEnvP,kZp));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[12], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[14], true, TGeoTranslation(-xEnv, yEnvM,kZm));
+           detElemId = (10+icount+1)*100+3;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvP,kZp));
+           detElemId = (10+icount+1)*100+5;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvP,kZp));
+           detElemId = (10+icount+1)*100+50+3;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm));
+           detElemId = (10+icount+1)*100+50+5;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm));
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
 
 // chamber type C (note: same Z than type B)
            dpar[0] = (kXMAX/2)*zRatio;
@@ -219,10 +250,10 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            xpos = 0.;      
            ypos = ((kYMAX - kYMIN)/2.) * zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
     
 // chamber type D, E and F (same size)
 // D       
@@ -233,15 +264,19 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            dpar[0] = (kXMAX/2.)*zRatio;
            dpar[1] =  kYMIN*zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[2], true, TGeoTranslation(xEnv, yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[6], true, TGeoTranslation(-xEnv, yEnvP,kZp));          
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[11], true, TGeoTranslation(xEnv,-yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[15], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
+           detElemId = (10+icount+1)*100+2;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
+           detElemId = (10+icount+1)*100+6;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
+           detElemId = (10+icount+1)*100+50+2;
+            GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp));
+           detElemId = (10+icount+1)*100+50+6;
+            GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp));
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
 
 // E
            yEnvPsave = yEnvP;
@@ -249,15 +284,19 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
            yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[1], true, TGeoTranslation(xEnv, yEnvP,kZp));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[7], true, TGeoTranslation(-xEnv, yEnvM,kZm));          
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[10], true, TGeoTranslation(xEnv,-yEnvP,kZp));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[16], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
+           detElemId = (10+icount+1)*100+1;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
+           detElemId = (10+icount+1)*100+7;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
+           detElemId = (10+icount+1)*100+50+1;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm));
+           detElemId = (10+icount+1)*100+50+7;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm));
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
 
 
 // F
@@ -266,15 +305,19 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
            yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
 
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[0], true, TGeoTranslation(xEnv, yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[8], true, TGeoTranslation(-xEnv, yEnvP,kZp));          
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[9], true, TGeoTranslation(xEnv,-yEnvM,kZm));
-           GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[17], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
-
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
-           GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
+           detElemId = (10+icount+1)*100;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
+           detElemId = (10+icount+1)*100+8;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
+           detElemId = (10+icount+1)*100+50;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp));
+           detElemId = (10+icount+1)*100+50+8;
+           GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp));
+           
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
+           GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
 
        } // end loop on detection planes
     } // end loop on stations