Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:22

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 #ifndef DDEVE_UTILITIES_H
0014 #define DDEVE_UTILITIES_H
0015 
0016 // Framework include files
0017 #include "DD4hep/Detector.h"
0018 
0019 // ROOT include files
0020 #include "TGeoMatrix.h"
0021 #include "TEveElement.h"
0022 #include "TNamed.h"
0023 
0024 /// Namespace for the AIDA detector description toolkit
0025 namespace dd4hep {
0026 
0027   namespace Utilities {
0028     int findNodeWithMatrix(TGeoNode* p, TGeoNode* n, TGeoHMatrix* mat, std::string* sub_path=0);
0029 
0030     std::pair<bool,TEveElement*> 
0031     createEveShape(int level, int max_level, TEveElement* p, TGeoNode* n, const
0032                    TGeoHMatrix& mat, const std::string& node_name);
0033 
0034     std::pair<bool,TEveElement*> 
0035     LoadDetElement(DetElement element,int levels, TEveElement* parent);
0036 
0037     /// Make a set of nodes starting from a top element (in-)visible with a given depth
0038     void MakeNodesVisible(TEveElement* e, bool visible, int level);
0039 
0040     /// Set the rendering flags for the object and the next level children
0041     void SetRnrChildren(TEveElementList* l, bool b);
0042     /// Recursively set the rendering flags for the object ans its children
0043     void SetRnrAll(TEveElementList* l, bool b);
0044 
0045     template <typename T> inline const char* GetName(T* p)   {
0046       TNamed *n = dynamic_cast<TNamed*>(p);
0047       return n ? n->GetName() : "???";
0048     }
0049   }
0050 }      /* End namespace dd4hep     */
0051 #endif // DDEVE_UTILITIES_H
0052