#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
// 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();
}
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; }