2 """Define functions for LAr Cluster Cell Dumper with ComponentAccumulator"""
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaCommon.Logging
import logging
8 from AthenaConfiguration.Enums
import LHCPeriod
11 from IOVDbSvc.IOVDbSvcConfig
import addFolders
15 isMC = flags.Input.isMC
18 kwargs.setdefault(
"doAssocTopoCluster711Dump",
False)
19 kwargs.setdefault(
"doClusterDump",
False)
20 kwargs.setdefault(
"doPhotonDump",
False)
21 kwargs.setdefault(
"doTruthEventDump", isMC)
22 kwargs.setdefault(
"doTruthPartDump", isMC)
23 kwargs.setdefault(
"doLArEMBHitsDump", isMC)
25 kwargs.setdefault(
"skipEmptyEvents",
True)
26 kwargs.setdefault(
"noBadCells",
False)
27 kwargs.setdefault(
"printCellsClus",
False)
30 kwargs.setdefault(
"electronEtaCut", 1.4)
31 kwargs.setdefault(
"doTagAndProbe",
True)
32 kwargs.setdefault(
"doElecSelectByTrackOnly",
True)
33 kwargs.setdefault(
"getAssociatedTopoCluster",
True)
34 kwargs.setdefault(
"getLArCalibConstants",
True)
35 kwargs.setdefault(
"etMinProbe", 15)
36 kwargs.setdefault(
"etMinTag", 15)
37 kwargs.setdefault(
"minZeeMassTP", 66)
38 kwargs.setdefault(
"maxZeeMassTP", 116)
41 kwargs.setdefault(
"EventInfoContainerKey" ,
"EventInfo")
42 kwargs.setdefault(
"PrimaryVertexContainerKey" ,
"PrimaryVertices")
43 kwargs.setdefault(
"CaloClusterContainerKey" ,
"CaloCalTopoClusters")
44 kwargs.setdefault(
"TruthParticleContainerKey" ,
"TruthParticles")
45 kwargs.setdefault(
"ElectronContainerKey" ,
"Electrons")
46 kwargs.setdefault(
"TruthEventContainerKey" ,
"TruthEvents")
47 kwargs.setdefault(
"LArEMBHitContainerKey" ,
"LArHitEMB_ClusterThinned")
48 kwargs.setdefault(
"LArRawChannelContainerKey" ,
"LArRawChannels_ClusterThinned")
49 kwargs.setdefault(
"CaloCellContainerKey" ,
"AllCalo_ClusterThinned")
50 kwargs.setdefault(
"LArDigitContainerKey" ,
"LArDigitContainer_ClusterThinned")
52 if (kwargs.get(
"doElecSelectByTrackOnly")):
53 kwargs.setdefault(
"MyElectronSelectionKey" ,
"MySelectedElectrons")
55 kwargs.setdefault(
"MyElectronSelectionKey" ,
"MyTagAndProbeElectrons")
57 kwargs.setdefault(
"isMC", isMC)
64 from LArCabling.LArCablingConfig
import LArFebRodMappingCfg, LArOnOffIdMappingCfg
65 acc.merge (LArFebRodMappingCfg (flags))
66 acc.merge (LArOnOffIdMappingCfg (flags))
69 from CaloCellCorrection.CaloCellCorrectionConfig
import CaloCellPedestalCorrCfg
72 obj =
"AthenaAttributeList"
77 if 'COMP200' in flags.IOVDb.DatabaseInstance:
78 obj=
'LArDSPThresholdsComplete'
80 fldThr=
'/LAR/Configuration/DSPThreshold/Thresholds'
81 obj=
'LArDSPThresholdsComplete'
83 kwargs.setdefault(
"Run2DSPThresholdsKey", fldThr)
84 acc.merge(
addFolders(flags,fldThr,
"LAR_ONL", className=obj, db=dbString))
87 fldThr=
"/LAR/Configuration/DSPThresholdFlat/Thresholds"
88 fldOflEneResc=
"/LAR/CellCorrOfl/EnergyCorr"
89 fsampl=
"/LAR/ElecCalibMC/fSampl"
92 kwargs.setdefault(
"Run2DSPThresholdsKey", fldThr)
93 kwargs.setdefault(
"OflEneRescalerKey", fldOflEneResc)
94 kwargs.setdefault(
"fSamplKey", fsampl)
96 acc.merge(
addFolders(flags,fldThr,
"LAR_ONL", className=obj, db=dbString))
97 acc.merge(
addFolders(flags,[fldOflEneResc,],
"LAR_OFL", className=
"AthenaAttributeList"))
99 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
104 from LArRecUtils.LArRecUtilsConfig
import LArOFCCondAlgCfg
107 if flags.GeoModel.Run
is LHCPeriod.Run1:
114 kwargs.setdefault(
"Run2DSPThresholdsKey",fldThr)
115 kwargs.setdefault(
"OflEneRescalerKey", fldOflEneResc)
118 from LArRecUtils.LArADC2MeVCondAlgConfig
import LArADC2MeVCondAlgCfg
121 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg, LArBadFebCfg
126 EventReaderAlg = CompFactory.EventReaderAlg(name, **kwargs)
127 acc.addEventAlgo(EventReaderAlg)
133 mlog = logging.getLogger(
'CaloCablingAndGeometryCfg...')
135 from LArCabling.LArCablingConfig
import LArFebRodMappingCfg, LArOnOffIdMappingCfg
136 from AtlasGeoModel.GeoModelConfig
import GeoModelCfg
140 acc.merge(LArFebRodMappingCfg (flags))
141 acc.merge(LArOnOffIdMappingCfg (flags))
144 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
147 from TileGeoModel.TileGMConfig
import TileGMCfg
150 mlog.info(
"CaloCablingAndGeometryCfg added to CA.")
156 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
157 from CaloRec.CaloBCIDCoeffsCondAlgConfig
import CaloBCIDCoeffsCondAlgCfg
165 acc.merge (CaloBCIDCoeffsCondAlgCfg (flags))
168 from LumiBlockComps.BunchCrossingCondAlgConfig
import BunchCrossingCondAlgCfg
171 from LumiBlockComps.LuminosityCondAlgConfig
import LuminosityCondAlgCfg
172 acc.merge (LuminosityCondAlgCfg (flags))
178 mlog = logging.getLogger(
'LArClusterCellDumperCfg')
179 mlog.info(
"merging LArClusterCellDumperCfg config files...")
188 acc.merge(CaloCablingAndGeo)
189 acc.merge(EventReaderAlg)
191 mlog.info(
"All algorithms merged successfully!")
195 if __name__ ==
"__main__":
196 mlog = logging.getLogger(
'LArClusterCellDumperCfg')
198 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
200 from AthenaConfiguration.TestDefaults
import defaultTestFiles
201 flags.Input.Files = defaultTestFiles.ESD
202 flags.Exec.MaxEvents = 50
203 flags.Common.MsgSuppression =
False
208 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
209 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
213 acc.addService(CompFactory.THistSvc(
214 Output = [
"rec DATAFILE='dumper_outputMC.root', OPT='RECREATE'"]))
217 mlog.info(
"Executing LArClusterCellDumperCfg...")
220 sys.exit(acc.run().isFailure())