CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_PrintGeomInfoAction_H
00002 #define SimG4Core_PrintGeomInfoAction_H
00003 
00004 #include "SimG4Core/Watcher/interface/SimWatcher.h"
00005 #include "SimG4Core/Notification/interface/Observer.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007     
00008 #include "G4NavigationHistory.hh"
00009 
00010 #include <iostream>
00011 #include <vector>
00012 #include <map>
00013 #include <string>
00014 
00015 class BeginOfJob;
00016 class BeginOfRun;
00017 class G4LogicalVolume;
00018 class G4VPhysicalVolume;
00019 class G4VSolid;
00020 
00021 typedef std::map< G4VPhysicalVolume*, G4VPhysicalVolume*, std::less<G4VPhysicalVolume*> > mpvpv;
00022 typedef std::multimap< G4LogicalVolume*, G4VPhysicalVolume*, std::less<G4LogicalVolume*> > mmlvpv;
00023 
00024 class PrintGeomInfoAction : public SimWatcher,
00025                             public Observer<const BeginOfJob *>,
00026                             public Observer<const BeginOfRun *> {
00027 
00028 public:
00029   PrintGeomInfoAction(edm::ParameterSet const & p);
00030   ~PrintGeomInfoAction();
00031 private:
00032   void update(const BeginOfJob * job);
00033   void update(const BeginOfRun * run);
00034   void dumpSummary(std::ostream& out = std::cout);
00035   void dumpG4LVList(std::ostream& out = std::cout);
00036   void dumpG4LVTree(std::ostream& out = std::cout);
00037   void dumpMaterialList(std::ostream& out = std::cout);
00038   void dumpG4LVLeaf(G4LogicalVolume * lv, unsigned int leafDepth, unsigned int count, std::ostream & out = std::cout);
00039   int countNoTouchables();
00040   void add1touchable(G4LogicalVolume * lv, int & nTouch);
00041   void dumpHierarchyTreePVLV(std::ostream& out = std::cout);
00042   void dumpHierarchyLeafPVLV(G4LogicalVolume * lv, unsigned int leafDepth, std::ostream & out = std::cout);
00043   void dumpLV(G4LogicalVolume * lv, unsigned int leafDepth, std::ostream & out = std::cout);
00044   void dumpPV(G4VPhysicalVolume * pv, unsigned int leafDepth, std::ostream & out = std::cout);
00045   void dumpTouch(G4VPhysicalVolume * pv, unsigned int leafDepth, std::ostream & out = std::cout);
00046   std::string spacesFromLeafDepth(unsigned int leafDepth);
00047   void dumpSolid(G4VSolid * sol, unsigned int leafDepth, std::ostream & out = std::cout);
00048   G4VPhysicalVolume * getTopPV();
00049   G4LogicalVolume * getTopLV();
00050 private:
00051   bool                     _dumpSummary, _dumpLVTree, _dumpLVList;
00052   bool                     _dumpMaterial;
00053   bool                     _dumpLV, _dumpSolid, _dumpAtts, _dumpSense;
00054   bool                     _dumpPV, _dumpRotation, _dumpReplica, _dumpTouch;
00055   std::string              name;
00056   int                      nchar;
00057   std::vector<std::string> names;
00058   mpvpv                    thePVTree;
00059   G4VPhysicalVolume *      theTopPV; 
00060   G4NavigationHistory      fHistory;
00061 };
00062 
00063 #endif