AddAlignableVolumes() method added for EMCAL
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Oct 2006 19:16:47 +0000 (19:16 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Oct 2006 19:16:47 +0000 (19:16 +0000)
EMCAL/AliEMCALv0.cxx
EMCAL/AliEMCALv0.h

index 16831609b1073d6136cff440b314d62e033ad837..b379d660cedd7a78807ea884fee02470db854630 100644 (file)
@@ -1220,3 +1220,52 @@ AliEMCALShishKebabTrd1Module* AliEMCALv0::GetShishKebabModule(Int_t neta)
   }
   return trd1;
 }
+
+//_____________________________________________________________________________
+void AliEMCALv0::AddAlignableVolumes() const
+{
+  //
+  // Create entries for alignable volumes associating the symbolic volume
+  // name with the corresponding volume path. Needs to be synchronized with
+  // eventual changes in the geometry.
+  //
+
+  TString vpstr1 = "ALIC_1/XEN1_1/SMOD_";
+  TString snstr1 = "EMCAL/FullSupermodule";
+  TString volpath, symname;
+
+  //Int_t nSMod = ((AliEMCALGeometry*)GetGeometry())->GetNumberOfSuperModules();
+  //could use this, but what happens if it is > 10?
+
+  try{
+    for (Int_t smodnum=0; smodnum < 10; smodnum++) {
+      symname = snstr1;
+      symname += (smodnum+1);
+      volpath = vpstr1;
+      volpath += (smodnum+1);
+      gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data());
+    }
+  } catch (TString) {
+    AliFatal("Trying to set alignable entry with open geometry");
+  }
+
+  TString gn( ((AliEMCALGeometry*)GetGeometry())->GetName() );
+  gn.ToUpper();
+  if(gn.Contains("110DEG")) {
+    TString vpstr2 = "ALIC_1/XEN1_1/SM10_";
+    TString snstr2 = "EMCAL/HalfSupermodule";    
+    try{
+      for (Int_t smodnum=0; smodnum < 2; smodnum++) {
+       symname = snstr2;
+       symname += (smodnum+1);
+       volpath = vpstr2;
+       volpath += (smodnum+1);
+       gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data());
+      }
+    } catch (TString) {
+      AliFatal("Trying to set alignable entry with open geometry");
+    }
+  }
+
+}
+
index b4d765f120e95e16d239dc8e34b3eb6bb92f610b..d2f84e0b241653d23938b8e6e28112ac6c0f1d1f 100644 (file)
@@ -21,6 +21,7 @@ class AliEMCALShishKebabTrd1Module;
 
 // --- AliRoot header files ---
 #include "AliEMCAL.h"
+#include "TGeoManager.h"
 #include <TArrayF.h>
 //class AliEMCALGeometry ; 
 
@@ -42,6 +43,8 @@ class AliEMCALv0 : public AliEMCAL {
  
   using AliEMCAL::AddHit;
 
+  virtual void  AddAlignableVolumes() const;
+
   virtual void BuildGeometry();// creates the geometry for the ROOT display
   TNode *BuildGeometryOfWSUC();  // WSUC - test environment
   virtual void CreateGeometry() ;// creates the geometry for GEANT