]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/DrawFMD.C
Completely reengineered version of CMake build system (Johny)
[u/mrichter/AliRoot.git] / FMD / DrawFMD.C
1 /** @file    DrawFMD.C
2     @author  Christian Holm Christensen <cholm@nbi.dk>
3     @date    Mon Mar 27 14:18:21 2006
4     @brief   Script to draw the FMD3 - obsolete
5 */
6 void DrawFMD(const char* file="geometry.root", const char* option="ogl")
7 {
8 #if 1
9   AliCDBManager* cdb = AliCDBManager::Instance();
10   cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
11   cdb->SetRun(0);
12   AliGeomManager::LoadGeometry(file);
13   TGeoVolume* top = gGeoManager->GetTopVolume();
14   TGeoIterator next(top);
15   TGeoNode* node = 0;
16   while ((node = next())) {
17     TGeoVolume* v = node->GetVolume();
18     v->SetVisibility(kFALSE);
19     v->InvisibleAll(kTRUE);
20     v->VisibleDaughters(kFALSE);
21
22     TString name(v->GetName());
23     if (name[0] == 'F') { 
24       if (name[1] == '1' || name[1] == '2' || name[1] == '3' ||
25           name[1] == 'I' || name[1] == 'O' || name[1] == 'M') {
26          v->SetVisibility(kTRUE);
27          v->InvisibleAll(kFALSE);
28          v->VisibleDaughters(kTRUE);
29          std::cout << "Making " << name << " visible" << std::endl;
30          continue;
31       }
32     }
33     if (name[0] == 'C') { 
34       if ((name[1] == 'P' || name[1] == 'p') && 
35           (name[2] == '1' || name[2] == '2' || name[3] == '3')) {
36         v->SetVisibility(kTRUE);
37         v->InvisibleAll(kFALSE);
38         v->VisibleDaughters(kTRUE);
39         std::cout << "Making " << name << " visible" << std::endl;
40         continue;       
41       }
42   }
43   // for (
44   gGeoManager->SetVisLevel(5);
45   top->InvisibleAll(kFALSE);
46   top->Draw(option);
47
48 #else
49   // gSystem->Load("/usr/lib/libshift");
50   // gSystem->Load("/usr/lib/libgfortran");
51   gSystem->Load("libgeant321");
52   gMC = new TGeant3TGeo;
53   gMC->Gsatt("*", "seen", -1);
54   gMC->Gsatt("alic", "seen", 0);
55   gROOT->LoadMacro("FMD/ViewFMD.C");
56   gInterpreter->ProcessLine("ViewFMD()");
57   gROOT->LoadMacro("ITS/ViewITS.C");
58   gInterpreter->ProcessLine("ViewITS()");
59   gMC->Gdopt("hide", "on");
60   gMC->Gdopt("shad", "on");
61   gMC->Gsatt("*", "fill", 7);
62   gMC->SetClipBox(".");
63   gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
64   gMC->DefaultRange();
65   gMC->Gdraw("alic", 40, 30, 0, 12, 12, .055, .055);
66   gMC->Gdhead(1111, "Forward Multiplicity Detector");
67   gMC->Gdman(16, 10, "MAN");
68   gPad->Modified();
69   gPad->cd();
70 #endif
71 }