CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/SLHCUpgradeSimulations/Geometry/interface/PrintGeomMatInfo.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_PrintGeomMatInfo_H
00002 #define SimG4Core_PrintGeomMatInfo_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 PrintGeomMatInfo : public SimWatcher,
00025                             public Observer<const BeginOfJob *>,
00026                             public Observer<const BeginOfRun *>
00027 {
00028 public:
00029     PrintGeomMatInfo(edm::ParameterSet const & p);
00030     ~PrintGeomMatInfo();
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     void dumpG4LVMatBudget(std::ostream& out = std::cout);
00040     void dumpG4LVLeafWithMat(G4LogicalVolume * lv, unsigned int leafDepth, unsigned int count, std::ostream & out = std::cout);
00041     int countNoTouchables();
00042     void add1touchable(G4LogicalVolume * lv, int & nTouch);
00043     void dumpHierarchyTreePVLV(std::ostream& out = std::cout);
00044     void dumpHierarchyLeafPVLV(G4LogicalVolume * lv, unsigned int leafDepth, std::ostream & out = std::cout);
00045     void dumpLV(G4LogicalVolume * lv, unsigned int leafDepth, std::ostream & out = std::cout);
00046     void dumpPV(G4VPhysicalVolume * pv, unsigned int leafDepth, std::ostream & out = std::cout);
00047     void dumpTouch(G4VPhysicalVolume * pv, unsigned int leafDepth, std::ostream & out = std::cout);
00048     std::string spacesFromLeafDepth(unsigned int leafDepth);
00049     void dumpSolid(G4VSolid * sol, unsigned int leafDepth, std::ostream & out = std::cout);
00050     G4VPhysicalVolume * getTopPV();
00051     G4LogicalVolume * getTopLV();
00052 private:
00053     bool                     _dumpSummary, _dumpLVTree, _dumpLVMatBudget, _dumpLVList;
00054     bool                     _dumpMaterial;
00055     bool                     _dumpLV, _dumpSolid, _dumpAtts, _dumpSense;
00056     bool                     _dumpPV, _dumpRotation, _dumpReplica, _dumpTouch;
00057     std::string              name;
00058     int                      nchar;
00059     std::vector<std::string> names;
00060     std::vector<std::string> _lvNames2Dump;
00061     std::vector<double> _radiusLayer;
00062     std::vector<double> _zLayer;
00063     std::vector<double> _areaLayer;
00064     std::vector<unsigned int> _countsPerLevel;
00065     unsigned int             _maxLevelsCounted;
00066     unsigned int             _level2Dump;
00067     unsigned int             _dumpIndex;
00068     bool                     _dumpIt;
00069     mpvpv                    thePVTree;
00070     G4VPhysicalVolume *      theTopPV; 
00071     G4NavigationHistory      fHistory;
00072 };
00073 
00074 #endif