FairRoot/PandaRoot
emc/dedicated/draw_geom.C
Go to the documentation of this file.
1 {
2  // Macro created 19/09/2006 by S.Spataro
3  // It loads a simulation file and plot the geometry
4 
5  // Loading libraries
6  // If the macro gives error messages in loading libraries, please check the path of the libs and put it by hands
7 
8  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
9  basiclibs();
10 
11  gSystem->Load("libGeoBase");
12  gSystem->Load("libParBase");
13  gSystem->Load("libBase");
14  gSystem->Load("libField");
15  gSystem->Load("libGen");
16  gSystem->Load("libPassive");
17 
18  // add the detector libraries you need
19  gSystem->Load("libStt");
20  gSystem->Load("libMdt");
21  gSystem->Load("libEmc");
22  gSystem->Load("libGeom.so");
23 
24  TFile* f = new TFile("sim_emc.root"); // the sim file you want to analyse
25 
26  TGeoManager *geoMan = (TGeoManager*) f->Get("FAIRGeom");
27 
28  TCanvas* c1 = new TCanvas("c1", "", 100, 100, 800, 800); // to create a canvas where to plot the geometry
29  c1->SetFillColor(10);
30 
31  geoMan->SetVisLevel(10); // Number of folded geo levels; 3 for emc. Try to change the number and to see how the geometry changes.
32 
33  geoMan->GetMasterVolume()->Draw("same");
34 }
35 
basiclibs()
TCanvas * c1
TFile * f
TGeoManager * geoMan