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 
28 public:
30  ~PrintMaterialBudgetInfo() override;
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, G4LogicalVolume* lv, unsigned int leafDepth,
37  std::ostream& weightOut = std::cout, std::ostream& texOut = std::cout);
38  void printInfo(G4VPhysicalVolume* pv, G4LogicalVolume* lv, unsigned int leafDepth,
39  std::ostream& weightOut = std::cout, std::ostream& texOut = std::cout);
40  void dumpElementMassFraction(std::ostream& elementOut = std::cout);
41  void dumpLaTeXFooter(std::ostream& out = std::cout);
42 
43 private:
45  int nchar;
47  G4VPhysicalVolume* theTopPV;
48  G4NavigationHistory fHistory;
50  unsigned int levelFound;
51  std::ofstream weightOutputFile;
52  std::ofstream elementOutputFile;
53  std::ofstream texOutputFile;
54  std::vector<std::string> elementNames;
55  std::vector<double> elementTotalWeight;
56  std::vector<double> elementWeightFraction;
57  //
60 };
61 
62 #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:6
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)