5def getEventShapeName( defOrLabel, nameprefix="", suffix=None, radius=0.4):
6 """ Get the name of the event shape container for a given jet def or jet constit def.
7
8 It's typically like "Kt4EMPFlowEventShape"
9 But there can be many variations :
10 - nameprefix can be "HLT_"
11 - suffix can be EMPFlowPUSB for pu side-band
12
13 We normalize all variations here.
14 """
15
16 from JetRecConfig.JetDefinition import JetDefinition,JetInputConstit
17 tail=''
18 if isinstance(defOrLabel, JetDefinition):
19 label = defOrLabel.inputdef.label
20 if 'NoPtCut' not in defOrLabel.infix and 'LowPt' not in defOrLabel.infix:
21 tail = defOrLabel.infix or ''
22 elif isinstance(defOrLabel, JetInputConstit):
23 label = defOrLabel.label
24 else:
25 label = defOrLabel.replace('_','')
26
27 R = str(int(10*radius))
28 suffix = suffix or ""
29 nameprefix = nameprefix or ""
30
31 return f"{nameprefix}Kt{R}{label}{suffix}{tail}EventShape"
32
33