diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/python/TRTCalibrationMgrConfig.py b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/python/TRTCalibrationMgrConfig.py index 314e0f256bf1da259c9964e4fa291695c5650d00..f022717dd8a76ab18f8b193425dd8186194472d5 100644 --- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/python/TRTCalibrationMgrConfig.py +++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/python/TRTCalibrationMgrConfig.py @@ -2,45 +2,8 @@ Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration """ - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -# from IOVDbSvc.IOVDbSvcConfig import addFolders -# from AthenaConfiguration.Enums import Format - - -# Tool to write a track-tuple with TRT hit info -def FillAlignTrkInfoCfg(flags,name='FillAlignTrkInfo',**kwargs) : - acc = ComponentAccumulator() - - from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg - kwargs.setdefault("TrackSummaryTool", acc.popToolsAndMerge(InDetTrackSummaryToolCfg(flags))) - - acc.setPrivateTools(CompFactory.FillAlignTrkInfo(name, **kwargs)) - return acc - - -# SERGI - This function should be in the correct athena pkg.. not here -# Tool to write a hit-tuple with R-t info -def FillAlignTRTHitsCfg(flags,name='FillAlignTRTHits',**kwargs) : - acc = ComponentAccumulator() - - kwargs.setdefault("minTimebinsOverThreshold", 0) - - from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_CalDbToolCfg, TRT_StrawStatusSummaryToolCfg, TRT_StrawNeighbourSvcCfg - kwargs.setdefault("TRTCalDbTool", acc.popToolsAndMerge(TRT_CalDbToolCfg(flags))) - kwargs.setdefault("TRTStrawSummaryTool", acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags))) - kwargs.setdefault("NeighbourSvc", acc.getPrimaryAndMerge(TRT_StrawNeighbourSvcCfg(flags))) - - acc.setPrivateTools(CompFactory.FillAlignTRTHits(name, **kwargs)) - - return acc - -# Tool to refit tracks -def FitToolCfg(flags, name = "FitToolCfg" ,**kwargs): - acc = ComponentAccumulator() - acc.setPrivateTools(CompFactory.FitTool(name, **kwargs)) - return acc # Tool to process R-t ntuple. Produces histograms and calibration text files. def TRTCalibratorCfg(flags, name="TRTCalibrator", **kwargs) : @@ -66,8 +29,6 @@ def TRTCalibratorCfg(flags, name="TRTCalibrator", **kwargs) : kwargs.setdefault("TRT_CalDbTool", acc.popToolsAndMerge(TRT_CalDbToolCfg(flags))) acc.setPrivateTools(CompFactory.TRTCalibrator(name, **kwargs)) - - return acc @@ -106,11 +67,10 @@ def TRT_CalibrationMgrCfg(flags,name='TRT_CalibrationMgr',calibconstants='',**kw kwargs.setdefault("DoCalibrate",False) - # FIXME - FillAlignTRTHitsCfg and FillAlignTrkInfoCfg functions should be moved to TRT_CalibTools (where the .cxx/.h are stored) + from TRT_CalibTools.TRTCalibToolsConfig import FillAlignTrkInfoCfg, FillAlignTRTHitsCfg, FitToolCfg kwargs.setdefault("AlignTrkTools", [acc.addPublicTool(acc.popToolsAndMerge(FillAlignTrkInfoCfg(flags))), acc.addPublicTool(acc.popToolsAndMerge(FillAlignTRTHitsCfg(flags)))] ) - # FIXME - FitToolCfg function should be moved to TRT_CalibTools (where the .cxx/.h are stored) kwargs.setdefault("FitTools", [acc.popToolsAndMerge(FitToolCfg(flags))]) # check this line below - needs the function @@ -151,7 +111,7 @@ def TRT_TrackHoleSearch(flags,name="TRT_TrackHoleSearch",**kwargs): return acc -# we need to recheck this not fully sure - Sergi +# we need to recheck this, not fully sure - Sergi def TRT_StrawStatusCfg(flags,name='InDet__TRT_StrawStatus',**kwargs) : if "TRT_TrackHoleSearch" not in kwargs: @@ -164,15 +124,14 @@ def TRT_StrawStatusCfg(flags,name='InDet__TRT_StrawStatus',**kwargs) : if __name__ == '__main__': - print("start running") + from AthenaConfiguration.AllConfigFlags import initConfigFlags flags = initConfigFlags() from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags - print(defaultTestFiles.RAW_RUN3) - flags.Input.Files = defaultTestFiles.RAW_RUN3 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3 + flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2023-03" flags.Exec.MaxEvents = 10 @@ -182,8 +141,6 @@ if __name__ == '__main__': flags.fillFromArgs() flags.lock() - print("start running 1") - # Set up the main service "acc" from AthenaConfiguration.MainServicesConfig import MainServicesCfg acc = MainServicesCfg(flags) diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/CMakeLists.txt b/InnerDetector/InDetCalibTools/TRT_CalibTools/CMakeLists.txt index aacff73eefbf1bfa35cda94ea4b855d8c0ea3793..def4d401e3c4509d2f52141a2fdda720c39d49e6 100644 --- a/InnerDetector/InDetCalibTools/TRT_CalibTools/CMakeLists.txt +++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/CMakeLists.txt @@ -19,3 +19,5 @@ atlas_add_component( TRT_CalibTools src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AtlasDetDescr CommissionEvent CxxUtils EventPrimitives GaudiKernel Identifier InDetIdentifier InDetPrepRawData InDetRIO_OnTrack TRT_CalibData TRT_CalibToolsLib TRT_ConditionsData TRT_ConditionsServicesLib TRT_DriftCircleToolLib TRT_DriftFunctionToolLib TRT_ReadoutGeometry TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack TrkToolInterfaces TrkTrack TrkTrackSummary xAODEventInfo xAODTracking ) + +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) \ No newline at end of file diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/python/TRTCalibToolsConfig.py b/InnerDetector/InDetCalibTools/TRT_CalibTools/python/TRTCalibToolsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..175b624f2c8df68edf3261f983939d8b754cb081 --- /dev/null +++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/python/TRTCalibToolsConfig.py @@ -0,0 +1,39 @@ +""" +Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + + +# Tool to write a track-tuple with TRT hit info +def FillAlignTrkInfoCfg(flags,name='FillAlignTrkInfo',**kwargs) : + acc = ComponentAccumulator() + + from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg + kwargs.setdefault("TrackSummaryTool", acc.popToolsAndMerge(InDetTrackSummaryToolCfg(flags))) + + acc.setPrivateTools(CompFactory.FillAlignTrkInfo(name, **kwargs)) + return acc + + +# Tool to write a hit-tuple with R-t info +def FillAlignTRTHitsCfg(flags,name='FillAlignTRTHits',**kwargs) : + acc = ComponentAccumulator() + + kwargs.setdefault("minTimebinsOverThreshold", 0) + + from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_CalDbToolCfg, TRT_StrawStatusSummaryToolCfg, TRT_StrawNeighbourSvcCfg + kwargs.setdefault("TRTCalDbTool", acc.popToolsAndMerge(TRT_CalDbToolCfg(flags))) + kwargs.setdefault("TRTStrawSummaryTool", acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags))) + kwargs.setdefault("NeighbourSvc", acc.getPrimaryAndMerge(TRT_StrawNeighbourSvcCfg(flags))) + + acc.setPrivateTools(CompFactory.FillAlignTRTHits(name, **kwargs)) + + return acc + + +# Tool to refit tracks +def FitToolCfg(flags, name = "FitToolCfg" ,**kwargs): + acc = ComponentAccumulator() + acc.setPrivateTools(CompFactory.FitTool(name, **kwargs)) + return acc