ATLAS Offline Software
Classes | Functions | Variables
python.JetAnalysisCommon Namespace Reference

Classes

class  ComponentAccumulatorMockUp
 
class  ConfArray
 
class  Configured
 
class  ConfNameSpace
 

Functions

def stringPropValue (value)
 
def generateConfigured (classname, cppclass, prefix="")
 
def parOR (name)
 
def addManyAlgs (job, algList)
 
def mock_JetRecTools ()
 
def JetRecCfg_reorder (jetdef, flags, returnFinalJetDef=False)
 

Variables

 CompFactory = ConfNameSpace()
 
 ComponentFactory = ModuleType("ComponentFactory")
 
 isComponentAccumulatorCfg
 
 CFElements = ModuleType("CFElements")
 
 parOR
 
 ComponentAccumulator = ModuleType("ComponentAccumulator")
 
 JetAnalysisCommon = sys.modules[__name__]
 
 JetRecCfg_original
 

Function Documentation

◆ addManyAlgs()

def python.JetAnalysisCommon.addManyAlgs (   job,
  algList 
)
a little configuration function added from the python module JetAnalysisCommon.py to easily schedule
# a list of Configured algs as defined by this module.

Definition at line 310 of file JetAnalysisCommon.py.

310 def addManyAlgs(job, algList):
311  """a little configuration function added from the python module JetAnalysisCommon.py to easily schedule
312  # a list of Configured algs as defined by this module."""
313  for alg in algList:
314  job.algsAdd( alg.asAnaAlg() )
315 
316 ROOT.EL.Job.addManyAlgs = addManyAlgs
317 
318 
319 #*******************************************************************
320 # hack the list of modules in sys so that the Athena config modules are found and redirected
321 # to what we have defined in this module

◆ generateConfigured()

def python.JetAnalysisCommon.generateConfigured (   classname,
  cppclass,
  prefix = "" 
)

Definition at line 189 of file JetAnalysisCommon.py.

189 def generateConfigured(classname, cppclass, prefix=""):
190  import cppyy
191 
192  # get an instance of the class :
193  if issubclass(cppclass, cppyy.gbl.asg.IAsgTool):
194  dummy = cppclass('dummy')
195  else: # then it's an Algorithm
196  dummy = cppclass('dummy', 0)
197 
198  # find all the properties of the Tool/Algorithm
199  allowedProp = Configured._allowed + [k for k,v in dummy.getPropertyMgr().getProperties() ]
200  # generate the class derived from Configured for this Tool/Alg
201  klass=type(classname+'Conf', (Configured,), dict(_allowed=allowedProp,
202  type=prefix+classname,_cppclass=cppclass) )
203 
204  return klass
205 

◆ JetRecCfg_reorder()

def python.JetAnalysisCommon.JetRecCfg_reorder (   jetdef,
  flags,
  returnFinalJetDef = False 
)
Builds the algs with JetRecConfig.JetRecCfg and then make sure
they are in proper order.
Re-ordering is done manually, according to various input alg type.

Definition at line 351 of file JetAnalysisCommon.py.

351 def JetRecCfg_reorder(jetdef, flags, returnFinalJetDef=False):
352  """Builds the algs with JetRecConfig.JetRecCfg and then make sure
353  they are in proper order.
354  Re-ordering is done manually, according to various input alg type.
355  """
356  res = JetRecConfig.JetRecCfg_original(flags, jetdef , returnFinalJetDef)
357 
358  acc , _ = res if returnFinalJetDef else (res,None)
359  algs = acc.algs
360 
361  # ************
362  # reorder EventDensity and PseudoJetAlg
363  if not hasattr(ROOT, 'EventDensityAthAlg'):
364  return res
365  evtDensityAlgs = [ (i,alg) for (i,alg) in enumerate(algs) if alg._cppclass == ROOT.EventDensityAthAlg ]
366  pjAlgs = [ (i,alg) for (i,alg) in enumerate(algs) if alg._cppclass == ROOT.PseudoJetAlgorithm ]
367  pairsToswap = []
368  for i,edalg in evtDensityAlgs:
369  edInput = edalg.EventDensityTool.InputContainer
370  for j,pjalg in pjAlgs:
371  if j<i: continue
372  if edInput == pjalg.OutputContainer:
373  pairsToswap.append( (i,j) )
374  for (i,j) in pairsToswap:
375  algs[i], algs[j] = algs[j], algs[i]
376 
377  # ************
378  # if there were other types of alg which need re-rordering
379  # we could add the specific re-ordering code below ...
380 
381  return res
382 
383 JetRecConfig.JetRecCfg = JetRecCfg_reorder

◆ mock_JetRecTools()

def python.JetAnalysisCommon.mock_JetRecTools ( )
Allows to ignore JetRecTools in case this package is not checked out on top of AnalysisBase

Definition at line 331 of file JetAnalysisCommon.py.

331 def mock_JetRecTools():
332  """Allows to ignore JetRecTools in case this package is not checked out on top of AnalysisBase"""
333  sys.modules['JetRecTools'] = ModuleType('JetRecTools')
334  sys.modules['JetRecTools.JetRecToolsConfig'] = ModuleType('JetRecToolsConfig')
335 
336 
337 
338 #*******************************************************************
339 # hacks specific to jets
340 

◆ parOR()

def python.JetAnalysisCommon.parOR (   name)

Definition at line 268 of file JetAnalysisCommon.py.

268 def parOR(name):
269  pass

◆ stringPropValue()

def python.JetAnalysisCommon.stringPropValue (   value)
Helper function producing a string property value

Definition at line 50 of file JetAnalysisCommon.py.

50 def stringPropValue( value ):
51  """Helper function producing a string property value"""
52 
53  stringValue = str( value )
54  if isinstance( value, bool ):
55  stringValue = str( int( value ) )
56  pass
57  return stringValue
58 

Variable Documentation

◆ CFElements

python.JetAnalysisCommon.CFElements = ModuleType("CFElements")

Definition at line 270 of file JetAnalysisCommon.py.

◆ CompFactory

python.JetAnalysisCommon.CompFactory = ConfNameSpace()

Definition at line 255 of file JetAnalysisCommon.py.

◆ ComponentAccumulator

python.JetAnalysisCommon.ComponentAccumulator = ModuleType("ComponentAccumulator")

Definition at line 302 of file JetAnalysisCommon.py.

◆ ComponentFactory

python.JetAnalysisCommon.ComponentFactory = ModuleType("ComponentFactory")

Definition at line 260 of file JetAnalysisCommon.py.

◆ isComponentAccumulatorCfg

python.JetAnalysisCommon.isComponentAccumulatorCfg

Definition at line 263 of file JetAnalysisCommon.py.

◆ JetAnalysisCommon

python.JetAnalysisCommon.JetAnalysisCommon = sys.modules[__name__]

Definition at line 323 of file JetAnalysisCommon.py.

◆ JetRecCfg_original

python.JetAnalysisCommon.JetRecCfg_original

Definition at line 350 of file JetAnalysisCommon.py.

◆ parOR

python.JetAnalysisCommon.parOR

Definition at line 271 of file JetAnalysisCommon.py.

SCT_Parameters::ModuleType
ModuleType
Enums for module and chip type.
Definition: SCT_ReadoutData.h:33
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.JetAnalysisCommon.stringPropValue
def stringPropValue(value)
Definition: JetAnalysisCommon.py:50
python.JetAnalysisCommon.mock_JetRecTools
def mock_JetRecTools()
Definition: JetAnalysisCommon.py:331
python.JetAnalysisCommon.parOR
def parOR(name)
Definition: JetAnalysisCommon.py:268
python.JetAnalysisCommon.JetRecCfg_reorder
def JetRecCfg_reorder(jetdef, flags, returnFinalJetDef=False)
Definition: JetAnalysisCommon.py:351
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.JetAnalysisCommon.generateConfigured
def generateConfigured(classname, cppclass, prefix="")
Definition: JetAnalysisCommon.py:189
str
Definition: BTagTrackIpAccessor.cxx:11
python.JetAnalysisCommon.addManyAlgs
def addManyAlgs(job, algList)
Definition: JetAnalysisCommon.py:310