forked from CMS-LUMI-POG/VdMFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp_makeGraphsFilePCC.py
More file actions
39 lines (28 loc) · 1.08 KB
/
tmp_makeGraphsFilePCC.py
File metadata and controls
39 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import ROOT as r
import pickle
in_file_name = 'forTmpStorage/PCC_Fill3503/pixel_vdm_graphs_210986.root'
Fill = 3503
PCC_BX=[ 1, 233, 892, 1124, 1356]
scanNumber = [1,2,3,4]
scanType = ['x','y','y','x']
in_file = r.TFile.Open(in_file_name, "READ")
out_file_name = 'forTmpStorage/PCC_Fill'+str(Fill)+'/'+'graphs_' + str(Fill) + '_noCorr.pkl'
graphsListAll = {'Scan_'+ str(n+1):{} for n in range(len(scanNumber))}
for number, type in zip(scanNumber,scanType):
graph = r.TGraphErrors()
graphs={}
for bx in PCC_BX:
print "Now copying graph_pixel_scan" + str(number-1) + "_" + type + "_bx"+str(bx)
graph = in_file.Get("graph_pixel_scan" + str(number-1) + "_" + type + "_bx"+str(bx))
if type == 'x':
name = str(number) + "_X_" + str(bx)
if type == 'y':
name = str(number) + "_Y_" + str(bx)
graph.SetName(name)
graph.SetTitle(name)
graphs[bx] = graph
graphsListAll['Scan_'+ str(number)]=graphs
out_file = open(out_file_name, 'wb')
pickle.dump(graphsListAll, out_file)
out_file.close()
in_file.Close()