4 edLogger = logging.getLogger(
"EventDensityConfig" )
5 from AthenaConfiguration.ComponentFactory
import CompFactory
8 """ Get the name of the event shape container for a given jet def or jet constit def.
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
15 We normalize all variations here.
18 from JetRecConfig.JetDefinition
import JetDefinition,JetInputConstit
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
27 label = defOrLabel.replace(
'_',
'')
31 nameprefix = nameprefix
or ""
33 return f
"{nameprefix}Kt{R}{label}{suffix}{tail}EventShape"
37 """Returns an EventDensityTool configured with input and output names build according to the given jet (or jet constituent) definition.
39 jetOrConstitdef can be a JetDefinition, JetInputConstit. The input PseudoJetContainer name and output EventShape name are build
40 using helper functions shared in other parts of the config (jet, trigger, egamma,...)
42 It is still possible to override any properties of the tool in the optionnal additionnal arguments.
44 from JetRecConfig.JetRecConfig
import getPJContName
47 toolProperties = dict(
53 AreaDefinition =
"Voronoi",
56 UseFourMomArea =
True,
59 toolProperties.update( options)
61 return CompFactory.EventDensityTool(name, **toolProperties)
65 """ Returns an Athena alg copying EventShape objects with old key/names to objects with new key/names
68 from AthenaCommon.AppMgr
import ToolSvc
69 t= CompFactory.EventShapeCopier( input+alg+
"EvtShapeCopier",
70 InputEventShape=input+
"EventShape",
71 OutputEventShape=alg+input+
"EventShape",
72 EventDensityName =
"DensityForJetsR" + alg[-1])
75 return CompFactory.EventDensityAlg(input+
"EventShapeCopierAlg", EventDensityTool = [ buildTool(
"Kt4"), buildTool(
"Kt6") ] )
82 edLogger.warning(
"When instantiating %s : call of EventDensityAlg is deprecated", name)
83 edLogger.warning(
" please use EventDensityAthAlg (from EventShapeTools.EventShapeToolsConf import EventDensityAthAlg) ")
84 alg = CompFactory.EventDensityAthAlg(name,EventDensityTool=EventDensityTool, **args)