3 """Define methods to construct configured Tile DSP threshold conditions tool and algorithm""" 
    5 from AthenaConfiguration.ComponentAccumulator 
import ComponentAccumulator
 
    6 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
   10     """Return component accumulator with configured Tile DSP threshold conditions algorithm 
   13         flags  -- Athena configuration flags 
   15         Source -- source of Tile auto correlation conditions (COOL, FILE). Defaults to COOL. 
   16         TileDSP_Threshold -- name of Tile auto correlation conditions object. Defaults to TileDSP_Threshold. 
   21     source = kwargs.get(
'Source', 
'COOL')
 
   22     dspThreshold = kwargs.get(
'TileDSP_Threshold', 
'TileDSP_Threshold')
 
   24     name = dspThreshold + 
'CondAlg' 
   29         from TileConditions.TileFolders 
import TileFolders
 
   30         folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline)
 
   32         if flags.IOVDb.DatabaseInstance  == 
'CONDBR2':
 
   33             dspThresholdFolder = folders.addSplitOnline(
'/TILE/ONL01/DSP/THRESHOLD', 
'/TILE/OFL02/DSP/THRESHOLD')
 
   35             raise(Exception(
"No Tile DSP threshold folder in %s" % flags.IOVDb.DatabaseInstancea))
 
   37         TileCondProxyCoolFlt=CompFactory.getComp(
"TileCondProxyCool<TileCalibDrawerFlt>")
 
   38         dspThresholdProxy = 
TileCondProxyCoolFlt(
'TileCondProxyCool_DspThreshold', Source = dspThresholdFolder)
 
   40         from IOVDbSvc.IOVDbSvcConfig 
import addFolderList
 
   43     elif source == 
'FILE':
 
   45         TileCondProxyFileFlt=CompFactory.getComp(
"TileCondProxyFile<TileCalibDrawerFlt>")
 
   46         dspThresholdProxy  = 
TileCondProxyFileFlt(
'TileCondProxyFile_DspThreshold', Source = 
'TileDefault.dspThreshold')
 
   48         raise(Exception(
"Invalid source: %s" % source))
 
   50     TileCalibFltCondAlg=CompFactory.getComp(
"TileCalibCondAlg<TileCalibDrawerFlt>")
 
   52                                                ConditionsProxy = dspThresholdProxy,
 
   53                                                TileCalibData = dspThreshold)
 
   55     acc.addCondAlgo(dspThresholdCondAlg)
 
   61     """Return component accumulator with configured private Tile DSP threshold tool 
   63         flags  -- Athena configuration flags 
   65         Source -- source of Tile DSP threshold conditions (COOL, FILE). Defaults to COOL. 
   66         TileDSP_Threshold -- name of Tile DSP threshold conditions object. Defaults to TileDSP_Threshold. 
   71     kwargs.setdefault(
'Source', 
'COOL')
 
   72     kwargs.setdefault(
'TileDSP_Threshold', 
'TileDSP_Threshold')
 
   74     dspThreshold = kwargs[
'TileDSP_Threshold']
 
   78     TileCondToolDspThreshold=CompFactory.TileCondToolDspThreshold
 
   84 if __name__ == 
"__main__":
 
   86     from AthenaConfiguration.AllConfigFlags 
import initConfigFlags
 
   87     from AthenaConfiguration.TestDefaults 
import defaultTestFiles
 
   88     from AthenaCommon.Logging 
import log
 
   95     flags.Input.Files = defaultTestFiles.RAW_RUN2
 
  101     print(autoCorrelationTool)
 
  103     acc.printConfig(withDetails = 
True, summariseProps = 
True)
 
  104     print(acc.getService(
'IOVDbSvc'))
 
  105     acc.store( 
open(
'TileDSP_Threshold.pkl',
'wb') )