source: trunk/source/processes/electromagnetic/standard/test/readBremLPM.py @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 1.6 KB
Line 
1# $Id: readBremLPM.py,v 1.2 2008/08/22 08:16:17 schaelic Exp $
2# GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
3#
4# works together with BremLPMTest.cc
5#
6from ROOT import gROOT, gApplication, TFile, TCanvas
7
8# set nice style
9gROOT.SetStyle("Plain")
10
11# create 6 pads
12c1 = TCanvas('c1','CrossSection')
13c1.Divide(3,2)
14
15c2 = TCanvas('c2','DEDX')
16c2.Divide(3,2)
17
18#open root file
19f=TFile('eBremRel01.root')
20t=f.Get('info')
21zlink=t.GetLeaf('Z')
22t.Scan()
23
24#plot cross section histograms
25for i in range(t.GetEntries()):
26    t.GetEntry(i)
27    Z=int(zlink.GetValue())
28    c1.cd(i+1)
29    c1.GetPad(i+1).SetLogx()
30
31    gR=f.Get('modelR;'+str(i+1))
32    gR.GetHistogram().SetTitle('Z='+str(Z))
33    gR.Draw('Alp');
34    minR=gR.GetHistogram().GetMinimum()
35    maxR=gR.GetHistogram().GetMaximum()
36   
37    g1=f.Get('model1;'+str(i+1))
38    g1.Draw('lp');
39    min1=g1.GetHistogram().GetMinimum()
40    max1=g1.GetHistogram().GetMaximum()
41
42    gR.SetMaximum(1.1*max(max1,maxR))
43    gR.SetMinimum(0.9*min(min1,minR))
44    print Z
45
46#plot dEdx histograms
47for i in range(t.GetEntries()):
48    t.GetEntry(i)
49    Z=int(zlink.GetValue())
50    c2.cd(i+1)
51    c2.GetPad(i+1).SetLogx()
52    c2.GetPad(i+1).SetLogy()
53
54    gR=f.Get('xDEDXR;'+str(i+1))
55    gR.GetHistogram().SetTitle('Z='+str(Z))
56    gR.Draw('Alp');
57    minR=gR.GetHistogram().GetMinimum()
58    maxR=gR.GetHistogram().GetMaximum()
59   
60    g1=f.Get('xDEDX1;'+str(i+1))
61    g1.Draw('lp');
62    min1=g1.GetHistogram().GetMinimum()
63    max1=g1.GetHistogram().GetMaximum()
64
65#    gR.SetMaximum(1.e-3)
66    gR.SetMinimum(1.e-6*max(max1,maxR))
67    print Z
68
69#done
70gApplication.Run() 
Note: See TracBrowser for help on using the repository browser.