CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions
GeometryTree Class Reference
Inheritance diagram for GeometryTree:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

class  Node
 

Public Member Functions

 GeometryTree (const edm::ParameterSet &)
 
 ~GeometryTree ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &iSetup) override
 
virtual void beginJob () override
 
virtual void endJob () override
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Geometry Tree Printer Prints the RP Geometry hierarchy as a tree

Definition at line 43 of file GeometryTree.cc.

Constructor & Destructor Documentation

GeometryTree::GeometryTree ( const edm::ParameterSet )
inlineexplicit

Definition at line 45 of file GeometryTree.cc.

45  {
46  }
GeometryTree::~GeometryTree ( )
inline

Definition at line 47 of file GeometryTree.cc.

47  {
48  }

Member Function Documentation

virtual void GeometryTree::analyze ( const edm::Event ,
const edm::EventSetup iSetup 
)
inlineoverrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 55 of file GeometryTree.cc.

References DetGeomDesc::components(), GeometryTree::Node::desc, edm::EventSetup::get(), i, GeometryTree::Node::indent, GeometryTree::Node::print(), edm::ESHandle< class >::product(), and USE_TREE_OUTPUT.

55  {
56 
57  ESHandle<DetGeomDesc> geometryDescription;
58  iSetup.get<VeryForwardMeasuredGeometryRecord>().get(geometryDescription);
59 
60  // DFS traversal of Geometry Hierarchy
61  stack<Node *> nodeStack;
62  nodeStack.push(new Node((DetGeomDesc *)geometryDescription.product(), 0, true, USE_TREE_OUTPUT));
63  while (!nodeStack.empty()) {
64  Node *node = nodeStack.top();
65  nodeStack.pop();
66 
67  node->print();
68 
69  int childCount = node->desc->components().size();
70  int childIndent = node->indent + 1;
71 
72  for (int i = 0; i < childCount; ++i) {
73  DetGeomDesc *child = node->desc->components()[i];
74  bool childIsLast = (i == 0) ? true : false;
75  nodeStack.push(new Node(child, childIndent, childIsLast, USE_TREE_OUTPUT));
76  }
77 
78  delete node;
79  }
80  }
int i
Definition: DBlmapReader.cc:9
#define USE_TREE_OUTPUT
Definition: GeometryTree.cc:34
Event setup record containing the Measured (measured) geometry information.
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::TrieNode< PDet > Node
virtual void GeometryTree::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 51 of file GeometryTree.cc.

51  {
52  }
virtual void GeometryTree::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 53 of file GeometryTree.cc.

53  {
54  }