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