]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Applied patch from Raffaele to set symbolic names for the alignable
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 11 Nov 2006 12:28:44 +0000 (12:28 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 11 Nov 2006 12:28:44 +0000 (12:28 +0000)
FMD volumes.  Raffaele wrote:

   Could you apply and commit the attached path? It is intended to be
   temporary and to be fixed later by you but in the meantime, setting the
   symbolic names for the 76 FMD alignable volumes as equal to the volume
   paths, it avoids the warnings and hopefully it could make it easier
   (and thus faster :)) for you to assign the proper symbolic names; at that
   point I can also produce the zero misalignment objects for FMD so we
   could accelerate the solution of this issue.

Note that I've modified the code a bit - it was too heavy.  Also note, that
this code should be considered temporary - when I have time to wrap my
head around these symbolic name issues, I'll make some better names.
Actually, it should really be a job for the AliFMD[1,2,3] and AliFMDRing
classes to setup these things - probably via the AliFMDGeometry class.

Anyway, this should make Raffaele happy for now.

FMD/AliFMD.cxx
FMD/AliFMD.h

index 6c4a2875f2fd10dbe538005f2c6f34f9894c5fff..2d699decb1660e66ac71b0ffddeada451ad46ee3 100644 (file)
@@ -95,6 +95,7 @@
 #include <TBrowser.h>          // ROOT_TBrowser
 // #include <TVirtualMC.h>     // ROOT_TVirtualMC
 #include <TVector2.h>           // ROOT_TVector2 
+#include <TGeoManager.h>        // ROOT_TGeoManager
 
 #include <AliRunDigitizer.h>   // ALIRUNDIGITIZER_H
 #include <AliLoader.h>         // ALILOADER_H
@@ -1098,6 +1099,50 @@ AliFMD::Browse(TBrowser* b)
   b->Add(AliFMDGeometry::Instance());
 }
 
+//____________________________________________________________________ 
+void
+AliFMD::AddAlignableVolumes() const
+{
+  //
+  // Create entries for alignable volumes associating the symbolic volume
+  // name with the corresponding volume path. Needs to be syncronized with
+  // eventual changes in the geometry.
+  // 
+  // This code was made by Raffaele Grosso <rgrosso@mail.cern.ch>.  I
+  // (cholm) will probably want to change it.   For one, I think it
+  // should be the job of the geometry manager to deal with this. 
+  for(size_t f = 1; f <= 3; f++){ // Detector 1,2,3
+    for(size_t tb =  0; tb <2 ; tb++){ // Top/Bottom 
+      char     stb = tb == 0 ? 'T' : 'B';
+      unsigned min = tb == 0 ? 0   : 5;
+
+      TString halfVol(Form("/ALIC/F%dM%c_%d", f, stb, f));
+      TString halfSym(halfVol);
+      if(!gGeoManager->SetAlignableEntry(halfSym.Data(),halfVol.Data()))
+       AliFatal(Form("Alignable entry %s not created. "
+                     "Volume path %s not valid", 
+                     halfSym.Data(),halfVol.Data()));
+      for(size_t io = 0; io < 2; io++){ // inner, outer 
+       if (f==1 && io==1) continue; // Only one ring in FMD1 
+       min          = (tb == 1 ? 10 : min);
+       char     sio = (io == 0 ? 'I' : '0');
+       unsigned nio = (io == 0 ? 3   : 9);
+       unsigned max = (io == 0 ? 5   : 10) + min;
+       
+       for(size_t i = min; i < max; i++) { // Modules
+         TString modVol(Form("%s/F%c%cV_7%d/F%cSE_%d", halfVol.Data(), 
+                             sio, stb, nio, sio, i));
+         TString modSym(modVol);
+         if(!gGeoManager->SetAlignableEntry(modSym.Data(),modVol.Data()))
+           AliFatal(Form("Alignable entry %s not created. "
+                         "Volume path %s not valid", 
+                         modSym.Data(), modVol.Data()));
+       }
+      }
+    }
+  }
+
+}
 //___________________________________________________________________
 //
 // EOF
index 513ef90b784cd80c4b6e5bbb17174671c17c83be..8774809af3d823883a13f35ec0703f7256d0119e 100644 (file)
@@ -307,6 +307,10 @@ public:
       AliFMDGeometry to construct the geometry.  This in turn calls
       AliFMDGeometryBuilder.   */
   virtual void   CreateGeometry();
+  /** Create entries for alignable volumes associating the symbolic volume
+      name with the corresponding volume path. Needs to be syncronized with
+      eventual changes in the geometry.   */
+  virtual void  AddAlignableVolumes() const;
   /** Create the tracking mediums used by the FMD.  This associates
       the tracking mediums defined with the FMD in the
       TVirtualMCApplication (AliMC).