ATLAS Offline Software
Loading...
Searching...
No Matches
python.plotting.G4Debugger.G4Debugger Class Reference
Collaboration diagram for python.plotting.G4Debugger.G4Debugger:

Public Member Functions

 __init__ (self, path, G4Version)
 GetHistogram (self, his, cat, p, folder)
 GetHistogramAllATLAS (self, his, cat, p, folder)

Public Attributes

dict volumeSummary = {}
dict materialSummary = {}
dict processSummary = {}
 G4Version = G4Version
 file = ROOT.TFile(os.path.join(path,"%s.root" % G4Version),"READ")

Detailed Description

Definition at line 6 of file G4Debugger.py.

Constructor & Destructor Documentation

◆ __init__()

python.plotting.G4Debugger.G4Debugger.__init__ ( self,
path,
G4Version )

Definition at line 8 of file G4Debugger.py.

8 def __init__(self, path, G4Version):
9
10
11 self.volumeSummary = {}
12 self.materialSummary = {}
13 self.processSummary = {}
14
15 self.G4Version = G4Version
16 self.file = ROOT.TFile(os.path.join(path,"%s.root" % G4Version),"READ")
17
18 print(self.file)
19
20 d = self.file.GetDirectory("volumes")
21 for k in d.GetListOfKeys():
22 name = k.GetName()
23 if name in translate.keys() and name != 'other':
24 name = translate[name]
25 print(name)
26 namePerm = k.GetName()
27 if name == "summary":
28 continue
29 for p in particles:
30 h = self.GetHistogram("stepLength",namePerm,p,"volumes")
31 if h:
32 if not name in self.volumeSummary.keys():
33 self.volumeSummary[name] = {}
34 if not p in self.volumeSummary[name].keys():
35 self.volumeSummary[name][p] = 0
36 self.volumeSummary[name][p] += h.Integral(0,h.GetNbinsX()+1)
37 if p == "other":
38 for op in otherParticles:
39 oh = self.GetHistogram("stepLength",namePerm,op,"volumes")
40 if oh:
41 self.volumeSummary[name]["other"] += oh.Integral(0,oh.GetNbinsX()+1)
42
43 d = self.file.GetDirectory("materials")
44 for k in d.GetListOfKeys():
45 name = k.GetName()
46 if name == "summary":
47 continue
48 for p in particles:
49 h = self.GetHistogram("stepLength",name,p,"materials")
50 if h:
51 if not name in self.materialSummary.keys():
52 self.materialSummary[name] = {}
53 if not p in self.materialSummary[name].keys():
54 self.materialSummary[name][p] = 0
55 self.materialSummary[name][p] += h.Integral(0,h.GetNbinsX()+1)
56
57 d = self.file.GetDirectory("processes")
58 for k in d.GetListOfKeys():
59 name = k.GetName()
60 if name == "summary":
61 continue
62 for p in particles:
63 h = self.GetHistogram("stepLength",name,p,"processes")
64 if h:
65 if not name in self.processSummary.keys():
66 self.processSummary[name] = {}
67 if not p in self.processSummary[name].keys():
68 self.processSummary[name][p] = 0
69 self.processSummary[name][p] += h.Integral(0,h.GetNbinsX()+1)
70
void print(char *figname, TCanvas *c1)

Member Function Documentation

◆ GetHistogram()

python.plotting.G4Debugger.G4Debugger.GetHistogram ( self,
his,
cat,
p,
folder )

Definition at line 71 of file G4Debugger.py.

71 def GetHistogram(self,his,cat,p,folder):
72 middle = folder[0:3] if not folder == "processes" else "prc"
73 hisName = "%s_%s_%s_%s" % (cat, p, middle, (his if his != "2DMaps" else "RZ"))
74 h = self.file.Get(os.path.join(folder,cat,his,hisName))
75 return h
76
T * Get(TFile &f, const std::string &n, const std::string &dir="", const chainmap_t *chainmap=0, std::vector< std::string > *saved=0)
get a histogram given a path, and an optional initial directory if histogram is not found,...

◆ GetHistogramAllATLAS()

python.plotting.G4Debugger.G4Debugger.GetHistogramAllATLAS ( self,
his,
cat,
p,
folder )

Definition at line 77 of file G4Debugger.py.

77 def GetHistogramAllATLAS(self,his,cat,p,folder):
78 hisName = "%s_%s_%s" % (cat, p, his)
79 h = self.file.Get(os.path.join(folder,cat,his,hisName))
80 return h

Member Data Documentation

◆ file

python.plotting.G4Debugger.G4Debugger.file = ROOT.TFile(os.path.join(path,"%s.root" % G4Version),"READ")

Definition at line 16 of file G4Debugger.py.

◆ G4Version

python.plotting.G4Debugger.G4Debugger.G4Version = G4Version

Definition at line 15 of file G4Debugger.py.

◆ materialSummary

dict python.plotting.G4Debugger.G4Debugger.materialSummary = {}

Definition at line 12 of file G4Debugger.py.

◆ processSummary

dict python.plotting.G4Debugger.G4Debugger.processSummary = {}

Definition at line 13 of file G4Debugger.py.

◆ volumeSummary

dict python.plotting.G4Debugger.G4Debugger.volumeSummary = {}

Definition at line 11 of file G4Debugger.py.


The documentation for this class was generated from the following file: