3 JetGrooming: A module for classes encoding definitions of objects
4 for configuring jet grooming
5 Author: TJ Khoo. P-A Delsart
8 __all__ = [
"GroomingDefinition",
"JetTrimming",
"JetSoftDrop"]
10 from AthenaCommon
import Logging
11 from .Utilities
import make_lproperty, onlyAttributesAreProperties, clonable, ldict
12 from copy
import deepcopy
13 jetlog = Logging.logging.getLogger(
'JetGrooming')
16 @onlyAttributesAreProperties
18 """ Base class to define grooming procedure.
19 Concrete classes will have to define the tooltype & groomalg class members
20 and aslo a groomSpecAsStr() function.
23 _allowedattributes = [
'_cflags',
'_contextDic']
37 if lock: properties =
ldict(properties)
40 context = context
if context
is not None else ungroomeddef.context
60 return self.
__hash__() == rhs.__hash__()
63 return (
not self.
__eq__(rhs))
77 result = cls.__new__(cls)
78 memo[
id(self)] = result
79 set_without_deepcopy = [
'_cflags']
80 for k, v
in self.__dict__.
items():
81 if k
in set_without_deepcopy:
86 setattr(result, k, deepcopy(v, memo))
112 raise Exception(
"Can not use a GroomingDefinition instance : use a derived class")
134 tooltype =
"JetGrooming::JetTrimming"
138 from .JetDefinition
import formatRvalue
141 groomstr =
"TrimmedPtFrac{}SmallR{}".
format(ptfrac,smallR)
146 groomalg =
"SoftDrop"
147 tooltype =
"JetGrooming::SoftDrop"
152 groomstr =
"SoftDropBeta{}Zcut{}".
format(beta,zcut)