ATLAS Offline Software
Functions | Variables
dumpHVPathFromNtuple Namespace Reference

Functions

def DumpPathology (inf, hvline, outfile, append)
 

Variables

 infile = sys.argv[1]
 
 inf = ROOT.TFile(infile,'read')
 
 hvline = int(sys.argv[2])
 
 outfile = sys.argv[3]
 
bool append = False
 

Function Documentation

◆ DumpPathology()

def dumpHVPathFromNtuple.DumpPathology (   inf,
  hvline,
  outfile,
  append 
)

Definition at line 7 of file dumpHVPathFromNtuple.py.

7 def DumpPathology(inf, hvline, outfile, append):
8 
9  if not inf.IsOpen():
10  print('File not open ?')
11  return
12 
13  try:
14  if append:
15  fout=open(outfile,'a')
16  else:
17  fout=open(outfile,'w')
18  except Exception as e:
19  print('Could not open output file ',outfile)
20  print (e)
21  return
22 
23  tree=inf.Get("hv/mytree")
24  # start to dump the HV for the asked HVLine, first collect one line per cell
25  br_hvline=tree.GetBranch("HVline")
26  hvdict={}
27  for i in range(0,tree.GetEntries()):
28  if i%10000 == 0: print(i)
29  br_hvline.GetEntry(i)
30  if tree.HVline != hvline: continue
31  tree.GetEntry(i)
32  bec=tree.barrel_ec
33  side=tree.side
34  FT=tree.FT
35  slot=tree.slot
36  channel=tree.channel
37  idlist=[bec,side,FT,slot,channel]
38  if str(idlist) in hvdict: continue
39  hv=tree.hv
40  ihv=int(hv)
41  hvlist=[bec,side,FT,slot,channel,ihv]
42  hvdict[str(idlist)]=hvlist
43  pass
44  #print hvdict
45  # now write to a file
46  if not append: fout.write('/LAR/HVPathologiesOfl/Pathologies\n')
47  for k in list(hvdict.keys()):
48  ll=hvdict[k]
49  if len(ll) != 6:
50  print('Wrong list: ',ll,' continue to next!!!')
51  continue
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'
53  fout.write(wstr)
54  pass
55  fout.close()
56  return
57 

Variable Documentation

◆ append

bool dumpHVPathFromNtuple.append = False

Definition at line 91 of file dumpHVPathFromNtuple.py.

◆ hvline

dumpHVPathFromNtuple.hvline = int(sys.argv[2])

Definition at line 72 of file dumpHVPathFromNtuple.py.

◆ inf

dumpHVPathFromNtuple.inf = ROOT.TFile(infile,'read')

Definition at line 63 of file dumpHVPathFromNtuple.py.

◆ infile

dumpHVPathFromNtuple.infile = sys.argv[1]

Definition at line 62 of file dumpHVPathFromNtuple.py.

◆ outfile

string dumpHVPathFromNtuple.outfile = sys.argv[3]

Definition at line 83 of file dumpHVPathFromNtuple.py.

CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
dumpHVPathFromNtuple.DumpPathology
def DumpPathology(inf, hvline, outfile, append)
Definition: dumpHVPathFromNtuple.py:7
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70