36 ''' Function to configure TileTBAANtuple algorithm.'''
40 cisRun = flags.Tile.RunType
is TileRunType.CIS
41 monoRun = flags.Tile.RunType
is TileRunType.MONOCIS
42 pedestalRun = flags.Tile.RunType
is TileRunType.PED
45 offlineUnits = 0
if cisRun
or monoRun
or pedestalRun
else 3
46 calibrateEnergy = (offlineUnits != 0)
48 run = flags.Input.RunNumbers[0]
51 useFELIX =
True if run > 2310438
else False
55 kwargs.setdefault(
'TileDigitsContainer',
'TileDigitsCnt')
56 kwargs.setdefault(
'TileBeamElemContainer',
'TileBeamElemCnt')
57 kwargs.setdefault(
'TileRawChannelContainerFlat',
"")
58 kwargs.setdefault(
'TileRawChannelContainerFit',
'TileRawChannelFit' if flags.Tile.doFit
else "")
59 kwargs.setdefault(
'TileRawChannelContainerOpt',
"TileRawChannelOpt2" if flags.Tile.doOpt2
else "")
60 kwargs.setdefault(
'TileRawChannelContainerDsp',
"")
61 kwargs.setdefault(
'TileRawChannelContainerFitCool',
'TileRawChannelFitCool' if flags.Tile.doFitCOOL
else "")
63 kwargs.setdefault(
'TileDigitsContainerFlx',
'TileDigitsFlxCnt' if useFELIX
else "")
64 kwargs.setdefault(
'TileRawChannelContainerFitFlx',
'TileRawChannelFlxFit' if useFELIX
and flags.Tile.doFit
else "")
65 kwargs.setdefault(
'TileRawChannelContainerOptFlx',
'TileRawChannelFlxOpt2' if useFELIX
and flags.Tile.doOpt2
else "")
67 kwargs.setdefault(
'TileHitContainer',
"")
68 kwargs.setdefault(
'TileHitVector',
"")
69 kwargs.setdefault(
'CaloCellContainer',
'AllCalo')
71 kwargs.setdefault(
'TileLaserObj',
"")
73 kwargs.setdefault(
'OfflineUnits', offlineUnits)
74 kwargs.setdefault(
'CalibrateEnergy', calibrateEnergy)
75 kwargs.setdefault(
'CalibMode', pedestalRun
or cisRun)
76 kwargs.setdefault(
'PMTOrder',
not (cisRun
or monoRun
or pedestalRun))
78 kwargs.setdefault(
'NSamples', -1)
79 kwargs.setdefault(
'NSamplesFelix', 16
if useFELIX
else 0)
81 kwargs.setdefault(
'TBperiod', TBperiod)
85 from TileGeoModel.TileGMConfig
import TileGMCfg
88 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
91 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
94 if 'TileCondToolEmscale' not in kwargs:
95 from TileConditions.TileEMScaleConfig
import TileCondToolEmscaleCfg
97 kwargs[
'TileCondToolEmscale'] = emScaleTool
99 from TileRecUtils.TileDQstatusConfig
import TileDQstatusAlgCfg
103 from TileConditions.TileSamplingFractionConfig
import TileSamplingFractionCondAlgCfg
106 kwargs[
'TileSamplingFraction'] =
""
109 outputFile = f
'tiletb_{run}.aan.root'
110 histsvc = CompFactory.THistSvc()
111 histsvc.Output += [
"%s DATAFILE='%s' OPT='RECREATE'" % (
'AANT', outputFile)]
112 acc.addService(histsvc)
114 alg = CompFactory.TileTBAANtuple(**kwargs)
115 from TileMonitoring.TileTBBeamChambersCalibration
import updateBeamChambersCalibrations
117 acc.addEventAlgo(alg, primary=
True)