{ // Macro phobgeom.C: This macro generates a display of the PHOBOS // geometry translated from UGCDATA via PMC Geant and g2root. // It requires also macros phobos.C (the g2root output) and // phcset.C, which takes arguments "name" and "colno" where name is // 2 characters for a node classification, colno is a color number. // The first button calls up a fourth macro, phghelp.C. This // will contain at least some instructions and perhaps also some // examples of other event display ideas and tools. // Pushbuttons allow superposition of any number of // classifications in a 3-dim. view of PHOBOS. // Set up the phobos geometry and load the phcset macro gROOT->Macro("phobos.C"); //Sets up TGeometry phobos gROOT->LoadMacro("phcset.C"); //For use by pushbutton calls TNode *phNode; phNode = phobos->GetNode("OUTS1"); //Top node, reference frame phNode->SetVisibility(0); //This sets all invisible (default) c1 = new TCanvas("c1","Phobos geometry",220,10,900,700); // We'll use a TControlBar for this exercise; next to try is // TButton which gives control over color, placement etc. // There is a problem with nested quotes in the button method // spec. which requires defining some character variables: char *same = "same"; char *sn = "SN"; char *sp = "SP"; char *ca = "CA"; char *mn = "MN"; char *mp = "MP"; char *mo = "MO"; char *vp = "VP"; char *vn = "VN"; char *rr = "RR"; char *ro = "RO"; char *tp = "TP"; char *tn = "TN"; char *yy = "YY"; char *yc = "YC"; char *uu = "U*"; char outs1[5] = "OUTS1"; char help[256] = "start c:\\ProgramsNetscape\\Communicator\\PROGRAM\\Netscape.exe c:\\Msdev\\Projects\\root\\RootHtmlDoc\\Welcome.html"; bar = new TControlBar("vertical","draw PHOBOS","press buttons to superpose"); bar->AddButton("Help and other tools",".x phghelp.C", " "); bar->AddButton("Spectrometer", "{phcset(sn,2); phcset(sp,2); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw spectrometer sensitive silicon"); bar->AddButton("Spect. base", "{phcset(ca,9); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw spectrometer supports"); bar->AddButton("Multiplicity", "{phcset(mn,2); phcset(mp,2); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw multiplicity sensitive silicon"); bar->AddButton("Mult. supports", "{phcset(rr,9); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw multiplicity supports"); bar->AddButton("Octagon, vertex", "{phcset(mo,2); phcset(vp,2); phcset(vn,2); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw octagon and vertex sensitive silicon"); bar->AddButton("Octagon supports", "{phcset(ro,9); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw octagon supports"); bar->AddButton("TOF", "{phcset(tp,6); phcset(tn,6); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw time of flight detectors"); bar->AddButton("Magnet", "{phcset(yy,8); phcset(yc,5); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw the magnet and coils (slow!)"); bar->AddButton("Spect. support", "{phcset(uu,1); phobos->Draw(same); c1->Draw();c1->Draw();c1->Update();}", "Draw electronics, cables, etc. (slow!)"); bar->AddButton("Clear", "{TNode *Outs; Outs = phobos->GetNode(outs1); Outs->SetVisibility(0); c1->Clear(); c1->Update();}", "Set the visibility of all nodes back to zero"); bar->AddButton("ROOT Help","{gSystem.Exec(help);}", "Get html help for ROOT"); bar->AddButton("Exit",".q","Exit ROOT"); bar->Show(); gROOT->SaveContext(); }