ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.AsgAnalysisConfig.CommonServicesConfig Class Reference
Inheritance diagram for python.AsgAnalysisConfig.CommonServicesConfig:
Collaboration diagram for python.AsgAnalysisConfig.CommonServicesConfig:

Public Member Functions

def __init__ (self)
 
def makeAlgs (self, config)
 

Public Attributes

 runSystematics
 

Detailed Description

the ConfigBlock for common services

The idea here is that all algorithms need some common services, and I should
provide configuration blocks for those.  For now there is just a single
block, but in the future I might break out e.g. the systematics service.

Definition at line 19 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AsgAnalysisConfig.CommonServicesConfig.__init__ (   self)

Definition at line 27 of file AsgAnalysisConfig.py.

27  def __init__ (self) :
28  super (CommonServicesConfig, self).__init__ ()
29  self.addOption ('runSystematics', None, type=bool,
30  info="whether to turn on the computation of systematic variations. "
31  "The default is to run them on MC.")
32  self.addOption ('filterSystematics', None, type=str,
33  info="a regexp string against which the systematics names will be "
34  "matched. Only positive matches are retained and used in the evaluation "
35  "of the various algorithms.")
36  self.addOption ('onlySystematicsCategories', None, type=list,
37  info="a list of strings defining categories of systematics to enable "
38  "(only recommended for studies / partial ntuple productions). Choose amongst: "
39  "jets, electrons, muons, photons, taus, met, ftag, event. This option is overridden "
40  "by 'filterSystematics'.")
41  self.addOption ('systematicsHistogram', None , type=str,
42  info="the name (string) of the histogram to which a list of executed "
43  "systematics will be printed. The default is None (don't write out "
44  "the histogram).")
45 

Member Function Documentation

◆ makeAlgs()

def python.AsgAnalysisConfig.CommonServicesConfig.makeAlgs (   self,
  config 
)

Definition at line 46 of file AsgAnalysisConfig.py.

46  def makeAlgs (self, config) :
47 
48  sysService = config.createService( 'CP::SystematicsSvc', 'SystematicsSvc' )
49 
50  if config.dataType() is not DataType.Data:
51  if self.runSystematics is not None :
52  runSystematics = self.runSystematics
53  elif config.noSystematics() is not None :
54  # if option not set:
55  # check to see if set in config accumulator
56  self.runSystematics = not config.noSystematics()
57  runSystematics = self.runSystematics
58  else :
59  runSystematics = True
60  else:
61  runSystematics = False
62  if runSystematics :
63  sysService.sigmaRecommended = 1
64  if self.onlySystematicsCategories is not None:
65  # Convert strings to enums and validate
66  requested_categories = []
67  for category_str in self.onlySystematicsCategories:
68  try:
69  category_enum = SystematicsCategories[category_str.upper()]
70  requested_categories += category_enum.value
71  except KeyError:
72  raise ValueError(f"Invalid systematics category passed to option 'onlySystematicsCategories': {category_str}. Must be one of {', '.join(category.name for category in SystematicsCategories)}")
73  # Construct regex pattern as logical-OR of category names
74  if len(requested_categories):
75  sysService.systematicsRegex = "^(?=.*(" + "|".join(requested_categories) + ")|$).*"
76  if self.filterSystematics is not None:
77  sysService.systematicsRegex = self.filterSystematics
78  config.createService( 'CP::SelectionNameSvc', 'SelectionNameSvc')
79 
80  if self.systematicsHistogram is not None:
81  sysDumper = config.createAlgorithm( 'CP::SysListDumperAlg', 'SystematicsPrinter' )
82  sysDumper.histogramName = self.systematicsHistogram
83 
84 

Member Data Documentation

◆ runSystematics

python.AsgAnalysisConfig.CommonServicesConfig.runSystematics

Definition at line 56 of file AsgAnalysisConfig.py.


The documentation for this class was generated from the following file:
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18