ATLAS Offline Software
Functions
python.JetJvtAnalysisSequence Namespace Reference

Functions

def makeJetJvtAnalysisSequence (dataType, jetCollection, preselection='', enableFJvt=False, globalSF=True, runSelection=True, runNNJvt=False, shallowViewOutput=True, enableCutflow=False)
 

Function Documentation

◆ makeJetJvtAnalysisSequence()

def python.JetJvtAnalysisSequence.makeJetJvtAnalysisSequence (   dataType,
  jetCollection,
  preselection = '',
  enableFJvt = False,
  globalSF = True,
  runSelection = True,
  runNNJvt = False,
  shallowViewOutput = True,
  enableCutflow = False 
)
Create a jet JVT analysis algorithm sequence

Keyword arguments:
  dataType -- The data type to run on ("data", "mc" or "afii")
  jetCollection -- The jet container to run on
  enableFJvt -- Whether to enable forward JVT calculations
  globalSF -- Whether to calculate per event scale factors
  runSelection -- Whether to run selection
  enableCutflow -- Whether or not to dump the cutflow

Definition at line 7 of file JetJvtAnalysisSequence.py.

7 def makeJetJvtAnalysisSequence( dataType, jetCollection,
8  preselection = '',
9  enableFJvt = False,
10  globalSF = True,
11  runSelection = True,
12  runNNJvt = False,
13  shallowViewOutput = True,
14  enableCutflow = False ):
15  """Create a jet JVT analysis algorithm sequence
16 
17  Keyword arguments:
18  dataType -- The data type to run on ("data", "mc" or "afii")
19  jetCollection -- The jet container to run on
20  enableFJvt -- Whether to enable forward JVT calculations
21  globalSF -- Whether to calculate per event scale factors
22  runSelection -- Whether to run selection
23  enableCutflow -- Whether or not to dump the cutflow
24  """
25 
26  if dataType not in ["data", "mc", "afii"] :
27  raise ValueError ("invalid data type: " + dataType)
28 
29  if runSelection and not globalSF :
30  raise ValueError ("per-event scale factors needs to be computed when doing a JVT selection")
31 
32  if runNNJvt:
33  assert (not globalSF), "SFs not yet available for NN JVT"
34 
35  # Create the analysis algorithm sequence object:
36  seq = AnaAlgSequence( "JetJVTAnalysisSequence" )
37 
38  # Define a list of cuts to apply later on and the
39  # number of bits in the corresponding TAccept
40  seq.addMetaConfigDefault ("selectionDecorNames", [])
41  seq.addMetaConfigDefault ("selectionDecorCount", [])
42 
43  # Set up the per-event jet efficiency scale factor calculation algorithm
44  if dataType != 'data' and globalSF:
45  alg = createAlgorithm( 'CP::AsgEventScaleFactorAlg', 'JvtEventScaleFactorAlg' )
46  alg.preselection = preselection + '&&no_jvt' if preselection else 'no_jvt'
47  alg.scaleFactorInputDecoration = 'jvt_effSF_%SYS%'
48  alg.scaleFactorOutputDecoration = 'jvt_effSF_%SYS%'
49 
50  seq.append( alg,
51  inputPropName = { 'jets' : 'particles' } )
52 
53  if enableFJvt:
54  alg = createAlgorithm( 'CP::AsgEventScaleFactorAlg', 'ForwardJvtEventScaleFactorAlg' )
55  alg.preselection = preselection + '&&no_fjvt' if preselection else 'no_fjvt'
56  alg.scaleFactorInputDecoration = 'fjvt_effSF_%SYS%'
57  alg.scaleFactorOutputDecoration = 'fjvt_effSF_%SYS%'
58 
59  seq.append( alg,
60  inputPropName = { 'jets' : 'particles' } )
61 
62  if runSelection:
63  jvt_name = 'NNJvtPass' if runNNJvt else 'jvt_selection'
64  seq.addMetaConfigDefault ("selectionDecorNames", [ jvt_name, 'fjvt_selection'] if enableFJvt else ['jvt_selection'])
65  seq.addMetaConfigDefault ("selectionDecorCount", [1, 1] if enableFJvt else [1])
66 
67  # Set up an algorithm used to create jet JVT selection cutflow:
68  if enableCutflow:
69  alg = createAlgorithm( 'CP::ObjectCutFlowHistAlg', 'JetJvtCutFlowDumperAlg' )
70  alg.histPattern = 'jet_cflow_jvt_%SYS%'
71  seq.append( alg, inputPropName = { 'jets' : 'input' },
72  dynConfig = {'selections' : lambda meta : meta["selectionDecorNames"][:]})
73 
74  # Set up an algorithm that makes a view container using the selections
75  # performed previously:
76  if shallowViewOutput :
77  alg = createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'JetJvtViewFromSelectionAlg' )
78  seq.append( alg, inputPropName = { 'jets' : 'input' },
79  outputPropName = { 'jets' : 'output' },
80  dynConfig = {'selection' : lambda meta : meta["selectionDecorNames"][:]} )
81 
82  # Return the sequence:
83  return seq
python.DualUseConfig.createAlgorithm
def createAlgorithm(typeName, instanceName)
Definition: DualUseConfig.py:56
python.JetJvtAnalysisSequence.makeJetJvtAnalysisSequence
def makeJetJvtAnalysisSequence(dataType, jetCollection, preselection='', enableFJvt=False, globalSF=True, runSelection=True, runNNJvt=False, shallowViewOutput=True, enableCutflow=False)
Definition: JetJvtAnalysisSequence.py:7