7 deepCopyOutput = False,
8 shallowViewOutput = True,
10 enableCutflow = False,
11 enableKinematicHistograms = False,
12 defineSystObjectLinks = False ):
13 """Create an analysis algorithm sequence for shared post-processing of
16 This contains various algorithms for producing view containers (or
17 deep copied containers), as well as debugging output. Typically
18 there has to be one such sequence for each object type and working
19 point. Due to the highly regular format, as well as the number of
20 customizations (and all algorithms being switchable) it may be
21 more practical for the users to write their own version of this
25 deepCopyOutput -- If set to 'True', the output containers will be
26 standalone, deep copies (slower, but needed for xAOD
28 shallowViewOutput -- Create a view container if required
29 postfix -- a postfix to apply to decorations and algorithm
30 names. this is required to make multiple such
31 sequences for various object types and working points.
32 enableCutflow -- Whether or not to dump the cutflow
33 enableKinematicHistograms -- Whether or not to dump the kinematic histograms
38 if deepCopyOutput
and shallowViewOutput:
39 raise ValueError (
"deepCopyOutput and shallowViewOutput can't both be true!")
43 if defineSystObjectLinks:
45 raise ValueError (
"Systematic object links may not work correctly on deep copy output")
46 alg =
createAlgorithm(
'CP::SystObjectLinkerAlg',
'SystObjLinker'+postfix)
47 seq.append( alg, inputPropName =
'input', stageName =
'selection' )
51 alg =
createAlgorithm(
'CP::ObjectCutFlowHistAlg',
'CutFlowDumperAlg' + postfix )
52 alg.histPattern =
'cflow' + postfix +
'_%SYS%'
53 seq.append( alg, inputPropName =
'input', stageName =
'selection',
54 dynConfig = {
'selections' :
lambda meta : meta[
"selectionDecorNames"][:]} )
60 'ViewFromSelectionAlg' + postfix )
61 seq.append( alg, inputPropName =
'input', outputPropName =
'output',
62 stageName =
'selection',
63 dynConfig = {
'selection' :
lambda meta : meta[
"selectionDecorNamesOutput"][:]} )
66 if enableKinematicHistograms:
67 alg =
createAlgorithm(
'CP::KinematicHistAlg',
'KinematicDumperAlg' + postfix )
68 alg.histPattern =
'%VAR%' + postfix +
'_%SYS%'
69 seq.append( alg, inputPropName =
'input', stageName =
'selection',
70 dynConfig = {
'preselection' :
lambda meta :
"&&".join (meta[
"selectionDecorNames"])})
75 'DeepCopyMaker' + postfix )
77 seq.append( alg, inputPropName =
'input', outputPropName =
'output',
78 stageName =
'selection',
79 dynConfig = {
'selection' :
lambda meta : meta[
"selectionDecorNamesOutput"][:]} )