void PNodeTest() { // Test physical nodes visualization // // Creating physical nodes: // 1. TGeoPhysicalNode *node = gGeoManager->MakePhysicalNode(const char *path) // - creates a physical node represented by path // 2. TGeoPhysicalNode *node = gGeoManager->MakePhysicalNode() // - creates a physical node representing the current modeller state // Setting visualisation options for TGeoPhysicalNode *node: // 1. node->SetVisibility(Bool_t flag); // set node visible(*) or invisible // 2. node->SetIsVolAtt(Bool_t flag); // set line attributes to match the ones of the volumes in the branch // - default - TRUE // - when called with FALSE - the attributes defined for the physical node will be taken // node->SetLineColor(color); // node->SetLineWidth(width); // node->SetLineStyle(style); // 3. node->SetVisibleFull(Bool_t flag); // not only last node in the branch is visible (default) // // Activating/desactivating physical nodes drawing // gGeoManager->SetDrawExtraPaths(Bool_t flag) gROOT->LoadMacro("$ROOTSYS/tutorials/rootgeom.C"); gInterpreter->ProcessLine("rootgeom()"); TGeoPhysicalNode *node; // Draw an "R" with different line settings node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_2/ROOT_3/R_1/bar1_1"); node->SetLineColor(kBlue); node->SetLineWidth(2); node->SetIsVolAtt(kFALSE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_2/ROOT_3/R_1/bar2_1"); node->SetLineColor(kBlue); node->SetLineWidth(2); node->SetIsVolAtt(kFALSE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_2/ROOT_3/R_1/bar2_2"); node->SetLineColor(kBlue); node->SetLineWidth(2); node->SetIsVolAtt(kFALSE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_2/ROOT_3/R_1/tub1_1"); node->SetLineColor(kBlue); node->SetLineWidth(2); node->SetIsVolAtt(kFALSE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_2/ROOT_3/R_1/bar3_1"); node->SetLineColor(kBlue); node->SetLineWidth(2); node->SetIsVolAtt(kFALSE); // Draw all volumes on the path of an "O" and keep original colors node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_3/ROOT_4/O_1/bar4_1"); node->SetVisibleFull(kTRUE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_3/ROOT_4/O_1/bar4_2"); node->SetVisibleFull(kTRUE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_3/ROOT_4/O_1/tub1_1"); node->SetVisibleFull(kTRUE); node = gGeoManager->MakePhysicalNode("TOP_1/REPLICA_3/ROOT_4/O_1/tub1_2"); node->SetVisibleFull(kTRUE); // Just activate visibility of extra paths gGeoManager->SetDrawExtraPaths(kTRUE); gGeoManager->SetVisLevel(1); // nothing really seen with this drawing option, except physical nodes gGeoManager->GetTopVolume()->Draw(); }