Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHGeom_DSTInspection.C
Go to the documentation of this file.
1 // $Id: $
2 
11 #include <cassert>
12 
15 void
16 PHGeom_DSTInspection(string DST_file_name = "sPHENIX.root_DST.root",
17  bool do_clip = true)
18 {
19  TEveManager::Create();
20 
21 
22  // main lib
23  gSystem->Load("libphgeom.so");
24 
25  // in case DST contains sPHENIX stuff
26  gSystem->Load("libg4calo.so");
27  gSystem->Load("libg4vertex.so");
28  gSystem->Load("libcalotrigger_io.so");
29  gSystem->Load("libg4eval.so");
30 
31 
33  se->Verbosity(1);
35  rc->set_IntFlag("RUNNUMBER", 12345);
36 
37  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
38  hitsin->fileopen(DST_file_name);
39  se->registerInputManager(hitsin);
40 
41  // run one event as example
42  se->run(1);
43 
45 
46  assert(gGeoManager);
47 
48  if (!gROOT->GetListOfGeometries()->FindObject(gGeoManager))
49  gROOT->GetListOfGeometries()->Add(gGeoManager);
50  if (!gROOT->GetListOfBrowsables()->FindObject(gGeoManager))
51  gROOT->GetListOfBrowsables()->Add(gGeoManager);
52 // gGeoManager->UpdateElements();
53 
54  TGeoNode *current = gGeoManager->GetCurrentNode();
55  //Alternate drawing
56  //current->GetVolume()->Draw("ogl");
57  //Print the list of daughters
58  //current->PrintCandidates();
59  for (int igeom = 0; igeom < current->GetNdaughters(); igeom++)
60  {
61  TGeoNode *geo_node = (TGeoNode*) current->GetNodes()->UncheckedAt(igeom);
62  geo_node->GetVolume()->VisibleDaughters(kFALSE);
63  geo_node->GetVolume()->SetTransparency(2);
64  //Keep the pipe visible all the time
65  if (string(geo_node->GetName()).find("PIPE") != string::npos)
66  geo_node->GetVolume()->SetTransparency(0);
67  }
68  TEveGeoTopNode* eve_node = new TEveGeoTopNode(gGeoManager, current);
69  eve_node->SetVisLevel(6);
70  gEve->AddGlobalElement(eve_node);
71  gEve->FullRedraw3D(kTRUE);
72 
73  // EClipType not exported to CINT (see TGLUtil.h):
74  // 0 - no clip, 1 - clip plane, 2 - clip box
75  TGLViewer *v = gEve->GetDefaultGLViewer();
76  if (do_clip)
77  {
78  v->GetClipSet()->SetClipType( TGLClip::kClipPlane );
79  }
80 // v->ColorSet().Background().SetColor(kMagenta + 4);
81  v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
82  v->RefreshPadEditor(v);
83 
84  v->CurrentCamera().RotateRad(-1.6,0.);
85  v->DoDraw();
86 
87 }
88 
int registerInputManager(Fun4AllInputManager *InManager)
void PHGeom_DSTInspection(string DST_file_name="sPHENIX.root_DST.root", bool do_clip=true)
static Fun4AllServer * instance()
Fun4AllServer * se
virtual void set_IntFlag(const std::string &name, const int flag)
Definition: PHFlag.cc:145
static recoConsts * instance()
Definition: recoConsts.cc:7
int run(const int nevnts=0, const bool require_nevents=false)
run n events (0 means up to end of file)
PHCompositeNode * topNode() const
Definition: Fun4AllServer.h:59
static TGeoManager * GetTGeoManager(PHCompositeNode *topNode)
Main user interface: DST node -&gt; TGeoManager for downstream use.
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
Definition: Fun4AllBase.h:58
virtual int fileopen(const std::string &)