ATLAS Offline Software
Loading...
Searching...
No Matches
python.JetDefinition.JetModifier Class Reference
Inheritance diagram for python.JetDefinition.JetModifier:
Collaboration diagram for python.JetDefinition.JetModifier:

Public Member Functions

 __init__ (self, tooltype, toolname, createfn=None, filterfn=_condAlwaysPass, prereqs=[], modspec=None, **properties)
 tooltype (self)
 toolname (self)
 createfn (self)
 modspec (self)
 prereqs (self)
 filterfn (self)
 properties (self)
 __hash__ (self)
 __eq__ (self, rhs)
 __ne__ (self, rhs)
 __str__ (self)
 getGenericModifier (self, jetdef, modspec)

Public Attributes

 tooltype = tooltype
 toolname = toolname
 createfn = self.getGenericModifier
 modspec = modspec
 prereqs = prereqs
 filterfn = filterfn
 properties = properties

Static Private Attributes

 __repr__ = __str__

Detailed Description

Helper to define the config of a IJetModifier tool.
Tools that typically have more complex properties set should have
their own dedicated helper 'createfn' functions defined

Definition at line 253 of file JetDefinition.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetDefinition.JetModifier.__init__ ( self,
tooltype,
toolname,
createfn = None,
filterfn = _condAlwaysPass,
prereqs = [],
modspec = None,
** properties )

Definition at line 258 of file JetDefinition.py.

263 ):
264 # For the easy cases where no helper function is needed.
265 # They will be ignored in the case of a helper,
266 # but are still required such that it's obvious what
267 # the tool name and type are when defining the config.
268 self.tooltype = tooltype
269 self.toolname = toolname
270
271 # The helper function may take 2 parameters:
272 # a "modifier specification" string and the jet
273 # definition
274
275 # The helper function always returns the desired
276 # modifier, and a ComponentAccumulator instance,
277 # in case additional supporting tools/services
278 # need to be set up.
279 if createfn is None:
280 self.createfn = self.getGenericModifier
281 else:
282 self.createfn = createfn
283 self.modspec = modspec
284
285 # Prereqs is normally a list.
286 # However, in special cases, the prereqs may
287 # depend on either or both of modspec and jetdef,
288 # in which case a helper function can be defined.
289 self.prereqs = prereqs
290
291 # a function taking a CondFlags as argument and deciding if this JetModifier is compatible
292 # with the conditions.
293 # The function must return a tuple : (bool, "reason of failure")
294 self.filterfn = filterfn
295
296 # These will be set as the Gaudi properties of the C++ tool
297 self.properties = properties
298
299
300
301

Member Function Documentation

◆ __eq__()

python.JetDefinition.JetModifier.__eq__ ( self,
rhs )

Definition at line 322 of file JetDefinition.py.

322 def __eq__(self,rhs):
323 return self.__hash__() == rhs.__hash__()
324

◆ __hash__()

python.JetDefinition.JetModifier.__hash__ ( self)

Definition at line 319 of file JetDefinition.py.

319 def __hash__(self):
320 return hash((self.toolname,self.tooltype,self.createfn.__name__,self.modspec,str(self.prereqs)))
321

◆ __ne__()

python.JetDefinition.JetModifier.__ne__ ( self,
rhs )

Definition at line 325 of file JetDefinition.py.

325 def __ne__(self,rhs):
326 return (not self.__eq__(rhs))
327

◆ __str__()

python.JetDefinition.JetModifier.__str__ ( self)

Definition at line 329 of file JetDefinition.py.

329 def __str__(self):
330 return "JetModifier({0}/{1})".format(self.tooltype,self.toolname)

◆ createfn()

python.JetDefinition.JetModifier.createfn ( self)

Definition at line 307 of file JetDefinition.py.

307 def createfn(self):pass

◆ filterfn()

python.JetDefinition.JetModifier.filterfn ( self)

Definition at line 313 of file JetDefinition.py.

313 def filterfn(self):pass

◆ getGenericModifier()

python.JetDefinition.JetModifier.getGenericModifier ( self,
jetdef,
modspec )
returns a real tool instance accoding to this definition : simply instantiating from
class self.tooltype and with name self.toolname ( actually : self.toolname.format(modspec) )
Since this function will be called as a callback from JetRecConfig as 'func(jetdef, modspec)', it must accept
the jetdef argument, even if unused in this case.

Definition at line 334 of file JetDefinition.py.

334 def getGenericModifier(self,jetdef, modspec):
335 """returns a real tool instance accoding to this definition : simply instantiating from
336 class self.tooltype and with name self.toolname ( actually : self.toolname.format(modspec) )
337 Since this function will be called as a callback from JetRecConfig as 'func(jetdef, modspec)', it must accept
338 the jetdef argument, even if unused in this case.
339 """
340 from AthenaConfiguration.ComponentFactory import CompFactory
341 name = self.toolname.format(modspec=modspec)
342 tool = CompFactory.getComp(self.tooltype)(name)
343 return tool
344
345
346
347

◆ modspec()

python.JetDefinition.JetModifier.modspec ( self)

Definition at line 309 of file JetDefinition.py.

309 def modspec(self):pass

◆ prereqs()

python.JetDefinition.JetModifier.prereqs ( self)

Definition at line 311 of file JetDefinition.py.

311 def prereqs(self):pass

◆ properties()

python.JetDefinition.JetModifier.properties ( self)

Definition at line 315 of file JetDefinition.py.

315 def properties(self):pass
316
317
318

◆ toolname()

python.JetDefinition.JetModifier.toolname ( self)

Definition at line 305 of file JetDefinition.py.

305 def toolname(self):pass

◆ tooltype()

python.JetDefinition.JetModifier.tooltype ( self)

Definition at line 303 of file JetDefinition.py.

303 def tooltype(self):pass

Member Data Documentation

◆ __repr__

python.JetDefinition.JetModifier.__repr__ = __str__
staticprivate

Definition at line 332 of file JetDefinition.py.

◆ createfn

python.JetDefinition.JetModifier.createfn = self.getGenericModifier

Definition at line 280 of file JetDefinition.py.

◆ filterfn

python.JetDefinition.JetModifier.filterfn = filterfn

Definition at line 294 of file JetDefinition.py.

◆ modspec

python.JetDefinition.JetModifier.modspec = modspec

Definition at line 283 of file JetDefinition.py.

◆ prereqs

python.JetDefinition.JetModifier.prereqs = prereqs

Definition at line 289 of file JetDefinition.py.

◆ properties

python.JetDefinition.JetModifier.properties = properties

Definition at line 297 of file JetDefinition.py.

◆ toolname

python.JetDefinition.JetModifier.toolname = toolname

Definition at line 269 of file JetDefinition.py.

◆ tooltype

python.JetDefinition.JetModifier.tooltype = tooltype

Definition at line 268 of file JetDefinition.py.


The documentation for this class was generated from the following file: