10 print(
'File not open ?')
15 fout=
open(outfile,
'a')
17 fout=
open(outfile,
'w')
18 except Exception
as e:
19 print(
'Could not open output file ',outfile)
23 tree=inf.Get(
"hv/mytree")
25 br_hvline=tree.GetBranch(
"HVline")
27 for i
in range(0,tree.GetEntries()):
28 if i%10000 == 0:
print(i)
30 if tree.HVline != hvline:
continue
37 idlist=[bec,side,FT,slot,channel]
38 if str(idlist)
in hvdict:
continue
41 hvlist=[bec,side,FT,slot,channel,ihv]
42 hvdict[
str(idlist)]=hvlist
46 if not append: fout.write(
'/LAR/HVPathologiesOfl/Pathologies\n')
47 for k
in list(hvdict.keys()):
50 print(
'Wrong list: ',ll,
' continue to next!!!')
52 wstr=
str(ll[0])+
' '+
str(ll[1])+
' '+
str(ll[2])+
' '+
str(ll[3])+
' '+
str(ll[4])+
' '+
str(hvline/1000)+
' '+
str(hvline%1000)+
' '+
str((ihv<<4)&0xFFF0)+
'\n'
58 if __name__==
"__main__":
63 inf = ROOT.TFile(infile,
'read')
64 except Exception
as e:
65 print(
'HV ntuple ',infile,
' doesnt exist ?')
69 print(
'HV ntuple file: ',infile)
72 hvline =
int(sys.argv[2])
73 except Exception
as e:
74 print(
'HVline number doesnt exist ?')
78 if hvline < 1000
or hvline > 400000:
79 print(
'wrong HV line number: ',hvline)
87 print(
'Output file: ',outfile)
90 if int(sys.argv[4])==0:
97 print(
'Append to out file: ',append)