ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/macros/makePressureGraph.py
Revision: 1.1
Committed: Tue Jul 26 20:00:50 2011 UTC (13 years, 9 months ago) by akalinow
Content type: text/x-python
Branch: MAIN
CVS Tags: Artur_27_07_2011
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/usr/bin/env python
2
3 import os, commands
4 from array import array
5 import ROOT
6
7
8 ###Read data from txt file
9 file = open('pressure_twiki_160406-171484.dat')
10 counter = 0
11 runs = []
12 pressure = []
13 for line in file:
14 print line.split()
15 runs.append(float(line.split()[0]))
16 if(len(line.split())>1):
17 pressure.append(float(line.split()[1]))
18 else:
19 pressure.append(0.0)
20 counter+=1
21
22 x = array("d",runs)
23 y = array("d",pressure)
24
25 ###Define efficiency map histogram
26 myFile = ROOT.TFile("PressureGraph.root","RECREATE")
27 myGraph = ROOT.TGraph(len(runs),x,y)
28
29 myGraph.Write()
30 myFile.Write()
31 myFile.Close()