4 from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
5 from AthenaConfiguration.Enums
import LHCPeriod
6 from AnalysisAlgorithmsConfig.ConfigAccumulator
import DataType
11 ELECTRONS = [
'EG_',
'EL_']
13 PHOTONS = [
'EG_',
'PH_']
16 EVENT = [
'GEN_',
'PRW_']
20 """the ConfigBlock for common services
22 The idea here is that all algorithms need some common services, and I should
23 provide configuration blocks for those. For now there is just a single
24 block, but in the future I might break out e.g. the systematics service.
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 "
48 sysService = config.createService(
'CP::SystematicsSvc',
'SystematicsSvc' )
50 if config.dataType()
is not DataType.Data:
53 elif config.noSystematics()
is not None :
61 runSystematics =
False
63 sysService.sigmaRecommended = 1
64 if self.onlySystematicsCategories
is not None:
66 requested_categories = []
67 for category_str
in self.onlySystematicsCategories:
69 category_enum = SystematicsCategories[category_str.upper()]
70 requested_categories += category_enum.value
72 raise ValueError(f
"Invalid systematics category passed to option 'onlySystematicsCategories': {category_str}. Must be one of {', '.join(category.name for category in SystematicsCategories)}")
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')
80 if self.systematicsHistogram
is not None:
81 sysDumper = config.createAlgorithm(
'CP::SysListDumperAlg',
'SystematicsPrinter' )
82 sysDumper.histogramName = self.systematicsHistogram
86 """Print what branches are used in analysis"""
90 self.addOption(
"printOption",
"Summary", type=str,
91 info=
'option to pass the standard ROOT printing function. Can be "Summary", "ByEntries" or "ByBytes".')
94 alg = config.createAlgorithm(
'CP::IOStatsAlg',
'IOStatsAlg')
95 alg.printOption = self.printOption
99 """the ConfigBlock for pileup reweighting"""
102 super (PileupReweightingBlock, self).__init__ ()
103 self.addOption (
'campaign',
None, type=
None,
104 info=
"the MC campaign for the PRW auto-configuration.")
105 self.addOption (
'files',
None, type=
None,
106 info=
"the input files being processed (list of strings). "
107 "Alternative to auto-configuration.")
108 self.addOption (
'useDefaultConfig',
True, type=bool,
109 info=
"whether to use the central PRW files. The default is True.")
110 self.addOption (
'userLumicalcFiles',
None, type=
None,
111 info=
"user-provided lumicalc files (list of strings). Alternative "
112 "to auto-configuration.")
113 self.addOption (
'userLumicalcFilesPerCampaign',
None, type=
None,
114 info=
"user-provided lumicalc files (dictionary of list of strings, "
115 "with MC campaigns as the keys). Alternative to auto-configuration.")
116 self.addOption (
'userPileupConfigs',
None, type=
None,
117 info=
"user-provided PRW files (list of strings). Alternative to "
118 "auto-configuration. Alternative to auto-configuration.")
119 self.addOption (
'userPileupConfigsPerCampaign',
None, type=
None,
120 info=
"user-provided PRW files (dictionary of list of strings, with "
121 "MC campaigns as the keys)")
126 from Campaigns.Utils
import Campaign
129 from AthenaCommon.Logging
import logging
132 log = logging.getLogger(
'makePileupAnalysisSequence')
134 if config.isPhyslite():
136 log.info(f
'Physlite does not need pileup reweighting. Variables will be copied from input instead. {config.isPhyslite}')
137 config.addOutputVar (
'EventInfo',
'runNumber',
'runNumber', noSys=
True)
138 config.addOutputVar (
'EventInfo',
'eventNumber',
'eventNumber', noSys=
True)
139 if config.dataType()
is not DataType.Data:
140 config.addOutputVar (
'EventInfo',
'mcChannelNumber',
'mcChannelNumber', noSys=
True)
141 config.addOutputVar (
'EventInfo',
'PileupWeight_%SYS%',
'weight_pileup')
142 if config.geometry()
is LHCPeriod.Run2:
143 config.addOutputVar (
'EventInfo',
'beamSpotWeight',
'weight_beamspot', noSys=
True)
147 if self.
files is None and config.autoconfigFlags()
is not None:
148 self.
files = config.autoconfigFlags().Input.Files
150 campaign = self.campaign
153 if config.dataType()
is not DataType.Data
and self.campaign
is None:
155 if config.campaign()
is not None and config.campaign()
is not Campaign.Unknown:
156 campaign = config.campaign()
157 log.info(f
'Auto-configuring campaign for PRW from flags: {campaign.value}')
160 if self.
files is not None:
161 from Campaigns.Utils
import getMCCampaign
163 if campaign
and campaign
is not Campaign.Unknown:
164 log.info(f
'Auto-configuring campaign for PRW from files: {campaign.value}')
166 log.info(
'Campaign could not be determined.')
170 toolLumicalcFiles = []
173 if config.dataType()
is not DataType.Data:
175 if self.userPileupConfigs
is not None and self.userPileupConfigsPerCampaign
is not None:
176 raise ValueError(
'Both userPileupConfigs and userPileupConfigsPerCampaign specified, '
177 'use only one of the options!')
178 if self.userPileupConfigsPerCampaign
is not None:
180 raise Exception(
'userPileupConfigsPerCampaign requires campaign to be configured!')
181 if campaign
is Campaign.Unknown:
182 raise Exception(
'userPileupConfigsPerCampaign used, but campaign = Unknown!')
184 toolConfigFiles = self.userPileupConfigsPerCampaign[campaign.value][:]
185 log.info(
'Using user provided per-campaign PRW configuration')
186 except KeyError
as e:
187 raise KeyError(f
'Unconfigured campaign {e} for userPileupConfigsPerCampaign!')
189 elif self.userPileupConfigs
is not None:
190 toolConfigFiles = self.userPileupConfigs[:]
191 log.info(
'Using user provided PRW configuration')
194 from PileupReweighting.AutoconfigurePRW
import getConfigurationFiles
195 if campaign
and campaign
is not Campaign.Unknown:
198 useDefaultConfig=self.useDefaultConfig,
199 data_type=config.dataType())
200 if self.useDefaultConfig:
201 log.info(
'Auto-configuring universal/default PRW config')
203 log.info(
'Auto-configuring per-sample PRW config files based on input files')
205 log.info(
'No campaign specified, no PRW config files configured')
208 if self.userLumicalcFilesPerCampaign
is not None and self.userLumicalcFiles
is not None:
209 raise ValueError(
'Both userLumicalcFiles and userLumicalcFilesYear specified, '
210 'use only one of the options!')
211 if self.userLumicalcFilesPerCampaign
is not None:
213 toolLumicalcFiles = self.userLumicalcFilesPerCampaign[campaign.value][:]
214 log.info(
'Using user-provided per-campaign lumicalc files')
215 except KeyError
as e:
216 raise KeyError(f
'Unconfigured campaign {e} for userLumicalcFilesPerCampaign!')
217 elif self.userLumicalcFiles
is not None:
218 toolLumicalcFiles = self.userLumicalcFiles[:]
219 log.info(
'Using user-provided lumicalc files')
221 if campaign
and campaign
is not Campaign.Unknown:
222 from PileupReweighting.AutoconfigurePRW
import getLumicalcFiles
224 log.info(
'Using auto-configured lumicalc files')
226 log.info(
'No campaign specified, no lumicalc files configured for PRW')
228 log.info(
'Data needs no lumicalc and PRW configuration files')
231 alg = config.createAlgorithm(
'CP::PileupReweightingAlg',
'PileupReweightingAlg' )
232 config.addPrivateTool(
'pileupReweightingTool',
'CP::PileupReweightingTool' )
233 alg.pileupReweightingTool.ConfigFiles = toolConfigFiles
234 if not toolConfigFiles
and config.dataType()
is not DataType.Data:
235 log.info(
"No PRW config files provided. Disabling reweighting")
237 alg.pileupWeightDecoration =
""
238 alg.pileupReweightingTool.LumiCalcFiles = toolLumicalcFiles
239 config.addOutputVar (
'EventInfo',
'runNumber',
'runNumber', noSys=
True)
240 config.addOutputVar (
'EventInfo',
'eventNumber',
'eventNumber', noSys=
True)
242 if config.dataType()
is not DataType.Data:
243 config.addOutputVar (
'EventInfo',
'mcChannelNumber',
'mcChannelNumber', noSys=
True)
245 config.addOutputVar (
'EventInfo',
'PileupWeight_%SYS%',
'weight_pileup')
246 if config.geometry()
is LHCPeriod.Run2:
247 config.addOutputVar (
'EventInfo',
'beamSpotWeight',
'weight_beamspot', noSys=
True)
251 """the ConfigBlock for generator algorithms"""
254 super (GeneratorAnalysisBlock, self).__init__ ()
255 self.addOption (
'saveCutBookkeepers',
True, type=bool,
256 info=
"whether to save the cut bookkeepers information into the "
257 "output file. The default is True.")
258 self.addOption (
'runNumber',
None, type=int,
259 info=
"the MC runNumber (int). The default is None (autoconfigure "
261 self.addOption (
'cutBookkeepersSystematics',
None, type=bool,
262 info=
"whether to also save the cut bookkeepers systematics. The "
263 "default is None (follows the global systematics flag). Set to "
264 "False or True to override.")
268 if config.dataType()
is DataType.Data:
275 if self.saveCutBookkeepers
and not self.
runNumber:
276 raise ValueError (
"invalid run number: " +
str(self.
runNumber))
279 if self.saveCutBookkeepers:
280 alg = config.createAlgorithm(
'CP::AsgCutBookkeeperAlg',
'CutBookkeeperAlg')
282 if self.cutBookkeepersSystematics:
283 alg.enableSystematics = self.cutBookkeepersSystematics
285 alg.enableSystematics =
not config.noSystematics()
286 config.addPrivateTool(
'truthWeightTool',
'PMGTools::PMGTruthWeightTool' )
289 alg = config.createAlgorithm(
'CP::PMGTruthWeightAlg',
'PMGTruthWeightAlg' )
290 config.addPrivateTool(
'truthWeightTool',
'PMGTools::PMGTruthWeightTool' )
291 alg.decoration =
'generatorWeight_%SYS%'
292 config.addOutputVar (
'EventInfo',
'generatorWeight_%SYS%',
'weight_mc')
296 """the ConfigBlock for a pt-eta selection"""
298 def __init__ (self, containerName='', selectionName='') :
299 super (PtEtaSelectionBlock, self).__init__ ()
300 self.addOption (
'containerName', containerName, type=str,
302 info=
"the name of the input container.")
303 self.addOption (
'selectionName', selectionName, type=str,
305 info=
"the name of the selection to append this to. The default is "
306 "'' (empty string), meaning that the cuts are applied to every "
307 "object within the container. Specifying a name (e.g. loose) "
308 "applies the cut only to those object who also pass that selection.")
309 self.addOption (
'postfix',
'', type=str,
310 info=
"a postfix to apply to decorations and algorithm names. "
311 "Typically not needed here since we tend apply a single set of "
312 "pT and eta cuts to a given type of object.")
313 self.addOption (
'minPt',
None, type=float,
314 info=
"minimum pT value to cut on, in MeV. No default value.")
315 self.addOption (
'maxEta',
None, type=float,
316 info=
"maximum |eta| value to cut on. No default value.")
317 self.addOption (
'selectionDecoration',
'selectPtEta', type=str,
318 info=
"the name of the decoration to set.")
319 self.addOption (
'useClusterEta',
False, type=bool,
320 info=
"whether to use the cluster eta (etaBE(2)) instead of the object "
321 "eta (for electrons and photons). The default is False.")
326 postfix = self.postfix
327 if postfix !=
'' and postfix[0] !=
'_' :
328 postfix =
'_' + postfix
330 alg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'PtEtaSelectionAlg' + self.containerName + postfix )
331 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool' )
332 if self.minPt
is not None :
333 alg.selectionTool.minPt = self.minPt
334 if self.maxEta
is not None :
335 alg.selectionTool.maxEta = self.maxEta
336 alg.selectionTool.useClusterEta = self.useClusterEta
337 alg.selectionDecoration = self.selectionDecoration
338 alg.particles = config.readName (self.containerName)
339 alg.preselection = config.getPreselection (self.containerName,
'')
340 config.addSelection (self.containerName, self.selectionName, alg.selectionDecoration)
345 """the ConfigBlock for an object cutflow"""
347 def __init__ (self, containerName='', selectionName='') :
348 super (ObjectCutFlowBlock, self).__init__ ()
349 self.addOption (
'containerName', containerName, type=str,
351 info=
"the name of the input container.")
352 self.addOption (
'selectionName', selectionName, type=str,
354 info=
"the name of the selection to perform the cutflow for. The "
355 "default is '' (empty string), meaning that the cutflow is "
356 "performed for every object within the container. Specifying a "
357 "name (e.g. loose) generates the cutflow only for those object "
358 "that also pass that selection.")
359 self.addOption (
'postfix',
'', type=str,
360 info=
"a postfix to apply to decorations and algorithm names. "
361 "Typically not needed here.")
365 postfix = self.postfix
366 if postfix !=
'' and postfix[0] !=
'_' :
367 postfix =
'_' + postfix
369 alg = config.createAlgorithm(
'CP::ObjectCutFlowHistAlg',
'CutFlowDumperAlg_' + self.containerName +
'_' + self.selectionName + postfix )
370 alg.histPattern =
'cflow_' + self.containerName +
"_" + self.selectionName + postfix +
'_%SYS%'
371 alg.selections = config.getSelectionCutFlow (self.containerName, self.selectionName)
372 alg.input = config.readName (self.containerName)
373 alg.histTitle =
"Object Cutflow: " + self.containerName +
"." + self.selectionName
377 """the ConfigBlock for an event-level cutflow"""
379 def __init__ (self, containerName='', selectionName='') :
380 super (EventCutFlowBlock, self).__init__ ()
381 self.addOption (
'containerName', containerName, type=str,
383 info=
"the name of the input container, typically EventInfo.")
384 self.addOption (
'selectionName', selectionName, type=str,
386 info=
"the name of an optional selection decoration to use.")
387 self.addOption (
'customSelections', [], type=
None,
388 info=
"the selections for which to generate cutflow histograms. If "
389 "a single string, corresponding to a particular event selection, "
390 "the event cutflow for that selection will be looked up. If a list "
391 "of strings, will use explicitly those selections. If left blank, "
392 "all selections attached to the container will be looked up.")
393 self.addOption (
'postfix',
'', type=str,
394 info=
"a postfix to apply in the naming of cutflow histograms. Set "
395 "it when defining multiple cutflows.")
399 postfix = self.postfix
400 if postfix !=
'' and postfix[0] !=
'_' :
401 postfix =
'_' + postfix
403 alg = config.createAlgorithm(
'CP::EventCutFlowHistAlg',
'CutFlowDumperAlg_' + self.containerName +
'_' + self.selectionName + postfix )
404 alg.histPattern =
'cflow_' + self.containerName +
"_" + self.selectionName + postfix +
'_%SYS%'
406 if isinstance(self.customSelections, str):
408 alg.selections = config.getEventCutFlow(self.customSelections)
409 elif len(self.customSelections) > 0:
411 alg.selections = self.customSelections
414 alg.selections = config.getSelectionCutFlow (self.containerName, self.selectionName)
415 alg.selections = [sel+
',as_char' for sel
in alg.selections]
416 if self.selectionName:
417 alg.preselection = self.selectionName +
'_%SYS%'
418 alg.eventInfo = config.readName (self.containerName)
419 alg.histTitle =
"Event Cutflow: " + self.containerName +
"." + self.selectionName
423 """the ConfigBlock for output thinning"""
425 def __init__ (self, containerName='', configName='') :
427 super (OutputThinningBlock, self).__init__ ()
428 self.addOption (
'containerName', containerName, type=str,
430 info=
"the name of the input container.")
431 self.addOption (
'postfix',
'', type=str,
432 info=
"a postfix to apply to decorations and algorithm names. "
433 "Typically not needed here.")
434 self.addOption (
'selection',
'', type=str,
435 info=
"the name of an optional selection decoration to use.")
436 self.addOption (
'selectionName',
'', type=str,
437 info=
"the name of the selection to append this to. The default is "
438 "'' (empty string), meaning that the cuts are applied to every "
439 "object within the container. Specifying a name (e.g. loose) "
440 "applies the cut only to those object who also pass that selection.")
441 self.addOption (
'outputName',
None, type=str,
442 info=
"an optional name for the output container.")
444 self.addOption (
'deepCopy',
False, type=bool,
446 self.addOption (
'sortPt',
False, type=bool,
447 info=
"whether to sort objects in pt")
449 self.addOption (
'noUniformSelection',
False, type=bool,
454 postfix = self.postfix
455 if postfix !=
'' and postfix[0] !=
'_' :
456 postfix =
'_' + postfix
458 selection = config.getFullSelection (self.containerName, self.selectionName)
460 selection = self.selection
461 elif self.selection !=
'' :
462 selection = selection +
'&&' + self.selection
464 if selection !=
'' and not self.noUniformSelection :
465 alg = config.createAlgorithm(
'CP::AsgUnionSelectionAlg',
'UnionSelectionAlg' + self.containerName + postfix)
466 alg.preselection = selection
467 alg.particles = config.readName (self.containerName)
468 alg.selectionDecoration =
'outputSelect' + postfix
469 selection =
'outputSelect' + postfix
471 alg = config.createAlgorithm(
'CP::AsgViewFromSelectionAlg',
'DeepCopyAlg' + self.containerName + postfix )
472 alg.input = config.readName (self.containerName)
473 if self.outputName
is not None :
474 alg.output = self.outputName +
'_%SYS%'
475 config.addOutputContainer (self.containerName, self.outputName)
477 alg.output = config.copyName (self.containerName)
479 alg.selection = [selection]
482 alg.deepCopy = self.deepCopy
483 if self.sortPt
and not config.noSystematics() :
484 raise ValueError (
"Sorting by pt is not supported with systematics")
485 alg.sortPt = self.sortPt
489 """the ConfigBlock for the IFF classification of leptons"""
492 super (IFFLeptonDecorationBlock, self).
__init__()
493 self.addOption (
'containerName', containerName, type=str,
495 info=
"the name of the input electron or muon container.")
496 self.addOption (
'separateChargeFlipElectrons',
True, type=bool,
497 info=
"whether to consider charged-flip electrons as a separate class. "
498 "The default is True (recommended).")
499 self.addOption (
'decoration',
'IFFClass_%SYS%', type=str,
500 info=
"the name (str) of the decoration set by the IFF "
501 "TruthClassificationTool. The default is 'IFFClass_%SYS%'.")
505 if config.dataType()
is DataType.Data:
return
507 particles = config.readName(self.containerName)
509 alg = config.createAlgorithm(
'CP::AsgClassificationDecorationAlg',
'IFFClassifierAlg' + self.containerName )
511 config.addPrivateTool(
'tool',
'TruthClassificationTool')
513 alg.tool.separateChargeFlipElectrons = self.separateChargeFlipElectrons
514 alg.decoration = self.decoration
515 alg.particles = particles
518 config.addOutputVar(self.containerName, alg.decoration, alg.decoration.split(
"_%SYS%")[0], noSys=
True)
522 """the ConfigBlock for the AsgEventScaleFactorAlg"""
525 super(PerEventSFBlock, self).
__init__()
526 self.addOption(
'algoName', algoName, type=str,
528 info=
"unique name given to the underlying algorithm computing the "
529 "per-event scale factors")
530 self.addOption(
'particles',
'', type=str,
531 info=
"the input object container, with a possible selection, in the "
532 "format container or container.selection.")
533 self.addOption(
'objectSF',
'', type=str,
534 info=
"the name of the per-object SF decoration to be used.")
535 self.addOption(
'eventSF',
'', type=str,
536 info=
"the name of the per-event SF decoration.")
539 if config.dataType()
is DataType.Data:
541 particles, selection = config.readNameAndSelection(self.particles)
542 alg = config.createAlgorithm(
'CP::AsgEventScaleFactorAlg', self.algoName)
543 alg.particles = particles
544 alg.preselection = selection
545 alg.scaleFactorInputDecoration = self.objectSF
546 alg.scaleFactorOutputDecoration = self.eventSF
548 config.addOutputVar(
'EventInfo', alg.scaleFactorOutputDecoration,
549 alg.scaleFactorOutputDecoration.split(
"_%SYS%")[0])
553 """the ConfigBlock to add selection decoration to a container"""
556 super (SelectionDecorationBlock, self).__init__ ()
558 self.addOption(
'containers', containers, type=list,
563 for container
in self.containers:
564 originContainerName = config.getOutputContainerOrigin(container)
565 selectionNames = config.getSelectionNames(originContainerName)
566 for selectionName
in selectionNames:
568 if selectionName ==
'':
570 alg = config.createAlgorithm(
571 'CP::AsgSelectionAlg',
572 f
'SelectionDecoration_{originContainerName}_{selectionName}')
573 selectionDecoration = f
'baselineSelection_{selectionName}_%SYS%'
574 alg.selectionDecoration = f
'{selectionDecoration},as_char'
575 alg.particles = config.readName (originContainerName)
576 alg.preselection = config.getFullSelection (originContainerName,
579 originContainerName, selectionDecoration, selectionName)
583 """Create the common services config"""
585 seq.append (CommonServicesConfig ())
590 """Create a PRW analysis config
596 config = PileupReweightingBlock ()
597 config.setOptionValue (
'campaign', campaign)
598 config.setOptionValue (
'files', files)
599 config.setOptionValue (
'useDefaultConfig', useDefaultConfig)
600 config.setOptionValue (
'userLumicalcFiles', userLumicalcFiles)
601 config.setOptionValue (
'userPileupConfigs', userPileupConfigs)
607 saveCutBookkeepers=None,
609 cutBookkeepersSystematics=None ):
610 """Create a generator analysis algorithm sequence
613 saveCutBookkeepers -- save cut bokkeepers information into output file
614 runNumber -- MC run number
615 cutBookkeepersSystematics -- store CutBookkeepers systematics
618 config = GeneratorAnalysisBlock ()
619 config.setOptionValue (
'saveCutBookkeepers', saveCutBookkeepers)
620 config.setOptionValue (
'runNumber', runNumber)
621 config.setOptionValue (
'cutBookkeepersSystematics', cutBookkeepersSystematics)
627 *, postfix = None, minPt = None, maxEta = None,
628 useClusterEta = None,
629 selectionDecoration = None, selectionName = ''):
630 """Create a pt-eta kinematic selection config
633 containerName -- name of the container
634 postfix -- a postfix to apply to decorations and algorithm
635 names. this is mostly used/needed when using this
636 sequence with multiple working points to ensure all
638 minPt -- minimum pt value
639 maxEta -- maximum eta value
640 useClusterEta -- use cluster eta (for electrons/photons) instead of track eta
641 selectionDecoration -- the name of the decoration to set
642 selectionName -- the name of the selection to append this to
645 config = PtEtaSelectionBlock (containerName, selectionName)
646 config.setOptionValue (
'postfix',postfix)
647 config.setOptionValue (
'minPt',minPt)
648 config.setOptionValue (
'maxEta',maxEta)
649 config.setOptionValue (
'selectionDecoration',selectionDecoration)
650 config.setOptionValue (
'useClusterEta',useClusterEta)
656 *, postfix = None, selectionName):
657 """Create a pt-eta kinematic selection config
660 containerName -- name of the container
661 postfix -- a postfix to apply to decorations and algorithm
662 names. this is mostly used/needed when using this
663 sequence with multiple working points to ensure all
665 selectionName -- the name of the selection to do the cutflow for
668 config = ObjectCutFlowBlock (containerName, selectionName)
669 config.setOptionValue (
'postfix',postfix)
674 *, postfix = None, selectionName, customSelections = None):
675 """Create an event-level cutflow config
678 containerName -- name of the container
679 postfix -- a postfix to apply to decorations and algorithm names.
680 selectionName -- the name of the selection to do the cutflow for
681 customSelections -- a list of decorations to use in the cutflow, to override the retrieval of all decorations
684 config = EventCutFlowBlock (containerName, selectionName)
685 config.setOptionValue (
'postfix', postfix)
686 config.setOptionValue (
'customSelections', customSelections)
691 *, postfix = None, selection = None, selectionName = None, outputName = None, configName='Thinning'):
692 """Create an output thinning config
694 This will do a consistent selection of output containers (if there
695 is a preselection or a selection specified) and then creates a set
696 of view containers (or deep copies) based on that selection.
699 containerName -- name of the container
700 postfix -- a postfix to apply to decorations and algorithm
701 names. this is mostly used/needed when using this
702 sequence with multiple working points to ensure all
704 selection -- the name of an optional selection decoration to use
705 outputName -- an optional name for the output container
709 config = OutputThinningBlock (containerName, configName)
710 config.setOptionValue (
'postfix', postfix)
711 config.setOptionValue (
'selection', selection)
712 config.setOptionValue (
'selectionName', selectionName)
713 config.setOptionValue (
'outputName', outputName)