TEveGeoNode* descend_extract(TGeoNode* node) { // We only return something if: // - this is a node of interest; // - one of the daughters returns something of interest. const TString material("Silicon"); TEveGeoNode *res = 0; TRegexp endcap_layers_RE = "SI0[5-9]"; TRegexp endcap_layers_RE_2 = "SI1[0-9]"; TGeoMedium *medium = node->GetVolume()->GetMedium(); if (medium && material == medium->GetName()) { node->GetVolume()->SetTransparency(90); medium->GetMaterial()->SetTransparency(90); // Node of interest - instantiate eve representation and return. res = new TEveGeoNode(node); res->SetMainTransparency(60); return res; } Int_t nd = node->GetNdaughters(); for (Int_t i = 0; i < nd; ++i) { if (TString(node->GetDaughter(i)->GetName()).Contains(endcap_layers_RE) || TString(node->GetDaughter(i)->GetName()).Contains(endcap_layers_RE_2)) { continue; } TEveGeoNode *ed = descend_extract(node->GetDaughter(i)); if (ed) { if (res == 0) res = new TEveGeoNode(node); res->SetMainTransparency(60); res->AddElement(ed); } } return res; }