source: trunk/source/processes/electromagnetic/utils/test/diff_tables_plot.py @ 1358

Last change on this file since 1358 was 1199, checked in by garnier, 15 years ago

nvx fichiers dans CVS

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/usr/bin/env python
2
3import os, sys
4from ROOT import gROOT, TFile, TCanvas, TGraph, Riostream
5
6   gROOT.Reset()
7
8n = 1100
9
10En, Y1, Y2, diff, pres = array( 'd' ), array( 'd' ), array( 'd' ), array( 'd' ), array( 'd' ), array( 'd' )
11
12c1 = TCanvas('c1', 'c1',6,6,800,600)
13gStyle.SetOptStat(0)
14c1.SetLogx()
15c1.SetFillColor(0)
16c1.SetBorderMode(0)
17c1.SetBorderSize(0)
18c1.SetFrameBorderMode(0)
19   
20
21in = open('DEDX.hIoni.proton.asc_20bins_spl.out', 'r')
22#in = open('DEDX.eIoni.e-.asc_spl.out, 'r')
23
24lines = in.readlines()
25title = lines[0]
26
27for line in lines[1:]:
28     En.append (line.split() [0])
29     Y1.append (line.split() [1])
30     Y2.append (line.split() [2])
31     diff.append (line.split() [3])
32     pres.append ((Y1/Y2 - 1)*100) 
33
34gr = new TGraph(n,En,pres)
35gr.SetTitle('proton in Pb, table 100 pts / 20 pts_spl per order')
36gr.SetMarkerStyle(22)
37gr.SetMarkerSize(0.8)
38gr.GetYaxis()->SetLabelFont(132)
39gr.GetYaxis()->SetLabelSize(0.04)
40gr.GetXaxis()->SetLabelFont(132)
41gr.GetXaxis()->SetLabelSize(0.04)
42gr.GetXaxis()->SetTitle('E, MeV')
43gr.GetYaxis()->SetTitle('dE/dx: (100pts/20pts_spl - 1), %')
44gr.GetXaxis()->SetTitleOffset(1.2)
45gr.Draw('AP')
46
47
48c1.Modified()
49c1.cd()
Note: See TracBrowser for help on using the repository browser.