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=None, 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 if prereqs is not None else []
 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 257 of file JetDefinition.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 262 of file JetDefinition.py.

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

Member Function Documentation

◆ __eq__()

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

Definition at line 326 of file JetDefinition.py.

326 def __eq__(self,rhs):
327 return self.__hash__() == rhs.__hash__()
328

◆ __hash__()

python.JetDefinition.JetModifier.__hash__ ( self)

Definition at line 323 of file JetDefinition.py.

323 def __hash__(self):
324 return hash((self.toolname,self.tooltype,self.createfn.__name__,self.modspec,str(self.prereqs)))
325

◆ __ne__()

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

Definition at line 329 of file JetDefinition.py.

329 def __ne__(self,rhs):
330 return (not self.__eq__(rhs))
331

◆ __str__()

python.JetDefinition.JetModifier.__str__ ( self)

Definition at line 333 of file JetDefinition.py.

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

◆ createfn()

python.JetDefinition.JetModifier.createfn ( self)

Definition at line 311 of file JetDefinition.py.

311 def createfn(self):pass

◆ filterfn()

python.JetDefinition.JetModifier.filterfn ( self)

Definition at line 317 of file JetDefinition.py.

317 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 338 of file JetDefinition.py.

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

◆ modspec()

python.JetDefinition.JetModifier.modspec ( self)

Definition at line 313 of file JetDefinition.py.

313 def modspec(self):pass

◆ prereqs()

python.JetDefinition.JetModifier.prereqs ( self)

Definition at line 315 of file JetDefinition.py.

315 def prereqs(self):pass

◆ properties()

python.JetDefinition.JetModifier.properties ( self)

Definition at line 319 of file JetDefinition.py.

319 def properties(self):pass
320
321
322

◆ toolname()

python.JetDefinition.JetModifier.toolname ( self)

Definition at line 309 of file JetDefinition.py.

309 def toolname(self):pass

◆ tooltype()

python.JetDefinition.JetModifier.tooltype ( self)

Definition at line 307 of file JetDefinition.py.

307 def tooltype(self):pass

Member Data Documentation

◆ __repr__

python.JetDefinition.JetModifier.__repr__ = __str__
staticprivate

Definition at line 336 of file JetDefinition.py.

◆ createfn

python.JetDefinition.JetModifier.createfn = self.getGenericModifier

Definition at line 284 of file JetDefinition.py.

◆ filterfn

python.JetDefinition.JetModifier.filterfn = filterfn

Definition at line 298 of file JetDefinition.py.

◆ modspec

python.JetDefinition.JetModifier.modspec = modspec

Definition at line 287 of file JetDefinition.py.

◆ prereqs

python.JetDefinition.JetModifier.prereqs = prereqs if prereqs is not None else []

Definition at line 293 of file JetDefinition.py.

◆ properties

python.JetDefinition.JetModifier.properties = properties

Definition at line 301 of file JetDefinition.py.

◆ toolname

python.JetDefinition.JetModifier.toolname = toolname

Definition at line 273 of file JetDefinition.py.

◆ tooltype

python.JetDefinition.JetModifier.tooltype = tooltype

Definition at line 272 of file JetDefinition.py.


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