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

Public Member Functions

def __init__ (self, containerName='')
 
def makeAlgs (self, config)
 

Public Attributes

 containerName
 

Detailed Description

the ConfigBlock for the tau four-momentum correction

Definition at line 10 of file TauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TauAnalysisConfig.TauCalibrationConfig.__init__ (   self,
  containerName = '' 
)

Definition at line 13 of file TauAnalysisConfig.py.

13  def __init__ (self, containerName='') :
14  super (TauCalibrationConfig, self).__init__ ()
15  self.setBlockName('Taus')
16  self.containerName = containerName
17  self.addOption ('inputContainer', 'TauJets', type=str,
18  info="select tau input container, by default set to TauJets")
19  self.addOption ('containerName', containerName, type=str,
20  noneAction='error',
21  info="the name of the output container after calibration.")
22  self.addOption ('postfix', '', type=str,
23  info="a postfix to apply to decorations and algorithm names. "
24  "Typically not needed here since the calibration is common to "
25  "all taus.")
26  self.addOption ('rerunTruthMatching', True, type=bool,
27  info="whether to rerun truth matching (sets up an instance of "
28  "CP::TauTruthMatchingAlg). The default is True.")
29  self.addOption ('decorateTruth', False, type=bool,
30  info="decorate truth particle information on the reconstructed one")
31 
32 

Member Function Documentation

◆ makeAlgs()

def python.TauAnalysisConfig.TauCalibrationConfig.makeAlgs (   self,
  config 
)

Definition at line 33 of file TauAnalysisConfig.py.

33  def makeAlgs (self, config) :
34 
35  postfix = self.postfix
36  if postfix != '' and postfix[0] != '_' :
37  postfix = '_' + postfix
38 
39  if config.isPhyslite() :
40  config.setSourceName (self.containerName, "AnalysisTauJets")
41  else :
42  config.setSourceName (self.containerName, self.inputContainer)
43 
44  # Set up the tau truth matching algorithm:
45  if self.rerunTruthMatching and config.dataType() is not DataType.Data:
46  alg = config.createAlgorithm( 'CP::TauTruthMatchingAlg',
47  'TauTruthMatchingAlg' + postfix )
48  config.addPrivateTool( 'matchingTool',
49  'TauAnalysisTools::TauTruthMatchingTool' )
50  alg.matchingTool.TruthJetContainerName = 'AntiKt4TruthDressedWZJets'
51  alg.taus = config.readName (self.containerName)
52  alg.preselection = config.getPreselection (self.containerName, '')
53 
54  # decorate truth tau information on the reconstructed object:
55  if self.decorateTruth and config.dataType() is not DataType.Data:
56  alg = config.createAlgorithm( 'CP::TauTruthDecorationsAlg',
57  'TauTruthDecorationsAlg' + postfix )
58  alg.taus = config.readName (self.containerName)
59  alg.doubleDecorations = ['pt_vis', 'eta_vis', 'phi_vis', 'm_vis']
60  alg.floatDecorations = []
61  alg.intDecorations = ['pdgId']
62  alg.unsignedIntDecorations = ['classifierParticleOrigin', 'classifierParticleType']
63  alg.charDecorations = ['IsHadronicTau']
64  alg.prefix = 'truth_'
65 
66  # these are "_ListHelper" objects, and not "list", need to copy to lists to allow concatenate
67  for var in ['DecayMode', 'ParticleType', 'PartonTruthLabelID'] + alg.doubleDecorations[:] + alg.floatDecorations[:] + alg.intDecorations[:] + alg.unsignedIntDecorations[:] + alg.charDecorations[:]:
68  branchName = alg.prefix + var
69  if 'classifierParticle' in var:
70  branchOutput = alg.prefix + var.replace('classifierParticle', '').lower()
71  else:
72  branchOutput = branchName
73  config.addOutputVar (self.containerName, branchName, branchOutput, noSys=True)
74 
75  # Decorate extra variables
76  alg = config.createAlgorithm( 'CP::TauExtraVariablesAlg', 'TauExtraVariables' + self.containerName + self.postfix )
77  alg.taus = config.readName (self.containerName)
78 
79  # Set up the tau 4-momentum smearing algorithm:
80  alg = config.createAlgorithm( 'CP::TauSmearingAlg', 'TauSmearingAlg' + postfix )
81  config.addPrivateTool( 'smearingTool', 'TauAnalysisTools::TauSmearingTool' )
82  alg.smearingTool.useFastSim = config.dataType() is DataType.FastSim
83  alg.taus = config.readName (self.containerName)
84  alg.tausOut = config.copyName (self.containerName)
85  alg.preselection = config.getPreselection (self.containerName, '')
86 
87  # Additional decorations
88  alg = config.createAlgorithm( 'CP::AsgEnergyDecoratorAlg', 'EnergyDecorator' + self.containerName + self.postfix )
89  alg.particles = config.readName (self.containerName)
90 
91  config.addOutputVar (self.containerName, 'pt', 'pt')
92  config.addOutputVar (self.containerName, 'eta', 'eta', noSys=True)
93  config.addOutputVar (self.containerName, 'phi', 'phi', noSys=True)
94  config.addOutputVar (self.containerName, 'e_%SYS%', 'e')
95  config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True)
96  config.addOutputVar (self.containerName, 'NNDecayMode', 'NNDecayMode', noSys=True)
97  config.addOutputVar (self.containerName, 'nTracks', 'nTracks', noSys=True)
98 
99 

Member Data Documentation

◆ containerName

python.TauAnalysisConfig.TauCalibrationConfig.containerName

Definition at line 16 of file TauAnalysisConfig.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18