5 @file TileMuIdConfig.py
6 @brief Python configuration of Tile look for mu algorithm for the Run III
9 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10 from AthenaConfiguration.ComponentFactory
import CompFactory
16 from TileGeoModel.TileGMConfig
import TileGMCfg
19 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
22 kwargs.setdefault(
'name',
'TileLookForMuAlg')
23 kwargs.setdefault(
'TileMuTagsOutputName',
'TileMuObj')
25 kwargs.setdefault(
'CellsNames',
'AllCalo')
27 kwargs.setdefault(
'LowerTresh0MeV', 80.0)
28 kwargs.setdefault(
'LowerTresh1MeV', 80.0)
29 kwargs.setdefault(
'LowerTresh2MeV', 80.0)
30 kwargs.setdefault(
'LowerTreshScinMeV', 160.0)
35 UpperTresh2MeV=[2370.0, 2100.0, 900.0, 1050.0, 1050.0, 1110.0, 1590.0,
36 1110.0, 1050.0, 1050.0, 900.0, 2100.0, 2370.0]
38 kwargs.setdefault(
'UpperTresh2MeV', UpperTresh2MeV)
39 if len(kwargs[
'UpperTresh2MeV']) != nCellsD:
40 raise RuntimeError(
'Energy thresholds for %s Tile D cells are needed' % nCellsD)
44 UpperTresh1MeV=[1680.0, 1500.0, 1440.0, 1380.0, 1050.0, 390.0,
45 1110.0, 1860.0, 1890.0, 1800.0, 1860.0, 1890.0,
46 1770.0, 1980.0, 2550.0, 2550.0, 1980.0, 1770.0,
47 1890.0, 1860.0, 1800.0, 1890.0, 1860.0, 1110.0,
48 390.0, 1050.0, 1380.0, 1440.0, 1500.0, 1680.0]
50 kwargs.setdefault(
'UpperTresh1MeV', UpperTresh1MeV)
51 if len(kwargs[
'UpperTresh1MeV']) != nCellsBC:
52 raise RuntimeError(
'Energy thresholds for %s Tile BC cells are needed' % nCellsBC)
56 UpperTresh0MeV=[1680.0, 1380.0, 1230.0, 1140.0, 210.0, 900.0,
57 960.0, 840.0, 930.0, 840.0, 840.0, 750.0,
58 870.0, 960.0, 1350.0, 1350.0, 960.0, 870.0,
59 750.0, 840.0, 840.0, 930.0, 840.0, 960.0,
60 900.0, 210.0, 1140.0, 1230.0, 1380.0, 1680.0]
62 kwargs.setdefault(
'UpperTresh0MeV', UpperTresh0MeV)
63 if len(kwargs[
'UpperTresh0MeV']) != nCellsA:
64 raise RuntimeError(
'Energy thresholds for %s Tile A cells are needed' % nCellsA)
70 From3to2=[5,0,1,2,3,4, 5,2,3,4,5,6, 2,6,7,0,0,0, 3,7,8,9,0,0,
71 3,9,10,11,0,0, 2,12,13,0,0,0, 2,14,15,0,0,0, 2,16,17,0,0,0,
72 3,18,19,20,0,0, 3,20,21,22,0,0, 2,22,23,0,0,0, 5,23,24,25,26,27,
75 kwargs.setdefault(
'From3to2', From3to2)
76 if len(kwargs[
'From3to2']) != (nCellsD * 6):
77 raise RuntimeError(
'6x%s numbers required for Tile D -> BC cells mapping' % nCellsD)
81 From2to1=[2,1,2,0,0,0, 3,1,2,3,0,0, 3,2,3,4,0,0, 3,3,4,5,0,0, 2,4,5,0,0,0,
82 1,5,0,0,0,0, 1,6,0,0,0,0, 1,7,0,0,0,0, 1,8,0,0,0,0, 1,9,0,0,0,0,
83 1,10,0,0,0,0, 1,11,0,0,0,0, 1,12,0,0,0,0, 1,13,0,0,0,0, 1,14,0,0,0,0,
84 1,15,0,0,0,0, 1,16,0,0,0,0, 1,17,0,0,0,0, 1,18,0,0,0,0, 1,19,0,0,0,0,
85 1,20,0,0,0,0, 1,21,0,0,0,0, 1,22,0,0,0,0, 1,23,0,0,0,0, 1,24,0,0,0,0,
86 2,24,25,0,0,0, 3,24,25,26,0,0, 3,25,26,27,0,0, 3,26,27,28,0,0, 2,27,28,0,0,0]
88 kwargs.setdefault(
'From2to1', From2to1)
89 if len(kwargs[
'From2to1']) != (nCellsBC * 6):
90 raise RuntimeError(
'6x%s numbers required for Tile BC -> A cells mapping' % nCellsBC)
93 TileLookForMuAlg=CompFactory.TileLookForMuAlg
97 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD, addToAOD
98 toStore=
"TileMuContainer#"+kwargs[
"TileMuTagsOutputName"]
105 if __name__==
'__main__':
108 from AthenaCommon.Logging
import log
113 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
114 from AthenaConfiguration.TestDefaults
import defaultTestFiles
116 flags.Input.Files = defaultTestFiles.ESD
117 flags.DQ.useTrigger =
False
118 flags.DQ.enableLumiAccess =
False
122 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
123 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
129 cfg.printConfig(withDetails =
True, summariseProps =
True)
132 cfg.store(
open(
'TileLookForMuAlg.pkl',
'wb') )
134 sc = cfg.run(maxEvents=3)
138 sys.exit(
not sc.isSuccess())