ATLAS Offline Software
VGammaORConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4 from AnalysisAlgorithmsConfig.ConfigAccumulator import DataType
5 from AthenaCommon.Logging import logging
6 
7 class VGammaORBlock(ConfigBlock):
8 
9  def __init__(self):
10  super(VGammaORBlock, self).__init__()
11  self.addOption('dR_lepton_photon_cuts', [0.0, 0.05, 0.075, 0.1, 0.125, 0.15, 0.2], type=list,
12  info='list of cuts on deltaR between the leptons and the photon.')
13  self.addOption('photon_pT_cuts', [10e3], type=list,
14  info='list of pT cuts (in MeV) on the photon.')
15  self.addOption('noFilter', False, type=bool,
16  info='do not apply an event filter. The default is False, i.e. remove events not passing the overlap removal. If set to True, all events are kept and the decision flag is written to the output ntuple instead. ')
17  self.addOption('keepInOverlap', [700011, 700012, 700013, 700014, 700015, 700016, 700017], type=list,
18  info='list of DSIDs (integers) for which events are to be kept if found to be in the overlap region. For instance, Vy samples in V+jets vs Vy+jets overlap removal. The default list was taken from the PmgWeakBosonProcesses twiki but is not actively maintained!')
19  self.addOption('removeInOverlap', [700320, 700321, 700322, 700467, 700468, 700469, 700323, 700324, 700325, 700470, 700471, 700472, 700326, 700327, 700328, 700329, 700330, 700331, 700332, 700333, 700334, 700473, 700474, 700475, 700476, 700477, 700478, 700479, 700480, 700481, 700341, 700342, 700343, 700338, 700339, 700340, 700344, 700345, 700346, 700347, 700348, 700349, 700598, 700599, 700439, 700440, 700441], type=list,
20  info='list of DSIDs (integers) for which events are to be remoevd if found to be in the overlap region. For instance, V samples in V+jets vs Vy+jets overlap removal. The default list was taken from the PmgWeakBosonProcesses twiki but is not actively maintained!')
21 
22  def makeAlgs(self, config):
23 
24  log = logging.getLogger('VGammaORBlock')
25 
26  if config.dataType() is DataType.Data: return
27  if config.dsid() not in self.keepInOverlap and config.dsid() not in self.removeInOverlap:
28  log.warning(f"CP::VGammaORAlg --> this sample has DSID {config.dsid()}, which is not set up for overlap removal. Will skip the configuration of the algorithm!")
29  return
30 
31  alg = config.createAlgorithm('CP::VGammaORAlg', 'VGammaORAlg')
32  alg.affectingSystematicsFilter = '.*'
33  alg.noFilter = self.noFilter
34  alg.FilterDescription = 'events passing V/VGamma overlap removal'
35  alg.eventDecisionOutputDecoration = 'ignore_vgammaor_%SYS%'
36 
37  if config.dsid() in self.keepInOverlap:
38  alg.keepOverlap = True
39  elif config.dsid() in self.removeInOverlap:
40  alg.keepOverlap = False
41 
42  config.addPrivateTool('VGammaORTool', 'VGammaORTool')
43  alg.VGammaORTool.dR_lepton_photon_cuts = self.dR_lepton_photon_cuts
44  alg.VGammaORTool.photon_pT_cuts = self.photon_pT_cuts
45 
46  if self.noFilter:
47  # if we don't apply the filter, we still want to study the output of the tool!
48  config.addOutputVar('EventInfo', 'in_vgamma_overlap_%SYS%', 'in_vgamma_overlap', noSys=True)
python.VGammaORConfig.VGammaORBlock.__init__
def __init__(self)
Definition: VGammaORConfig.py:9
python.VGammaORConfig.VGammaORBlock
Definition: VGammaORConfig.py:7
python.VGammaORConfig.VGammaORBlock.makeAlgs
def makeAlgs(self, config)
Definition: VGammaORConfig.py:22