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
Observer
Definition: Observer.h:23
mmlvpv
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
Definition: PrintMaterialBudgetInfo.h:22
PrintMaterialBudgetInfo::texOutputFile
std::ofstream texOutputFile
Definition: PrintMaterialBudgetInfo.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PrintMaterialBudgetInfo::levelFound
unsigned int levelFound
Definition: PrintMaterialBudgetInfo.h:56
PrintMaterialBudgetInfo::~PrintMaterialBudgetInfo
~PrintMaterialBudgetInfo() override
Definition: PrintMaterialBudgetInfo.cc:52
PrintMaterialBudgetInfo::dumpElementMassFraction
void dumpElementMassFraction(std::ostream &elementOut=std::cout)
Definition: PrintMaterialBudgetInfo.cc:242
Observer.h
PrintMaterialBudgetInfo
Definition: PrintMaterialBudgetInfo.h:24
PrintMaterialBudgetInfo::elementNames
std::vector< std::string > elementNames
Definition: PrintMaterialBudgetInfo.h:60
SimWatcher.h
mpvpv
std::map< G4VPhysicalVolume *, G4VPhysicalVolume *, std::less< G4VPhysicalVolume * > > mpvpv
Definition: PrintMaterialBudgetInfo.h:19
PrintMaterialBudgetInfo::volumeFound
bool volumeFound
Definition: PrintMaterialBudgetInfo.h:55
PrintMaterialBudgetInfo::nchar
int nchar
Definition: PrintMaterialBudgetInfo.h:51
PrintMaterialBudgetInfo::printInfo
void printInfo(G4VPhysicalVolume *pv, G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &weightOut=std::cout, std::ostream &texOut=std::cout)
Definition: PrintMaterialBudgetInfo.cc:203
PrintMaterialBudgetInfo::PrintMaterialBudgetInfo
PrintMaterialBudgetInfo(edm::ParameterSet const &p)
Definition: PrintMaterialBudgetInfo.cc:32
BeginOfJob
Definition: BeginOfJob.h:8
PrintMaterialBudgetInfo::elementTotalWeight
std::vector< double > elementTotalWeight
Definition: PrintMaterialBudgetInfo.h:61
PrintMaterialBudgetInfo::elementWeightFraction
std::vector< double > elementWeightFraction
Definition: PrintMaterialBudgetInfo.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PrintMaterialBudgetInfo::dumpHierarchyLeaf
void dumpHierarchyLeaf(G4VPhysicalVolume *pv, G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &weightOut=std::cout, std::ostream &texOut=std::cout)
Definition: PrintMaterialBudgetInfo.cc:164
PrintMaterialBudgetInfo::dumpLaTeXFooter
void dumpLaTeXFooter(std::ostream &out=std::cout)
Definition: PrintMaterialBudgetInfo.cc:157
PrintMaterialBudgetInfo::theTopPV
G4VPhysicalVolume * theTopPV
Definition: PrintMaterialBudgetInfo.h:53
edm::ParameterSet
Definition: ParameterSet.h:36
PrintMaterialBudgetInfo::thePVTree
mpvpv thePVTree
Definition: PrintMaterialBudgetInfo.h:52
PrintMaterialBudgetInfo::elementOutputFile
std::ofstream elementOutputFile
Definition: PrintMaterialBudgetInfo.h:58
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
BeginOfRun
Definition: BeginOfRun.h:6
SimWatcher
Definition: SimWatcher.h:33
PrintMaterialBudgetInfo::fHistory
G4NavigationHistory fHistory
Definition: PrintMaterialBudgetInfo.h:54
PrintMaterialBudgetInfo::stringLaTeXSuperscript
std::string stringLaTeXSuperscript(std::string stringname)
Definition: PrintMaterialBudgetInfo.cc:292
PrintMaterialBudgetInfo::dumpHeader
void dumpHeader(std::ostream &out=std::cout)
Definition: PrintMaterialBudgetInfo.cc:79
PrintMaterialBudgetInfo::update
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
Definition: PrintMaterialBudgetInfo.h:32
PrintMaterialBudgetInfo::name
std::string name
Definition: PrintMaterialBudgetInfo.h:50
writedatasetfile.run
run
Definition: writedatasetfile.py:27
PrintMaterialBudgetInfo::stringLaTeXUnderscore
std::string stringLaTeXUnderscore(std::string stringname)
Definition: PrintMaterialBudgetInfo.cc:277
PrintMaterialBudgetInfo::dumpLaTeXHeader
void dumpLaTeXHeader(std::ostream &out=std::cout)
Definition: PrintMaterialBudgetInfo.cc:119
PrintMaterialBudgetInfo::weightOutputFile
std::ofstream weightOutputFile
Definition: PrintMaterialBudgetInfo.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ParameterSet.h