AliFMDDebug(1, ("Initialising FMD detector object"));
TVirtualMC* mc = TVirtualMC::GetMC();
AliFMDGeometry* fmd = AliFMDGeometry::Instance();
- const TArrayI& actGeo = fmd->ActiveIds();
+ TArrayI actGeo = fmd->ActiveIds();
+ bool valid = true;
+ if (actGeo.fN <= 0) valid = false;
+ else {
+ for (int i = 0; i < actGeo.fN; i++) {
+ if (actGeo[i] < 0) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ if (!valid) {
+ AliFMDDebug(1, ("Extracting geometry info from loaded geometry"));
+ fmd->ExtractGeomInfo();
+ actGeo = fmd->ActiveIds();
+ }
TArrayI actVmc(actGeo.fN);
for (Int_t i = 0; i < actGeo.fN; i++) {
+ if (actGeo[i] < 0) {
+ AliError(Form("Invalid id: %d", actGeo[i]));
+ continue;
+ }
TGeoVolume *sens = gGeoManager->GetVolume(actGeo[i]);
if (!sens) {
AliError(Form("No TGeo volume for sensitive volume ID=%d",actGeo[i]));
// and so on - that is, all the geometric information we need for
// futher processing, such as simulation, digitization,
// reconstruction, etc.
- Int_t detectorDepth = FindNodeDepth("FMD1_1", "ALIC");
- Int_t ringDepth = FindNodeDepth(Form("FMDI_%d", Int_t('I')), "ALIC");
- Int_t moduleDepth = FindNodeDepth("FIFV_0", "ALIC");
- Int_t sectorDepth = FindNodeDepth("FISE_1", "ALIC");
+ Int_t detectorDepth = FindNodeDepth("F1MT_1", "ALIC");
+ Int_t ringDepth = FindNodeDepth(Form("FITV_%d", int('I')), "ALIC");
+ Int_t moduleDepth = FindNodeDepth("FIBH_0", "ALIC");
+ Int_t sectorDepth = FindNodeDepth("FISC_1", "ALIC");
+ fActive.Set(0);
fActive.Reset(-1);
AliFMDDebug(1, ("Geometry depths:\n"
" Sector: %d\n"
std::cerr << "No top volume defined" << std::endl;
return -1;
}
+
+ TGeoIterator next(vol);
+ TGeoNode* node = 0;
+ TString sName(name);
+ while ((node = next())) {
+ // std::cout << "Checking node " << node->GetName() << std::endl;
+ if (sName == node->GetName()) {
+ std::cout << "Found node " << node->GetName() << " at level "
+ << next.GetLevel() << std::endl;
+ return next.GetLevel();
+ }
+ }
+ return -1;
+#if 0
TObjArray* nodes = vol->GetNodes();
if (!nodes) {
std::cerr << "No nodes in top volume" << std::endl;
while ((node = static_cast<TGeoNode*>(next())))
if (CheckNodes(node, name, lvl) >= 0) return lvl;
return -1;
+#endif
}
//____________________________________________________________________