Skip to content
Snippets Groups Projects
Commit 60ab9617 authored by R D Schaffer's avatar R D Schaffer Committed by Edward Moyse
Browse files

setting up flag to avoid d0 and z0 cut for PhysLite, default remains apply cut

setting up flag to avoid d0 and z0 cut for PhysLite, default remains apply cut
parent e19daaa2
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@ class ElectronCalibrationConfig (ConfigBlock) :
self.addOption ('crackVeto', False, type=bool)
self.addOption ('ptSelectionOutput', False, type=bool)
self.addOption ('isolationCorrection', False, type=bool)
self.addOption ('trackSelection', True, type=bool)
def makeAlgs (self, config) :
......@@ -50,14 +52,15 @@ class ElectronCalibrationConfig (ConfigBlock) :
bits=(5 if self.crackVeto else 4))
# Set up the track selection algorithm:
alg = config.createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'ElectronTrackSelectionAlg' + self.postfix )
alg.selectionDecoration = 'trackSelection' + self.postfix + ',as_bits'
alg.maxD0Significance = 5
alg.maxDeltaZ0SinTheta = 0.5
alg.particles = config.readName (self.containerName)
alg.preselection = config.getPreselection (self.containerName, '')
config.addSelection (self.containerName, '', alg.selectionDecoration,
if self.trackSelection :
alg = config.createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'ElectronTrackSelectionAlg' + self.postfix )
alg.selectionDecoration = 'trackSelection' + self.postfix + ',as_bits'
alg.maxD0Significance = 5
alg.maxDeltaZ0SinTheta = 0.5
alg.particles = config.readName (self.containerName)
alg.preselection = config.getPreselection (self.containerName, '')
config.addSelection (self.containerName, '', alg.selectionDecoration,
bits=3)
# Select electrons only with good object quality.
......
......@@ -19,6 +19,7 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
isolationCorrection = False,
crackVeto = False,
ptSelectionOutput = False,
trackSelection = True,
enableCutflow = False,
enableKinematicHistograms = False ):
"""Create an electron analysis algorithm sequence
......@@ -40,6 +41,7 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
crackVeto -- Whether or not to perform eta crack veto
ptSelectionOutput -- Whether or not to apply pt selection when creating
output containers.
trackSelection -- apply selection on tracks (d0, z0, siHits, etc.)
enableCutflow -- Whether or not to dump the cutflow
enableKinematicHistograms -- Whether or not to dump the kinematic histograms
"""
......@@ -63,6 +65,7 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
makeElectronCalibrationSequence (seq, dataType, postfix=postfix,
crackVeto = crackVeto,
ptSelectionOutput = ptSelectionOutput,
trackSelection = trackSelection,
isolationCorrection = isolationCorrection)
makeElectronWorkingPointSequence (seq, dataType, workingPoint, postfix=postfix,
recomputeLikelihood = recomputeLikelihood,
......@@ -83,6 +86,7 @@ def makeElectronAnalysisSequence( dataType, workingPoint,
def makeElectronCalibrationSequence( seq, dataType, postfix = '',
crackVeto = False,
ptSelectionOutput = False,
trackSelection = False,
isolationCorrection = False):
"""Create electron calibration analysis algorithms
......@@ -129,17 +133,18 @@ def makeElectronCalibrationSequence( seq, dataType, postfix = '',
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])} )
# Set up the track selection algorithm:
alg = createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'ElectronTrackSelectionAlg' + postfix )
alg.selectionDecoration = 'trackSelection' + postfix + ',as_bits'
alg.maxD0Significance = 5
alg.maxDeltaZ0SinTheta = 0.5
seq.append( alg, inputPropName = 'particles',
stageName = 'selection',
metaConfig = {'selectionDecorNames' : [alg.selectionDecoration],
'selectionDecorNamesOutput' : [alg.selectionDecoration],
'selectionDecorCount' : [3]},
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])} )
if trackSelection:
alg = createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'ElectronTrackSelectionAlg' + postfix )
alg.selectionDecoration = 'trackSelection' + postfix + ',as_bits'
alg.maxD0Significance = 5
alg.maxDeltaZ0SinTheta = 0.5
seq.append( alg, inputPropName = 'particles',
stageName = 'selection',
metaConfig = {'selectionDecorNames' : [alg.selectionDecoration],
'selectionDecorNamesOutput' : [alg.selectionDecoration],
'selectionDecorCount' : [3]},
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])} )
# Select electrons only with good object quality.
alg = createAlgorithm( 'CP::AsgSelectionAlg', 'ElectronObjectQualityAlg' + postfix )
......
......@@ -13,6 +13,7 @@ class MuonCalibrationConfig (ConfigBlock):
self.containerName = containerName
self.addOption ('postfix', "", type=str)
self.addOption ('ptSelectionOutput', False, type=bool)
self.addOption ('trackSelection', True, type=bool)
def makeAlgs (self, config) :
......@@ -39,15 +40,16 @@ class MuonCalibrationConfig (ConfigBlock):
bits=2)
# Set up the track selection algorithm:
alg = config.createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'MuonTrackSelectionAlg' + self.postfix )
alg.selectionDecoration = 'trackSelection' + self.postfix + ',as_bits'
alg.maxD0Significance = 3
alg.maxDeltaZ0SinTheta = 0.5
alg.particles = config.readName (self.containerName)
alg.preselection = config.getPreselection (self.containerName, '')
config.addSelection (self.containerName, '', alg.selectionDecoration,
bits=3)
if self.trackSelection :
alg = config.createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'MuonTrackSelectionAlg' + self.postfix )
alg.selectionDecoration = 'trackSelection' + self.postfix + ',as_bits'
alg.maxD0Significance = 3
alg.maxDeltaZ0SinTheta = 0.5
alg.particles = config.readName (self.containerName)
alg.preselection = config.getPreselection (self.containerName, '')
config.addSelection (self.containerName, '', alg.selectionDecoration,
bits=3)
# Set up the muon calibration and smearing algorithm:
alg = config.createAlgorithm( 'CP::MuonCalibrationAndSmearingAlg',
......
......@@ -11,6 +11,7 @@ def makeMuonAnalysisSequence( dataType, workingPoint,
shallowViewOutput = True,
postfix = '',
ptSelectionOutput = False,
trackSelection = True,
qualitySelectionOutput = True,
enableCutflow = False,
enableKinematicHistograms = False,
......@@ -30,6 +31,7 @@ def makeMuonAnalysisSequence( dataType, workingPoint,
names are unique.
ptSelectionOutput -- Whether or not to apply pt selection when creating
output containers.
trackSelection -- apply selection on tracks (d0, z0, siHits, etc.)
qualitySelectionOutput -- Whether or not to apply muon quality selection
when creating output containers.
enableCutflow -- Whether or not to dump the cutflow
......@@ -51,7 +53,8 @@ def makeMuonAnalysisSequence( dataType, workingPoint,
seq.addMetaConfigDefault ("selectionDecorCount", [])
makeMuonCalibrationSequence (seq, dataType, postfix=postfix,
ptSelectionOutput = ptSelectionOutput)
ptSelectionOutput = ptSelectionOutput,
trackSelection = trackSelection)
makeMuonWorkingPointSequence (seq, dataType, workingPoint, postfix=postfix,
qualitySelectionOutput = qualitySelectionOutput, isRun3Geo = isRun3Geo)
makeSharedObjectSequence (seq, deepCopyOutput = deepCopyOutput,
......@@ -68,7 +71,7 @@ def makeMuonAnalysisSequence( dataType, workingPoint,
def makeMuonCalibrationSequence( seq, dataType,
postfix = '', ptSelectionOutput = False):
postfix = '', ptSelectionOutput = False, trackSelection = False):
"""Create muon calibration analysis algorithms
This makes all the algorithms that need to be run first befor
......@@ -108,17 +111,18 @@ def makeMuonCalibrationSequence( seq, dataType,
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])})
# Set up the track selection algorithm:
alg = createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'MuonTrackSelectionAlg' + postfix )
alg.selectionDecoration = 'trackSelection' + postfix + ',as_bits'
alg.maxD0Significance = 3
alg.maxDeltaZ0SinTheta = 0.5
seq.append( alg, inputPropName = 'particles',
stageName = 'selection',
metaConfig = {'selectionDecorNames' : [alg.selectionDecoration],
'selectionDecorNamesOutput' : [alg.selectionDecoration],
'selectionDecorCount' : [3]},
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])})
if trackSelection:
alg = createAlgorithm( 'CP::AsgLeptonTrackSelectionAlg',
'MuonTrackSelectionAlg' + postfix )
alg.selectionDecoration = 'trackSelection' + postfix + ',as_bits'
alg.maxD0Significance = 3
alg.maxDeltaZ0SinTheta = 0.5
seq.append( alg, inputPropName = 'particles',
stageName = 'selection',
metaConfig = {'selectionDecorNames' : [alg.selectionDecoration],
'selectionDecorNamesOutput' : [alg.selectionDecoration],
'selectionDecorCount' : [3]},
dynConfig = {'preselection' : lambda meta : "&&".join (meta["selectionDecorNamesOutput"])})
# Set up the muon calibration and smearing algorithm:
alg = createAlgorithm( 'CP::MuonCalibrationAndSmearingAlg',
......
......@@ -81,7 +81,7 @@ def PHYSLITEKernelCfg(ConfigFlags, name='PHYSLITEKernel', **kwargs):
# Include, and then set up the electron analysis sequence:
from EgammaAnalysisAlgorithms.ElectronAnalysisSequence import makeElectronAnalysisSequence
electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.NonIso', shallowViewOutput = False, deepCopyOutput = True )
electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.NonIso', shallowViewOutput = False, deepCopyOutput = True, trackSelection = False )
electronSequence.configure( inputName = 'Electrons',
outputName = 'AnalysisElectrons' )
for element in electronSequence.getGaudiConfig2Components():
......@@ -100,7 +100,7 @@ def PHYSLITEKernelCfg(ConfigFlags, name='PHYSLITEKernel', **kwargs):
isRun3Geo = False
from AthenaConfiguration.Enums import LHCPeriod
if ConfigFlags.GeoModel.Run >= LHCPeriod.Run3: isRun3Geo = True
muonSequence = makeMuonAnalysisSequence( dataType, shallowViewOutput = False, deepCopyOutput = True, workingPoint = 'Loose.NonIso', isRun3Geo = isRun3Geo)
muonSequence = makeMuonAnalysisSequence( dataType, shallowViewOutput = False, deepCopyOutput = True, workingPoint = 'Loose.NonIso', isRun3Geo = isRun3Geo, trackSelection = False)
muonSequence.configure( inputName = 'Muons',
outputName = 'AnalysisMuons' )
for element in muonSequence.getGaudiConfig2Components():
......
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