Skip to content
Snippets Groups Projects
Commit 7e5c26f7 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'cp-truth' into 'main'

Add truth decorations also to electrons, photons and muons

See merge request atlas/athena!76835
parents 69470803 a1fb3a25
No related branches found
No related tags found
9 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76835Add truth decorations also to electrons, photons and muons
Showing with 44 additions and 2 deletions
......@@ -33,6 +33,7 @@ Electrons:
- containerName: AnaElectrons
forceFullSimConfig: True
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: loose
forceFullSimConfig: True
......@@ -48,6 +49,7 @@ Photons:
recomputeIsEM: False
forceFullSimConfig: True
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: tight
forceFullSimConfig: True
......@@ -60,6 +62,7 @@ Photons:
Muons:
- containerName: AnaMuons
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: medium
quality: Medium
......@@ -68,6 +71,7 @@ Muons:
TauJets:
- containerName: AnaTauJets
decorateTruth: true
WorkingPoint:
- selectionName: tight
quality: Tight
......
......@@ -33,6 +33,7 @@ Electrons:
- containerName: AnaElectrons
forceFullSimConfig: True
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: loose
forceFullSimConfig: True
......@@ -47,6 +48,7 @@ Photons:
recomputeIsEM: False
forceFullSimConfig: True
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: tight
forceFullSimConfig: True
......@@ -59,6 +61,7 @@ Photons:
Muons:
- containerName: AnaMuons
recalibratePhyslite: False
decorateTruth: true
WorkingPoint:
- selectionName: medium
quality: Medium
......@@ -67,6 +70,7 @@ Muons:
TauJets:
- containerName: AnaTauJets
decorateTruth: true
WorkingPoint:
- selectionName: tight
quality: Tight
......
......@@ -104,6 +104,7 @@ def compareTextBuilder(yamlPath='', *, checkOrder=False) :
config.setOptions (containerName='AnaElectrons')
config.setOptions (forceFullSimConfig=True)
config.setOptions (recalibratePhyslite=False)
config.setOptions (decorateTruth=True)
# Electrons.WorkingPoint
config.addBlock ('Electrons.WorkingPoint')
config.setOptions (containerName='AnaElectrons')
......@@ -123,6 +124,7 @@ def compareTextBuilder(yamlPath='', *, checkOrder=False) :
config.setOptions (forceFullSimConfig=True)
config.setOptions (recomputeIsEM=False)
config.setOptions (recalibratePhyslite=False)
config.setOptions (decorateTruth=True)
# Photons.WorkingPoint
config.addBlock ('Photons.WorkingPoint')
config.setOptions (containerName='AnaPhotons')
......@@ -139,6 +141,7 @@ def compareTextBuilder(yamlPath='', *, checkOrder=False) :
# Muons
config.addBlock ('Muons', containerName='AnaMuons')
config.setOptions (recalibratePhyslite=False)
config.setOptions (decorateTruth=True)
# Muons.WorkingPoint
config.addBlock ('Muons.WorkingPoint')
config.setOptions (containerName='AnaMuons')
......@@ -149,6 +152,7 @@ def compareTextBuilder(yamlPath='', *, checkOrder=False) :
# TauJets
config.addBlock ('TauJets', containerName='AnaTauJets')
config.setOptions (decorateTruth=True)
# TauJets.WorkingPoint
config.addBlock ('TauJets.WorkingPoint')
config.setOptions (containerName='AnaTauJets')
......
......@@ -153,6 +153,7 @@ def makeTestSequenceBlocks (dataType, algSeq, isPhyslite,
likelihood = True
configSeq += config.makeConfig ('Electrons',
containerName='AnaElectrons' )
configSeq.setOptionValue ('.decorateTruth', True)
configSeq.setOptionValue ('.forceFullSimConfig', forceEGammaFullSimConfig)
configSeq.setOptionValue ('.recalibratePhyslite', False)
configSeq += config.makeConfig ('Electrons.WorkingPoint',
......@@ -175,6 +176,7 @@ def makeTestSequenceBlocks (dataType, algSeq, isPhyslite,
# Include, and then set up the photon analysis algorithm sequence:
configSeq += config.makeConfig ('Photons',
containerName='AnaPhotons' )
configSeq.setOptionValue ('.decorateTruth', True)
configSeq.setOptionValue ('.forceFullSimConfig', forceEGammaFullSimConfig)
configSeq.setOptionValue ('.recomputeIsEM', False)
configSeq.setOptionValue ('.recalibratePhyslite', False)
......@@ -194,6 +196,7 @@ def makeTestSequenceBlocks (dataType, algSeq, isPhyslite,
# set up the muon analysis algorithm sequence:
configSeq += config.makeConfig ('Muons',
containerName='AnaMuons')
configSeq.setOptionValue ('.decorateTruth', True)
configSeq.setOptionValue ('.recalibratePhyslite', False)
configSeq += config.makeConfig ('Muons.WorkingPoint',
containerName='AnaMuons',
......@@ -210,6 +213,7 @@ def makeTestSequenceBlocks (dataType, algSeq, isPhyslite,
# Include, and then set up the tau analysis algorithm sequence:
configSeq += config.makeConfig ('TauJets',
containerName='AnaTauJets')
configSeq.setOptionValue ('.decorateTruth', True)
configSeq += config.makeConfig ('TauJets.WorkingPoint',
containerName='AnaTauJets',
selectionName='tight')
......
......@@ -58,6 +58,9 @@ class ElectronCalibrationConfig (ConfigBlock) :
"systematics dependent corrections. The net effect is that the "
"slower first step only has to be run once, while the second is run "
"once per systematic. ATLASG-2358")
self.addOption ('decorateTruth', False, type=bool,
info="decorate truth particle information on the reconstructed one")
def makeCalibrationAndSmearingAlg (self, config, name) :
......@@ -206,6 +209,14 @@ class ElectronCalibrationConfig (ConfigBlock) :
config.addOutputVar (self.containerName, 'e_%SYS%', 'e')
config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True)
# decorate truth information on the reconstructed object:
if self.decorateTruth and config.dataType() is not DataType.Data:
config.addOutputVar (self.containerName, "truthType", "truth_type", noSys=True)
config.addOutputVar (self.containerName, "truthOrigin", "truth_origin", noSys=True)
config.addOutputVar (self.containerName, "firstEgMotherPdgId", "truth_firstEgMotherPdgId", noSys=True)
config.addOutputVar (self.containerName, "firstEgMotherTruthOrigin", "truth_firstEgMotherTruthOrigin", noSys=True)
config.addOutputVar (self.containerName, "firstEgMotherTruthType", "truth_firstEgMotherTruthType", noSys=True)
class ElectronWorkingPointConfig (ConfigBlock) :
......
......@@ -63,6 +63,8 @@ class PhotonCalibrationConfig (ConfigBlock) :
"systematics dependent corrections. The net effect is that the "
"slower first step only has to be run once, while the second is run "
"once per systematic. ATLASG-2358")
self.addOption ('decorateTruth', False, type=bool,
info="decorate truth particle information on the reconstructed one")
def makeCalibrationAndSmearingAlg (self, config, name) :
......@@ -249,6 +251,10 @@ class PhotonCalibrationConfig (ConfigBlock) :
config.addOutputVar (self.containerName, 'phi', 'phi', noSys=True)
config.addOutputVar (self.containerName, 'e_%SYS%', 'e')
# decorate truth information on the reconstructed object:
if self.decorateTruth and config.dataType() is not DataType.Data:
config.addOutputVar (self.containerName, "truthType", "truth_type", noSys=True)
config.addOutputVar (self.containerName, "truthOrigin", "truth_origin", noSys=True)
class PhotonWorkingPointConfig (ConfigBlock) :
......
......@@ -35,6 +35,8 @@ class MuonCalibrationConfig (ConfigBlock):
info="only for testing purposes, turn on to ignore NSW hits and "
"fix a crash with older derivations (p-tag <p5834)")
self.addOption ('calibMode', 'correctData_CB', type=str, info='calibration mode of the MuonCalibTool needed to turn on the sagitta bias corrections and to select the muon track calibration type (CB or ID+MS)')
self.addOption ('decorateTruth', False, type=bool,
info="decorate truth particle information on the reconstructed one")
def makeAlgs (self, config) :
......@@ -111,6 +113,10 @@ class MuonCalibrationConfig (ConfigBlock):
config.addOutputVar (self.containerName, 'e_%SYS%', 'e')
config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True)
# decorate truth information on the reconstructed object:
if self.decorateTruth and config.dataType() is not DataType.Data:
config.addOutputVar (self.containerName, "truthType", "truth_type", noSys=True)
config.addOutputVar (self.containerName, "truthOrigin", "truth_origin", noSys=True)
class MuonWorkingPointConfig (ConfigBlock) :
"""the ConfigBlock for the muon working point
......
......@@ -26,9 +26,8 @@ class TauCalibrationConfig (ConfigBlock):
self.addOption ('rerunTruthMatching', True, type=bool,
info="whether to rerun truth matching (sets up an instance of "
"CP::TauTruthMatchingAlg). The default is True.")
# TODO: add info string
self.addOption ('decorateTruth', False, type=bool,
info="")
info="decorate truth particle information on the reconstructed one")
def makeAlgs (self, config) :
......@@ -68,6 +67,10 @@ class TauCalibrationConfig (ConfigBlock):
for var in ['DecayMode', 'ParticleType'] + alg.doubleDecorations[:] + alg.floatDecorations[:] + alg.intDecorations[:] + alg.charDecorations[:]:
branchName = alg.prefix+var
config.addOutputVar (self.containerName, branchName, branchName, noSys=True)
# these are already available
config.addOutputVar (self.containerName, "truthType", "truth_type", noSys=True)
config.addOutputVar (self.containerName, "truthOrigin", "truth_origin", noSys=True)
# Set up the tau 4-momentum smearing algorithm:
alg = config.createAlgorithm( 'CP::TauSmearingAlg', 'TauSmearingAlg' + postfix )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment