ATLAS Offline Software
module_driven_slicing.py
Go to the documentation of this file.
1 #----------------------------------------------------------------------
2 # Imports with Arg Parsing before ROOT import because of help conflict
3 #----------------------------------------------------------------------
4 from __future__ import print_function
5 import argparse
6 
7 parser = argparse.ArgumentParser(description='Flattens Wrapper Files')
8 parser.add_argument('inname', metavar='inputfile', type=str, nargs='+',
9  help='input file name (should be FPGATrackSim Wrapper File)')
10 parser.add_argument('--evts', action='store', type=int,
11  help='number of events to process', default=(1<<30)) # default is large integer
12 parser.add_argument('--trim', action='store', type=float,
13  help='trim modules with less than given fraction of tracks', default=None) # default is large integer
14 parser.add_argument('--nslices', action='store', type=int,
15  help='number of slices to build', default=6)
16 parser.add_argument('--keylayer', action='store', type=str,
17  help='keylayer as det,bec,layer', default="strip,barrel,2")
18 parser.add_argument('--keylayer2', action='store', type=str,
19  help='second keylayer subdivides slices', default=None)
20 parser.add_argument('--outfilelabel', action='store', type=str,
21  help='label to start outfile with', default="Unlabled")
22 parser.add_argument('--etarange', action='store', type=str,
23  help='range of eta for slice', default="-100,100")
24 parser.add_argument('--fullgran', action='store_true')
25 parser.add_argument('--test1slice', action='store_true')
26 
27 args = parser.parse_args()
28 
29 
30 # imports
31 import ROOT
32 import time
33 import glob
34 import os
35 from collections import defaultdict
36 import bisect
37 
38 # Setup core logging here
39 from PyJobTransforms.trfLogger import msg
40 
41 
42 
43 #----------------------------------------------------------------------
44 # Handy tree of dictionary tools
45 #----------------------------------------------------------------------
46 defaultdictlambda=lambda : defaultdict(defaultdictlambda) # amazing self referential lambda
47 
48 def transformNodes(tree,func):
49  retv={}
50  for key,val in tree.items():
51  if 'dict' in type(val).__name__:
52  retv[key]=transformNodes(val,func)
53  else:
54  if 'list' in type(val).__name__:
55  retv[key]=[func(subval) for subval in val]
56  else:
57  retv[key]=func(val)
58  return retv
59 
60 
61 #----------------------------------------------------------------------
62 # Constants
63 #----------------------------------------------------------------------
64 dets=["pixel","strip"]
65 regs=["barrel","endcap"]
66 dirs=["phi","eta"]
67 
68 int2det = {1:"pixel", 0:"strip"}
69 det2int = {v:k for k,v in int2det.items()}
70 int2reg = {0:"barrel", 2:"endcap"}
71 reg2int = {v:k for k,v in int2reg.items()}
72 
73 # Number of rows per module
74 # diction levels: bec, layer, etamod
75 striprows={ 'barrel' : {0:[None]+[4]*14,
76  1:[None]+[4]*14,
77  2:[None]+[4]*14,
78  3:[None]+[4]*14,
79  4:[None]+[2]*14,
80  5:[None]+[2]*14,
81  6:[None]+[2]*14,
82  7:[None]+[2]*14},
83  'endcap' : {i:[4,4,2,4,2,2] for i in range(12)}
84 }
85 
86 # Number of chips per row
87 # diction levels: bec, etamod, row
88 abcchipsperrow={ 'barrel' : {i+1:[10,10,10,10] for i in range(14)}, # actually 2 rows for some but doesn't matter
89  'endcap' : {0:[8,8,9,9],
90  1:[10,10,11,11],
91  2:[12,12],
92  3:[14,14],
93  4:[8,8],
94  5:[9,9]} }
95 
96 stripsperabc=128
97 stripsperrow=transformNodes(abcchipsperrow, lambda x: x * stripsperabc)
98 
99 rowbounds={}
100 for reg in stripsperrow:
101  rowbounds[reg]={}
102  for mod in stripsperrow[reg]:
103  rowbounds[reg][mod]=[sum(stripsperrow[reg][mod][0:i+1]) for i in range(len(stripsperrow[reg][mod]))]
104 
105 
106 #guess geom from input file name
107 geom="Unknown"
108 if "ITK-22" in args.inname:
109  geom="ITK-22"
110 elif "ITK-23" in args.inname:
111  geom="ITK-23"
112 
113 # this is weird, number of layers in pixel endcaps?
114 layers={ "pixel": { "barrel":5, "endcap": 8 if geom=="ITK-22" else 8 }, "strip" : { "barrel":8, "endcap":12}}
115 
116 
117 #histograms
118 hists={}
119 
120 #easy hist booking
121 def getHist(name,makehist):
122  if name not in hists:
123  hists[name]=makehist(name)
124  return hists[name]
125 
126 
127 #----------------------------------------------------------------------
128 # Open file(s) for reading
129 #----------------------------------------------------------------------
130 # get list of files
131 fileList=args.inname
132 if len(args.inname)==1 and os.path.isdir(args.inname[0]):
133  fileList = glob.glob("%s/*.root" % args.inname)
134 
135 # make TChain
136 Data = ROOT.TChain("ExtrapolationEngineTest")
137 # add files to TChain
138 for file in fileList:
139  msg.info("Adding file %s" %(file))
140  Data.AddFile(file)
141 
142 num_entries = min(args.evts,Data.GetEntries())
143 msg.info("reading track input: %d entries\n" % (num_entries))
144 t0 = time.clock()
145 
146 #----------------------------------------------------------------------
147 # Parse keylayer description from input args
148 #----------------------------------------------------------------------
149 
150 def parseKeyLayer(keystring):
151  key={}
152  key_det,key_reg,key_lyr = keystring.split(",")
153  key["lyr"]=int(key_lyr)
154  key["det"]=det2int[key_det]
155  key["reg"]=reg2int[key_reg]
156  return key
157 
158 key1 = parseKeyLayer(args.keylayer)
159 key2 = None
160 if args.keylayer2:
161  key2 = parseKeyLayer(args.keylayer2)
162 
163 #----------------------------------------------------------------------
164 # Parse eta range description from input args
165 #----------------------------------------------------------------------
166 min_eta,max_eta = [float(s) for s in args.etarange.split(",")]
167 
168 
169 #----------------------------------------------------------------------
170 # Functions for geometry conversion
171 #----------------------------------------------------------------------
172 def getLayer(trk,hit_idx):
173  if trk.SensitiveIsPixel[hit_idx] == 0: #strip
174  layer = 2*trk.SensitiveLayerDisc[hit_idx]+trk.SensitiveSide[hit_idx]
175  else: #pixel
176  layer = trk.SensitiveLayerDisc[hit_idx]
177  return layer
178 
179 def getRow(trk,hit_idx): # returns localrow,globalrow
180 
181  strip = trk.SensitivePhiIndex[hit_idx]
182  bec=int2reg[abs(trk.SensitiveBarrelEndcap[hit_idx])]
183  layer=getLayer(trk,hit_idx)
184  etamod=trk.SensitiveEtaModule[hit_idx]
185  localrow,globalrow=None,None
186  r=trk.SensitivePosR[hit_idx]
187  z=trk.SensitivePosZ[hit_idx]
188 
189  # calculate row from strip
190  if trk.SensitiveIsPixel[hit_idx] == 0:
191 
192  if "strip_number" not in hists:
193  hists["strip_number"]=ROOT.TH2D("strip_number_hist",";module;strip",500,0,500,800,0,8000)
194  hists["strip_number"].Fill(reg2int[bec]*100+layer*10+etamod,strip)
195 
196  # this is a binned lookup to get the row number
197  localrow = bisect.bisect_left(rowbounds[bec][abs(etamod)],strip)
198 
199  rows_in_module=striprows[bec][layer][abs(etamod)]
200 
201  if localrow > rows_in_module:
202  msg.error("Error row(%d) greater than number of rows in module %d" %(localrow,rows_in_module))
203  globalrow=rows_in_module*etamod+localrow
204 
205 
206  if globalrow==6:
207  if "z_mod6" not in hists:
208  hists["z_mod6"]=ROOT.TH2D("z_mod6",";z;lyr",2500,0,500,10,0,10)
209  hists["z_mod6"].Fill(z,layer)
210 
211  else:
212  localrow=trk.SensitiveEtaModule[hit_idx]
213  globalrow=localrow
214  getHist("pixel_rz_layer"+str(layer),
215  lambda n: ROOT.TH2D(n,";z[mm]; r[mm]",3000,0,+3000,1000,0,1000)).Fill(z,r)
216 
217  return localrow,globalrow
218 
219 #--------------------------------------------------------------------------------
220 # Find module of track in key layer
221 #--------------------------------------------------------------------------------
222 
223 def isKeyLayer(trk,hit_idx,key):
224  if key["det"]!=trk.SensitiveIsPixel[hit_idx]:
225  return False
226  if key["reg"]!=abs(trk.SensitiveBarrelEndcap[hit_idx]):
227  return False
228  if getLayer(trk,hit_idx)!=key["lyr"]:
229  return False
230  return True
231 
232 
233 def findKeyLayerMod(trk,key):
234  # return None for events with two hits in keylayer
235  mixedrows=False
236  row=None
237  for hit_idx in range(len(trk.SensitivePosX)):
238  if isKeyLayer(trk,hit_idx,key):
239  rownew= getRow(trk,hit_idx)[1]
240  if row and (rownew!=row):
241  mixedrows=True
242  row = rownew
243  return row if not mixedrows else None
244 
245 
246 
247 
248 def trackToModules(trk):
249  modules = defaultdict(defaultdictlambda) # indexed on layer
250 
251  for hit_idx in range(len(trk.SensitivePosX)):
252  det = trk.SensitiveIsPixel[hit_idx]
253  reg = abs(trk.SensitiveBarrelEndcap[hit_idx])
254  lyr = getLayer(trk,hit_idx)
255  row = getRow(trk,hit_idx)[1]
256  phimod = trk.SensitivePhiModule[hit_idx]
257  r=trk.SensitivePosR[hit_idx]
258  z=trk.SensitivePosZ[hit_idx]
259  if reg==reg2int['barrel']:
260  if lyr not in modules[det][reg] or r < modules[det][reg][lyr][3]:
261  modules[det][reg][lyr]=(row,phimod,hit_idx,r,z)
262  else:
263  if lyr not in modules[det][reg] or z < modules[det][reg][lyr][4]:
264  modules[det][reg][lyr]=(row,phimod,hit_idx,r,z)
265 
266  for reg in modules[det2int['strip']]:
267  if reg==reg2int['barrel']:
268  varidx=3
269  else:
270  varidx=4
271 
272  varlast=10000 # large value
273  lastlyr=10000 # large value
274  for lyr in sorted(modules[det][reg].keys(),reverse=True):
275  if varlast < modules[det][reg][lyr][varidx]:
276  del modules[det][reg][lyr]
277  elif lyr+1==lastlyr and lyr%2==0 and (varlast-modules[det][reg][lyr][varidx]) > 10.0:
278  del modules[det][reg][lyr+1] # remove outer hit
279  else:
280  lastlyr=lyr
281  varlast=modules[det][reg][lyr][varidx]
282 
283 
284  return modules
285 
286 
287 #--------------------------------------------------------------------------------
288 # Parse Geometry
289 #--------------------------------------------------------------------------------
290 
291 
293  eta_vals_for_key_layer=set()
294  events=0
295  tracks_used=0
296  for trk in Data:
297  events = events + 1
298  if events>args.evts:
299  break
300 
301  # only process tracks in region
302  if trk.StartEta > max_eta or trk.StartEta < min_eta:
303  continue
304 
305  modules = trackToModules(trk)
306  if not key1["lyr"] in modules[key1["det"]][key1["reg"]]:
307  # no hit in layer
308  continue
309 
310  eta_vals_for_key_layer.add(modules[key1["det"]][key1["reg"]][key1["lyr"]][0])
311 
312  tracks_used+=1
313 
314  msg.info("%d eta rows:",len(eta_vals_for_key_layer))
315  msg.info(sorted(eta_vals_for_key_layer))
316  msg.info("Tracks Used = %d", tracks_used)
317  return eta_vals_for_key_layer
318 
319 
320 
321 #--------------------------------------------------------------------------------
322 # Define key layer in terms of modules
323 #--------------------------------------------------------------------------------
324 def divideKeyLayerModulesIntoSlices(eta_vals_for_key_layer):
325  key_modules_per_slice = float(len(eta_vals_for_key_layer))/nslices
326  key_modules_for_slices=[[]]
327 
328  for i,row in enumerate(sorted(eta_vals_for_key_layer)):
329  if i >= len(key_modules_for_slices)*key_modules_per_slice:
330  key_modules_for_slices.append([])
331  key_modules_for_slices[-1].append(row)
332 
333  msg.info("Modules in slices %d", key_modules_for_slices)
334 
335 
336 
337  # make a map of modules to slices
338  return {m:i for i,s in enumerate(key_modules_for_slices) for m in s }
339 
340 
341 
342 #--------------------------------------------------------------------------------
343 # Build List of Modules in Slices
344 #--------------------------------------------------------------------------------
345 
346 def getModuleToSliceMap(mod_slice_map):
347  slice_modules=defaultdict(lambda :
348  { det:{
349  reg:{
350  lyr:{
351  d:defaultdict(lambda:0) for d in dirs}
352  for lyr in range(layers[det][reg]) }
353  for reg in regs }
354  for det in dets })
355 
356  slice_hists={}
357  slice_tracks=defaultdict(lambda:0)
358  sliceid2int={}
359 
360  events=0
361  tracks_used=0
362  missing_keylayer_hit=0
363  for trk in Data:
364  events = events + 1
365  if events>args.evts:
366  break
367 
368  # only process tracks in region
369  if trk.StartEta > max_eta or trk.StartEta < min_eta:
370  continue
371 
372  modules = trackToModules(trk)
373 
374  if not key1["lyr"] in modules[key1["det"]][key1["reg"]]:
375  missing_keylayer_hit+=1
376  continue
377  mod1 = modules[key1["det"]][key1["reg"]][key1["lyr"]][0]
378  slicenum = mod_slice_map[mod1]
379  if args.test1slice and slicenum!=0:
380  continue
381 
382  if key2:
383  if not key2["lyr"] in modules[key2["det"]][key2["reg"]]:
384  missing_keylayer_hit+=1
385  continue
386  mod2 = modules[key2["det"]][key2["reg"]][key2["lyr"]][0]
387  slicenum=(slicenum,mod2)
388 
389 
390 
391  # add other modules to slice
392  for det in modules:
393  for reg in modules[det]:
394  for lyr in modules[det][reg]:
395  modidxs=modules[det][reg][lyr]
396  slice_modules[slicenum][int2det[det]][int2reg[reg]][lyr]["eta"][modidxs[0]]+=1
397  slice_modules[slicenum][int2det[det]][int2reg[reg]][lyr]["phi"][modidxs[1]]+=1
398 
399  hit_idx = modidxs[2]
400 
401  if slicenum not in slice_hists:
402  sliceid2int[slicenum]=len(slice_modules)-1
403  slice_hists[slicenum]=ROOT.TH2D("rz"+str(sliceid2int[slicenum]),"rz"+str(slicenum)+"; z[mm]; r[mm]",800,-200,+600,1000,0,1000)
404  slice_hists[slicenum].Fill(trk.SensitivePosZ[hit_idx],trk.SensitivePosR[hit_idx])
405 
406  hname=int2det[det]+"_"+int2reg[reg]+"_"+str(lyr)+"_"+str(modidxs[0])
407  if hname not in slice_hists:
408  slice_hists[hname]=ROOT.TH1D(hname,hname+"; z[mm]",800,-200,+600)
409  slice_hists[hname].Fill(trk.SensitivePosZ[hit_idx])
410 
411 
412  tracks_used+=1
413  slice_tracks[slicenum]+=1
414 
415  msg.info("Tracks Used=%d" %(tracks_used))
416  msg.info("%d tracks with no keylayer hit found or multiple hits in keylayer" %(int(str(missing_keylayer_hit))))
417 
418  for hist in slice_hists.values():
419  hist.Write()
420 
421  return slice_modules,sliceid2int,slice_tracks
422 
423 
424 
425 #--------------------------------------------------------------------------------
426 # Trimming
427 #--------------------------------------------------------------------------------
428 
429 def trimSlice(slice_modules,slice_tracks):
430 
431  for sliceid in slice_modules:
432  for det in dets:
433  for reg in regs:
434  for lyr in slice_modules[sliceid][det][reg]:
435  for mod in list(slice_modules[sliceid][det][reg][lyr]["eta"]):
436  if slice_modules[sliceid][det][reg][lyr]["eta"][mod]/float(slice_tracks[sliceid]) < args.trim:
437  del slice_modules[sliceid][det][reg][lyr]["eta"][mod]
438 
439 
440 #--------------------------------------------------------------------------------
441 # Write RMap File
442 #--------------------------------------------------------------------------------
443 def writeRMap(slice_modules,sliceid2int):
444  nslices=len(sliceid2int)
445  rmap = open(args.outfilelabel+'_KeyLayer-%s%s%s_NSlices-%d.rmap' % (
446  args.keylayer.replace(",","_"),
447  "_KeyLayer2-"+args.keylayer2.replace(",","_") if args.keylayer2 else "",
448  ("_trim_%1.3f" % (args.trim,)).replace(".","_") if args.trim else "",
449  nslices), 'w')
450 
451  rmap.write("towers "+str(nslices)+" phi 16\n\n")
452 
453  int2sliceid={v:k for k,v in sliceid2int.items()}
454  for i in range(len(slice_modules)):
455  rmap.write("\n%d \n" % i)
456  sliceid=int2sliceid[i]
457 
458  mindefault = lambda x,default=0: min(x) if len(x) else default
459  maxdefault = lambda x,default=0: max(x) if len(x) else default
460 
461  for det in dets:
462  for reg in regs:
463  for lyr in range(layers[det][reg]):
464  rmap.write("%d %d %d %d %d %d %d %d %d\n" % (
465  1 if det=="pixel" else 0,
466  1 if reg=="endcap" else 0,
467  lyr,
468  mindefault(slice_modules[sliceid][det][reg][lyr]["phi"].keys(),default=0),
469  maxdefault(slice_modules[sliceid][det][reg][lyr]["phi"].keys(),default=0),
470  len(slice_modules[sliceid][det][reg][lyr]["phi"]),
471  mindefault(slice_modules[sliceid][det][reg][lyr]["eta"].keys(),default=0),
472  maxdefault(slice_modules[sliceid][det][reg][lyr]["eta"].keys(),default=0),
473  len(slice_modules[sliceid][det][reg][lyr]["eta"])))
474 
475 
476  rmap.close()
477 
478 #--------------------------------------------------------------------------------
479 # Estimate duplication
480 #--------------------------------------------------------------------------------
481 def printOccupancies(slice_modules):
482 
483  duplication_count={
484  det:{
485  reg:{
486  lyr:defaultdict(lambda: 0) for lyr in range(layers[det][reg]) }
487  for reg in regs }
488  for det in dets }
489 
490  for sliceid in slice_modules:
491  for det in slice_modules[sliceid].keys():
492  for reg in slice_modules[sliceid][det].keys():
493  for lyr in slice_modules[sliceid][det][reg].keys():
494  for etamod in slice_modules[sliceid][det][reg][lyr]["eta"].keys():
495  duplication_count[det][reg][lyr][etamod]+=1
496 
497 
498  barrel_occupancies_4mrad_100mm={"pixel": [2.5,1.2,0.9,0.75,0.6],
499  "strip": [0.4,0.4,0.3,0.3,0.2,0.2,0.2,0.2]}
500  barrel_lengths={"pixel": [20,40,40,40,40],
501  "strip": [25,25,25,25,50,50,50,50]}
502  occupancies_per_module = {det:{reg: [] for reg in regs} for det in dets}
503  for det in dets:
504  for i in range(len(barrel_lengths[det])):
505  occupancies_per_module[det]['barrel'].append(barrel_occupancies_4mrad_100mm[det][i]*barrel_lengths[det][i]/float(100))
506 
507  occupancies_per_module[det]['endcap']=[0 for i in range(layers[det][reg])]
508 
509  layer_options = { "FPGATrackSimlike" : { "pixel" : [4], "strip":[0,2,3,4,5,6,7]},
510  "Outer5" : { "pixel" : [4], "strip":[0,2,4,6]},
511  "Inner5" : { "pixel" : [0,1,2,4,5], "strip":[]},
512  "Mid5" : { "pixel" : [2,4,5], "strip":[0,2]}}
513 
514  layer_options_occ = defaultdict(lambda:1)
515 
516  msg.info("%-5s %-6s %-5s %-12s %-10s %-10s" % ("","","","","min/max","min/max",))
517  msg.info("%-5s %-6s %-5s %-12s %-10s %-10s" % ("det","reg","lyr","duplication","modules","occupancy",))
518  for det in dets:
519  for reg in regs:
520  for lyr in range(layers[det][reg]):
521  dup=-1
522  if len(duplication_count[det][reg][lyr])!=0:
523  dup = sum(duplication_count[det][reg][lyr].values())/float(len(duplication_count[det][reg][lyr]))
524  occs = [occupancies_per_module[det][reg][lyr]*len(slice_modules[sliceid][det][reg][lyr]["eta"]) for sliceid in slice_modules]
525  lens = [len(slice_modules[sliceid][det][reg][lyr]["eta"]) for sliceid in slice_modules]
526 
527  for opt,config in layer_options.items():
528  if lyr in config[det]:
529  layer_options_occ[opt]*=sum(occs)/float(len(occs))
530 
531  msg.info("%5s %5s %-5d %2.2f [%2d,%2d] [%2.2f,%2.2f]" % (det,reg,lyr,dup,min(lens),max(lens),min(occs),max(occs)))
532 
533  msg.info("\nOccupancies:\n")
534  for opt,occ in layer_options_occ.items():
535  msg.info(opt,occ)
536 
537 
538 
539 #--------------------------------------------------------------------------------
540 # Plot Slices
541 #--------------------------------------------------------------------------------
542 def plotSlices(sliceid2int,slice_modules):
543 
544  events=0
545  for trk in Data:
546  events = events + 1
547  if events>args.evts:
548  break
549 
550  for hit_idx in range(len(trk.SensitivePosX)):
551  det = trk.SensitiveIsPixel[hit_idx]
552  reg = abs(trk.SensitiveBarrelEndcap[hit_idx])
553  lyr = getLayer(trk,hit_idx)
554  row = getRow(trk,hit_idx)[1]
555  r=trk.SensitivePosR[hit_idx]
556  z=trk.SensitivePosZ[hit_idx]
557 
558  for sliceid,modules in slice_modules.items():
559  hist = getHist("slice_{}_rz".format(sliceid2int[sliceid]),
560  lambda n: ROOT.TH2D(n,"; z[mm]; r[mm]",3500,-500,+3000,1000,0,1000))
561 
562  if row in modules[int2det[det]][int2reg[reg]][lyr]["eta"]:
563  hist.Fill(z,r)
564 
565 
566 
567 #--------------------------------------------------------------------------------
568 # Main
569 #--------------------------------------------------------------------------------
570 
571 histfile = ROOT.TFile("test.root",'recreate')
572 
573 eta_vals_for_key_layer=parseGeometry()
574 
575 nslices=args.nslices
576 
577 if args.fullgran:
578  nslices=len(eta_vals_for_key_layer)
579 
580 mod_slice_map = divideKeyLayerModulesIntoSlices(eta_vals_for_key_layer)
581 
582 slice_modules,sliceid2int,slice_tracks= getModuleToSliceMap(mod_slice_map)
583 
584 if key2:
585  msg.info("%d, two layers slices found"%(len(slice_modules)))
586  for x in slice_modules.keys():
587  msg.info(x)
588 
589 if args.trim: trimSlice(slice_modules,slice_tracks)
590 
591 writeRMap(slice_modules,sliceid2int)
592 
593 printOccupancies(slice_modules)
594 
595 plotSlices(sliceid2int,slice_modules)
596 
597 for hist in hists.values():
598  hist.Write()
599 histfile.Close()
600 
601 
module_driven_slicing.trackToModules
def trackToModules(trk)
Definition: module_driven_slicing.py:248
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
module_driven_slicing.findKeyLayerMod
def findKeyLayerMod(trk, key)
Definition: module_driven_slicing.py:233
module_driven_slicing.type
type
Definition: module_driven_slicing.py:8
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
module_driven_slicing.getRow
def getRow(trk, hit_idx)
Definition: module_driven_slicing.py:179
module_driven_slicing.transformNodes
def transformNodes(tree, func)
Definition: module_driven_slicing.py:48
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
module_driven_slicing.getLayer
def getLayer(trk, hit_idx)
Definition: module_driven_slicing.py:172
module_driven_slicing.divideKeyLayerModulesIntoSlices
def divideKeyLayerModulesIntoSlices(eta_vals_for_key_layer)
Definition: module_driven_slicing.py:324
module_driven_slicing.isKeyLayer
def isKeyLayer(trk, hit_idx, key)
Definition: module_driven_slicing.py:223
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
module_driven_slicing.parseGeometry
def parseGeometry()
Definition: module_driven_slicing.py:292
module_driven_slicing.plotSlices
def plotSlices(sliceid2int, slice_modules)
Definition: module_driven_slicing.py:542
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
module_driven_slicing.getModuleToSliceMap
def getModuleToSliceMap(mod_slice_map)
Definition: module_driven_slicing.py:346
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
module_driven_slicing.printOccupancies
def printOccupancies(slice_modules)
Definition: module_driven_slicing.py:481
module_driven_slicing.getHist
def getHist(name, makehist)
Definition: module_driven_slicing.py:121
Trk::open
@ open
Definition: BinningType.h:40
module_driven_slicing.writeRMap
def writeRMap(slice_modules, sliceid2int)
Definition: module_driven_slicing.py:443
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
module_driven_slicing.trimSlice
def trimSlice(slice_modules, slice_tracks)
Definition: module_driven_slicing.py:429
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
module_driven_slicing.parseKeyLayer
def parseKeyLayer(keystring)
Definition: module_driven_slicing.py:150
readCCLHist.float
float
Definition: readCCLHist.py:83