ATLAS Offline Software
Functions | Variables
python.DigitizationParametersConfig Namespace Reference

Functions

def writeDigitizationMetadata (flags)
 
def readDigitizationParameters (flags)
 
def writeDigitizationParameters (flags)
 

Variables

string folderName = "/Digitization/Parameters"
 

Function Documentation

◆ readDigitizationParameters()

def python.DigitizationParametersConfig.readDigitizationParameters (   flags)
Read digitization parameters metadata

Definition at line 85 of file DigitizationParametersConfig.py.

86  """Read digitization parameters metadata"""
87  from IOVDbSvc.IOVDbSvcConfig import addFolders
88  if flags.Digitization.ReadParametersFromDB:
89  # Here we are in a job which runs digitization, so the
90  # /Digitization/Parameters metadata is not present in the
91  # input file and will be created during the job
92  return addFolders(flags, folderName, detDb="DigitParams.db", db="DIGPARAM", className="AthenaAttributeList")
93  return addFolders(flags, folderName, className="AthenaAttributeList", tag="HEAD")
94 
95 

◆ writeDigitizationMetadata()

def python.DigitizationParametersConfig.writeDigitizationMetadata (   flags)

Definition at line 11 of file DigitizationParametersConfig.py.

11 def writeDigitizationMetadata(flags):
12  from IOVDbMetaDataTools import ParameterDbFiller
13  dbFiller = ParameterDbFiller.ParameterDbFiller()
14  myRunNumber, myEndRunNumber = getMinMaxRunNumbers(flags)
15  logDigitizationWriteMetadata = logging.getLogger( 'DigitizationParametersConfig' )
16  logDigitizationWriteMetadata.debug('ParameterDbFiller BeginRun = %s', str(myRunNumber) )
17  dbFiller.setBeginRun(myRunNumber)
18  logDigitizationWriteMetadata.debug('ParameterDbFiller EndRun = %s', str(myEndRunNumber) )
19  dbFiller.setEndRun(myEndRunNumber)
20  #-------------------------------------------------
21  # Adding jobproperties to the list of MetaData
22  #-------------------------------------------------
23  # Here list the digitization jobproperties we want to write out as MetaData.
24  digitMetaDataKeys = { 'doInDetNoise' : 'Digitization.DoInnerDetectorNoise',
25  'doCaloNoise' : 'Digitization.DoCaloNoise',
26  'bunchSpacing' : 'Beam.BunchSpacing',
27  'beamType' : 'Beam.Type',
28  'IOVDbGlobalTag' : 'IOVDb.GlobalTag',
29  'DetDescrVersion' : 'GeoModel.AtlasVersion',
30  'finalBunchCrossing' : 'Digitization.PU.FinalBunchCrossing',
31  'initialBunchCrossing' : 'Digitization.PU.InitialBunchCrossing',
32  'physicsList' : 'Sim.PhysicsList', #TODO migrate clients to use /Simulation/Parameters metadata?
33  'digiSteeringConf' : 'Digitization.DigiSteeringConf',
34  'pileUp' : 'Digitization.PileUp',
35  }
36  logDigitizationWriteMetadata.info('Filling Digitization MetaData')
37  for testKey, testFlag in digitMetaDataKeys.items():
38  if flags.hasFlag(testFlag):
39  testValue = flags._get(testFlag)
40  if isinstance(testValue, FlagEnum):
41  testValue = testValue.value
42  if not isinstance(testValue, str):
43  testValue = str(testValue)
44  dbFiller.addDigitParam(testKey, testValue)
45  logDigitizationWriteMetadata.info('DigitizationMetaData: setting "%s" to be %s', testKey, testValue)
46  else :
47  logDigitizationWriteMetadata.debug('DigitizationMetaData: ConfigFlags.%s is not available.', testFlag)
48  del digitMetaDataKeys
49 
50  # doMuonNoise no actual flag in new-style
51  testKey = "doMuonNoise"
52  testValue = str(not flags.Common.isOverlay) # Hardcoded for now
53  dbFiller.addDigitParam(testKey, testValue)
54  logDigitizationWriteMetadata.info('DigitizationMetaData: setting "%s" to be %s', testKey, testValue)
55 
56  # Bunch Structure - hardcoded for now
57  testKey = "BeamIntensityPattern"
58  if flags.Digitization.PileUp:
59  testValue = str(flags.Digitization.PU.BeamIntensityPattern)
60  else:
61  testValue = "None"
62  logDigitizationWriteMetadata.info('DigitizationMetaData: setting "%s" to be %s', testKey, testValue)
63  dbFiller.addDigitParam64(testKey, testValue)
64 
65  # intraTrainBunchSpacing - hardcoded for now
66  testKey = "intraTrainBunchSpacing"
67  testValue = str(25) # This should be either be determined from the BeamIntensityPattern or set as flags.Beam.BunchSpacing
68  dbFiller.addDigitParam(testKey, testValue)
69  logDigitizationWriteMetadata.info('DigitizationMetaData: setting "%s" to be %s', testKey, testValue)
70 
71 
72  from AthenaConfiguration.DetectorConfigFlags import getEnabledDetectors
73  digiDets = ['Truth'] + getEnabledDetectors(flags)
74  logDigitizationWriteMetadata.info("Setting 'DigitizedDetectors' = %s" , repr(digiDets))
75  dbFiller.addDigitParam('DigitizedDetectors', repr(digiDets))
76 
77  #-------------------------------------------------
78  # Make the MetaData Db
79  #-------------------------------------------------
80  dbFiller.genDigitDb()
81 
82  return writeDigitizationParameters(flags)
83 
84 

◆ writeDigitizationParameters()

def python.DigitizationParametersConfig.writeDigitizationParameters (   flags)
Write digitization parameters metadata

Definition at line 96 of file DigitizationParametersConfig.py.

97  """Write digitization parameters metadata"""
98  if flags.Overlay.DataOverlay:
99  return ComponentAccumulator()
100 
101  from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg, addFolders
102  acc = IOVDbSvcCfg(flags, FoldersToMetaData=[folderName])
103  acc.merge(addFolders(flags, folderName, detDb="DigitParams.db", db="DIGPARAM"))
104  return acc

Variable Documentation

◆ folderName

string python.DigitizationParametersConfig.folderName = "/Digitization/Parameters"

Definition at line 8 of file DigitizationParametersConfig.py.

python.DigitizationParametersConfig.readDigitizationParameters
def readDigitizationParameters(flags)
Definition: DigitizationParametersConfig.py:85
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.DetectorConfigFlags.getEnabledDetectors
def getEnabledDetectors(flags, geometry=False)
Definition: DetectorConfigFlags.py:147
python.DigitizationParametersConfig.writeDigitizationParameters
def writeDigitizationParameters(flags)
Definition: DigitizationParametersConfig.py:96
PyAthena::repr
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
Definition: PyAthenaUtils.cxx:106
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:19
python.DigitizationParametersConfig.writeDigitizationMetadata
def writeDigitizationMetadata(flags)
Definition: DigitizationParametersConfig.py:11
str
Definition: BTagTrackIpAccessor.cxx:11
python.EventIdOverrideConfig.getMinMaxRunNumbers
def getMinMaxRunNumbers(flags)
Definition: EventIdOverrideConfig.py:101