--- UserCode/L1RpcTriggerAnalysis/macros/makePressureGraph.py 2011/09/10 15:14:22 1.2 +++ UserCode/L1RpcTriggerAnalysis/macros/makePressureGraph.py 2012/08/27 10:26:40 1.3 @@ -19,12 +19,13 @@ if __name__ == "__main__": pressure = [] for line in file: print line.split() - runs.append(float(line.split()[0])) - if(len(line.split())>1): - pressure.append(float(line.split()[1])) - else: - pressure.append(0.0) - counter+=1 + if(len(line.split())>0): + runs.append(float(line.split()[0])) + if(len(line.split())>1): + pressure.append(float(line.split()[1])) + else: + pressure.append(0.0) + counter+=1 x = array("d",runs) y = array("d",pressure) @@ -32,6 +33,7 @@ if __name__ == "__main__": ###Define efficiency map histogram myFile = ROOT.TFile("PressureGraph.root","RECREATE") myGraph = ROOT.TGraph(len(runs),x,y) + myGraph.SetName("Graph") myGraph.Write() myFile.Write()