DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Utilities.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DDEVE_UTILITIES_H
14 #define DDEVE_UTILITIES_H
15 
16 // Framework include files
17 #include "DD4hep/Detector.h"
18 
19 // ROOT include files
20 #include "TGeoMatrix.h"
21 #include "TEveElement.h"
22 #include "TNamed.h"
23 
25 namespace dd4hep {
26 
27  namespace Utilities {
28  int findNodeWithMatrix(TGeoNode* p, TGeoNode* n, TGeoHMatrix* mat, std::string* sub_path=0);
29 
30  std::pair<bool,TEveElement*>
31  createEveShape(int level, int max_level, TEveElement* p, TGeoNode* n, const
32  TGeoHMatrix& mat, const std::string& node_name);
33 
34  std::pair<bool,TEveElement*>
35  LoadDetElement(DetElement element,int levels, TEveElement* parent);
36 
38  void MakeNodesVisible(TEveElement* e, bool visible, int level);
39 
41  void SetRnrChildren(TEveElementList* l, bool b);
43  void SetRnrAll(TEveElementList* l, bool b);
44 
45  template <typename T> inline const char* GetName(T* p) {
46  TNamed *n = dynamic_cast<TNamed*>(p);
47  return n ? n->GetName() : "???";
48  }
49  }
50 } /* End namespace dd4hep */
51 #endif // DDEVE_UTILITIES_H
52 
Detector.h
dd4hep::Utilities::findNodeWithMatrix
int findNodeWithMatrix(TGeoNode *p, TGeoNode *n, TGeoHMatrix *mat, std::string *sub_path=0)
Definition: Utilities.cpp:164
dd4hep::Utilities::SetRnrChildren
void SetRnrChildren(TEveElementList *l, bool b)
Set the rendering flags for the object and the next level children.
Definition: Utilities.cpp:37
TEveElementList
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:13
dd4hep::Utilities::createEveShape
std::pair< bool, TEveElement * > createEveShape(int level, int max_level, TEveElement *p, TGeoNode *n, const TGeoHMatrix &mat, const std::string &node_name)
Definition: Utilities.cpp:75
dd4hep::Utilities::SetRnrAll
void SetRnrAll(TEveElementList *l, bool b)
Recursively set the rendering flags for the object ans its children.
Definition: Utilities.cpp:45
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::Utilities::GetName
const char * GetName(T *p)
Definition: Utilities.h:45
TNamed
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:37
dd4hep::Utilities::LoadDetElement
std::pair< bool, TEveElement * > LoadDetElement(DetElement element, int levels, TEveElement *parent)
Definition: Utilities.cpp:190
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Utilities::MakeNodesVisible
void MakeNodesVisible(TEveElement *e, bool visible, int level)
Make a set of nodes starting from a top element (in-)visible with a given depth.
Definition: Utilities.cpp:56