]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes for G4 (Thanks Andrea).
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 May 2007 17:02:22 +0000 (17:02 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 May 2007 17:02:22 +0000 (17:02 +0000)
FMD/AliFMD.cxx
FMD/AliFMDGeometry.h

index 314b31b7020bc98a5de5c339fdc7b2cef1a8a9a4..98e5fa9b1b837ee1b90e450c3737f58d35ee5f02 100644 (file)
@@ -93,7 +93,7 @@
 #include <TTUBE.h>             // ROOT_TTUBE
 #include <TTree.h>             // ROOT_TTree
 #include <TBrowser.h>          // ROOT_TBrowser
-// #include <TVirtualMC.h>     // ROOT_TVirtualMC
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
 #include <TVector2.h>           // ROOT_TVector2 
 #include <TGeoManager.h>        // ROOT_TGeoManager
 
@@ -420,7 +420,21 @@ AliFMD::Init()
   // Initialize the detector 
   // 
   AliFMDDebug(1, ("Initialising FMD detector object"));
-  // AliFMDGeometry*  fmd = AliFMDGeometry::Instance();
+  TVirtualMC*      mc     = TVirtualMC::GetMC();
+  AliFMDGeometry*  fmd    = AliFMDGeometry::Instance();
+  const TArrayI&   actGeo = fmd->ActiveIds();
+  TArrayI          actVmc(actGeo.fN);
+  for (Int_t i = 0; i < actGeo.fN; i++) {
+    TGeoVolume *sens = gGeoManager->GetVolume(actGeo[i]);
+    if (!sens) {
+      AliError(Form("No TGeo volume for sensitive volume ID=%d",actGeo[i]));
+      continue;
+    }   
+    actVmc[i] = mc->VolId(sens->GetName());
+    AliFMDDebug(1, ("Active vol id # %d: %d changed to %d", 
+                   i, actGeo[i], actVmc[i]));
+  }
+  fmd->SetActive(actVmc.fArray, actVmc.fN);
   // fmd->InitTransformations();
 }
 
index 8a41c9a152c9318316739fbb605f6b20c04779ba..089e4c9e7617a0577619c44b7c33a699c31f0a8e 100644 (file)
@@ -176,6 +176,9 @@ public:
   void   SetActive(Int_t* active, Int_t n);
   /** @param id Register volume @a id to be active */
   void   AddActive(Int_t id);
+  /** Get Array of active volume numbers 
+      @return constant reference to active volume numbers */ 
+  const TArrayI& ActiveIds() const { return fActive; }
   /** Set an external geometry builder
       @param b Geometry builder */
   void   SetBuilder(AliFMDGeometryBuilder* b) { fBuilder = b; }