CMS 3D CMS Logo

PrintMaterialBudgetInfo.h
Go to the documentation of this file.
1 #ifndef SimG4CorePrintGeomInfo_PrintMaterialBudgetInfo_H
2 #define SimG4CorePrintGeomInfo_PrintMaterialBudgetInfo_H
3 
7 
8 #include "G4NavigationHistory.hh"
9 
10 #include <iostream>
11 #include <fstream>
12 #include <vector>
13 #include <string>
14 
15 class BeginOfJob;
16 class BeginOfRun;
17 class G4LogicalVolume;
18 class G4VPhysicalVolume;
19 class G4VSolid;
20 
21 typedef std::map<G4VPhysicalVolume*, G4VPhysicalVolume*, std::less<G4VPhysicalVolume*> > mpvpv;
22 typedef std::multimap<G4LogicalVolume*, G4VPhysicalVolume*, std::less<G4LogicalVolume*> > mmlvpv;
23 
25  public Observer<const BeginOfJob*>,
26  public Observer<const BeginOfRun*> {
27 public:
29  ~PrintMaterialBudgetInfo() override;
30 
31 private:
32  void update(const BeginOfJob* job) override{};
33  void update(const BeginOfRun* run) override;
34  void dumpHeader(std::ostream& out = std::cout);
35  void dumpLaTeXHeader(std::ostream& out = std::cout);
36  void dumpHierarchyLeaf(G4VPhysicalVolume* pv,
37  G4LogicalVolume* lv,
38  unsigned int leafDepth,
39  std::ostream& weightOut = std::cout,
40  std::ostream& texOut = std::cout);
41  void printInfo(G4VPhysicalVolume* pv,
42  G4LogicalVolume* lv,
43  unsigned int leafDepth,
44  std::ostream& weightOut = std::cout,
45  std::ostream& texOut = std::cout);
46  void dumpElementMassFraction(std::ostream& elementOut = std::cout);
47  void dumpLaTeXFooter(std::ostream& out = std::cout);
48 
49 private:
51  int nchar;
53  G4VPhysicalVolume* theTopPV;
54  G4NavigationHistory fHistory;
56  unsigned int levelFound;
57  std::ofstream weightOutputFile;
58  std::ofstream elementOutputFile;
59  std::ofstream texOutputFile;
60  std::vector<std::string> elementNames;
61  std::vector<double> elementTotalWeight;
62  std::vector<double> elementWeightFraction;
63  //
66 };
67 
68 #endif
std::map< G4VPhysicalVolume *, G4VPhysicalVolume *, std::less< G4VPhysicalVolume * > > mpvpv
std::vector< std::string > elementNames
std::vector< double > elementWeightFraction
std::vector< double > elementTotalWeight
void dumpElementMassFraction(std::ostream &elementOut=std::cout)
void dumpHierarchyLeaf(G4VPhysicalVolume *pv, G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &weightOut=std::cout, std::ostream &texOut=std::cout)
void printInfo(G4VPhysicalVolume *pv, G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &weightOut=std::cout, std::ostream &texOut=std::cout)
PrintMaterialBudgetInfo(edm::ParameterSet const &p)
std::map< G4VPhysicalVolume *, G4VPhysicalVolume *, std::less< G4VPhysicalVolume * > > mpvpv
def pv(vc)
Definition: MetAnalyzer.py:7
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
void dumpLaTeXFooter(std::ostream &out=std::cout)
std::string stringLaTeXSuperscript(std::string stringname)
void dumpHeader(std::ostream &out=std::cout)
std::string stringLaTeXUnderscore(std::string stringname)
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
void dumpLaTeXHeader(std::ostream &out=std::cout)