From 7cfba05d1efc85b4587fd937de406113a4145372 Mon Sep 17 00:00:00 2001 From: Soshi Tsuno <soshi.tsuno@cern.ch> Date: Tue, 14 Jan 2020 14:31:57 +0000 Subject: [PATCH] Toward new deadmap for RUN-3 (ATLASRECTS-5014) --- .../python/PixelConditionsConfig.py | 344 ++++++++++++++++-- .../src/PixelAlignCondAlg.cxx | 7 - .../src/PixelAlignCondAlg.h | 6 +- .../src/PixelCablingCondAlg.cxx | 44 +-- .../src/PixelCablingCondAlg.h | 33 +- .../src/PixelChargeCalibCondAlg.cxx | 9 +- .../src/PixelChargeCalibCondAlg.h | 11 +- .../src/PixelConfigCondAlg.cxx | 213 +++-------- .../src/PixelConfigCondAlg.h | 319 ++++++++++++---- .../src/PixelDCSCondHVAlg.cxx | 69 ++-- .../src/PixelDCSCondHVAlg.h | 25 +- .../src/PixelDCSCondStateAlg.cxx | 118 ++---- .../src/PixelDCSCondStateAlg.h | 28 +- .../src/PixelDCSCondStatusAlg.cxx | 98 +++++ .../src/PixelDCSCondStatusAlg.h | 52 +++ .../src/PixelDCSCondTempAlg.cxx | 73 ++-- .../src/PixelDCSCondTempAlg.h | 31 +- .../src/PixelDeadMapCondAlg.cxx | 97 ++--- .../src/PixelDeadMapCondAlg.h | 13 +- .../src/PixelDetectorElementCondAlg.cxx | 7 - .../src/PixelDetectorElementCondAlg.h | 8 +- .../src/PixelDistortionAlg.cxx | 76 ++-- .../src/PixelDistortionAlg.h | 60 +-- .../src/PixelHitDiscCnfgAlg.cxx | 29 +- .../src/PixelHitDiscCnfgAlg.h | 20 +- .../src/PixelOfflineCalibCondAlg.cxx | 15 +- .../src/PixelOfflineCalibCondAlg.h | 28 +- .../src/PixelReadoutSpeedAlg.cxx | 13 +- .../src/PixelReadoutSpeedAlg.h | 15 +- .../src/PixelSiliconConditionsTestAlg.cxx | 5 +- .../src/PixelSiliconConditionsTestAlg.h | 12 +- .../src/PixelTDAQCondAlg.cxx | 78 ++-- .../src/PixelTDAQCondAlg.h | 24 +- .../PixelConditionsAlgorithms_entries.cxx | 2 + .../PixelConditionsData/PixelCalibData.h | 88 ----- .../PixelConditionsData/PixelCalibDataColl.h | 20 - .../PixelConditionsData/PixelDCSData.h | 91 ----- .../PixelConditionsData/PixelDCSHVData.h | 33 ++ .../PixelConditionsData/PixelDCSStateData.h | 35 ++ .../PixelConditionsData/PixelDCSStatusData.h | 35 ++ .../PixelConditionsData/PixelDCSTempData.h | 33 ++ .../PixelConditionsData/PixelModuleData.h | 153 ++++++-- .../PixelConditionsData/PixelTDAQData.h | 33 ++ .../src/PixelCalibData.cxx | 17 - .../PixelConditionsData/src/PixelDCSData.cxx | 50 --- .../src/PixelDCSHVData.cxx | 16 + .../src/PixelDCSStateData.cxx | 16 + .../src/PixelDCSStatusData.cxx | 16 + .../PixelConditionsData/src/PixelDCSTemp.cxx | 17 + .../src/PixelModuleData.cxx | 117 ++++-- .../PixelConditionsData/src/PixelTDAQData.cxx | 16 + .../PixelConditionsTools/IPixelTDAQSvc.h | 43 --- .../python/PixelConditionsSummaryConfig.py | 31 +- .../python/PixelConditionsSummaryToolSetup.py | 105 ------ .../python/PixelDCSConditionsConfig.py | 32 -- .../src/PixelConditionsSummaryTool.cxx | 198 +++++----- .../src/PixelConditionsSummaryTool.h | 18 +- .../python/PixelLorentzAngleConfig.py | 13 +- .../python/PixelLorentzAngleToolSetup.py | 4 +- .../src/PixelSiLorentzAngleCondAlg.cxx | 8 +- .../src/PixelSiLorentzAngleCondAlg.h | 32 +- .../python/PixelSiPropertiesConfig.py | 13 +- .../python/PixelSiPropertiesToolSetup.py | 4 +- .../src/PixelSiPropertiesCondAlg.cxx | 8 +- .../src/PixelSiPropertiesCondAlg.h | 25 +- .../PixelCabling/python/PixelCablingConfig.py | 120 ------ .../python/PixelCablingConfigNew.py | 119 +----- .../python/FastSiDigitizationConfig.py | 2 +- .../share/PixelDigitization_jobOptions.py | 2 +- .../python/PixelDigitizationConfig.py | 324 +++++++++++------ .../python/PixelDigitizationConfigNew.py | 43 ++- .../share/InDetDxAOD.py | 9 + .../src/PixelPrepDataToxAOD.cxx | 6 +- .../src/PixelPrepDataToxAOD.h | 19 +- .../InDetRecExample/python/TrackingCommon.py | 19 +- .../InDetRecExample/share/InDetRecCabling.py | 4 +- .../share/InDetRecConditionsAccess.py | 134 ++++++- .../share/InDetRecLoadTools.py | 4 - .../share/postInclude.SLHC_Rec.py | 1 + .../python/InDetTrigConfigConditions.py | 162 +++++++-- .../python/TrackSummaryToolWorkaround.py | 10 + .../python/TRTMonitoringRun3_Alg.py | 10 + .../python/CombinedMuonTrackSummary.py | 14 +- .../src/TestPixelModuleDisablingSvc.cxx | 3 - .../src/TestPixelModuleDisablingSvc.h | 5 +- .../TrigInDetConfig/python/InDetConfig.py | 120 +++--- .../TrigUpgradeTest/python/InDetConfig.py | 122 +++---- .../TrigUpgradeTest/share/full_menu_build.ref | 14 +- 88 files changed, 2545 insertions(+), 2023 deletions(-) create mode 100644 InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h delete mode 100755 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibData.h delete mode 100755 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibDataColl.h delete mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSData.h create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSHVData.h create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStateData.h create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStatusData.h create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSTempData.h create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelTDAQData.h delete mode 100755 InnerDetector/InDetConditions/PixelConditionsData/src/PixelCalibData.cxx delete mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSData.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSHVData.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStateData.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStatusData.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSTemp.cxx create mode 100644 InnerDetector/InDetConditions/PixelConditionsData/src/PixelTDAQData.cxx delete mode 100644 InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelTDAQSvc.h delete mode 100644 InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py delete mode 100644 InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsConfig.py delete mode 100644 InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfig.py diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py index 181a9b3f309..816650ff21c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py @@ -6,25 +6,33 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from IOVDbSvc.IOVDbSvcConfig import addFolders,addFoldersSplitOnline - -PixelConfigCondAlg, PixelOfflineCalibCondAlg, PixelChargeCalibCondAlg, PixelDistortionAlg =\ -CompFactory.getComps("PixelConfigCondAlg","PixelOfflineCalibCondAlg","PixelChargeCalibCondAlg","PixelDistortionAlg") - def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): """Return a ComponentAccumulator with configured PixelConfigCondAlg""" acc = ComponentAccumulator() acc.merge(addFolders(flags, "/PIXEL/PixMapOverlay", "PIXEL_OFL", className="CondAttrListCollection")) + acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixMapOverlay", + "/PIXEL/PixMapOverlay", "CondAttrListCollection")) # FIXME commented properties are not currently accepted by PixelConfigCondAlg CondArgs = {} + # Switch parameters CondArgs.update( - BunchSpace=25.0, UseCalibConditions=True, - #BarrelAnalogThreshold=[-1,-1,-1,-1], + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False, + ) + # Digitization parameters + CondArgs.update( + BunchSpace=25.0, +# BarrelAnalogThreshold=[-1,-1,-1,-1], BarrelToTThreshold=[-1, 5, 5, 5], BarrelCrossTalk=[0.06,0.06,0.06,0.06], BarrelThermalNoise=[160.0,160.0,160.0,160.0], - #BarrelNoiseOccupancy=[5e-8,5e-8,5e-8,5e-8], - #BarrelDisableProbability=[9e-3,9e-3,9e-3,9e-3], + BarrelNoiseOccupancy=[5e-8,5e-8,5e-8,5e-8], + BarrelDisableProbability=[9e-3,9e-3,9e-3,9e-3], IBLNoiseShape=[0.0,1.0], BLayerNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000], PixelNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000], @@ -33,25 +41,25 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): FEI3BarrelSmallHitToT=[-1, -1, -1, -1], FEI3BarrelTimingSimTune=[2015,2015,2015,2015], FEI4BarrelHitDiscConfig=[2], - #EndcapAnalogThreshold=[-1,-1,-1,], +# EndcapAnalogThreshold=[-1,-1,-1], EndcapToTThreshold=[ 5, 5, 5], EndcapCrossTalk=[0.06,0.06,0.06], EndcapThermalNoise=[160.0,160.0,160.0], - #EndcapNoiseOccupancy=[5e-8,5e-8,5e-8], - #EndcapDisableProbability=[9e-3,9e-3,9e-3], - #EndcapNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], +# EndcapNoiseOccupancy=[5e-8,5e-8,5e-8], +# EndcapDisableProbability=[9e-3,9e-3,9e-3], +# EndcapNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], # just excluded so far. FEI3EndcapLatency=[256, 256, 256], FEI3EndcapHitDuplication=[False, False, False], FEI3EndcapSmallHitToT=[-1, -1, -1], FEI3EndcapTimingSimTune=[2015,2015,2015], - #DBMAnalogThreshold=[-1,-1,-1], +# DBMAnalogThreshold=[-1,-1,-1], DBMToTThreshold=[-1,-1,-1], DBMCrossTalk=[0.06,0.06,0.06], DBMThermalNoise=[160.0,160.0,160.0], - #DBMNoiseOccupancy=[5e-8,5e-8,5e-8], - #DBMDisableProbability=[9e-3,9e-3,9e-3], - #DBMNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], - FEI4EndcapHitDiscConfig=[2,2,2], +# DBMNoiseOccupancy=[5e-8,5e-8,5e-8], +# DBMDisableProbability=[9e-3,9e-3,9e-3], +# DBMNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], + FEI4EndcapHitDiscConfig=[2,2,2] ) if flags.Beam.Type == "cosmics": CondArgs.update( @@ -64,7 +72,7 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): DBMNumberOfBCID=[8,8,8], BarrelTimeOffset=[100.0,100.0,100.0,100.0], EndcapTimeOffset=[100.0,100.0,100.0], - DBMTimeOffset=[100.0,100.0,100.0], + DBMTimeOffset=[100.0,100.0,100.0] ) else: CondArgs.update( @@ -77,35 +85,315 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): DBMNumberOfBCID=[1,1,1], BarrelTimeOffset=[5.0,5.0,5.0,5.0], EndcapTimeOffset=[5.0,5.0,5.0], - DBMTimeOffset=[5.0,5.0,5.0], + DBMTimeOffset=[5.0,5.0,5.0] ) + # Charge calibration parameters + CondArgs.update( + DefaultCalibrationParameterA=70.2, + DefaultCalibrationParameterE=-3561.25, + DefaultCalibrationParameterC=26000.0 + ) + # DCS parameters + CondArgs.update( + DefaultBiasVoltage=150.0, + DefaultTemperature=-7.0 + ) + # Cabling parameters + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + if flags.Input.isMC: + # ITk: + if flags.GeoModel.Run == "RUN4": + IdMappingDat = "ITk_Atlas_IdMapping.dat" + if flags.GeoModel.Type == "BrlIncl4.0_ref": + IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" + elif flags.GeoModel.Type == "IBrlExt4.0ref": + IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" + elif flags.GeoModel.Type == "BrlExt4.0_ref": + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" + elif flags.GeoModel.Type == "BrlExt3.2_ref": + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" + elif flags.GeoModel.Run == "RUN2" or flags.GeoModel.Run == "RUN3": + # Planar IBL + if flags.GeoModel.IBLLayout == "planar": + if flags.GeoModel.Run == "RUN2": + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" + # Hybrid IBL plus DBM + elif flags.GeoModel.IBLLayout == "3D": + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" + + elif not flags.Input.isMC: + runNum = flags.Input.RunNumber + if runNum < 222222: + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + else: + useCablingConditions = True + # Even though we are reading from COOL, set the correct fallback map. + if (runNum >= 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" + elif (runNum >= 314940 and runNum < 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_314940.dat" + elif (runNum >= 289350 and runNum < 314940): # 2016 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + elif (runNum >= 222222 and runNum < 289350): # 2015 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + + CondArgs.update( + UseCablingConditions=useCablingConditions, + CablingMapToFile=False, + CablingMapFileName=IdMappingDat + ) + # Distortion parameters + CondArgs.update( + DistortionInputSource=4, + DistortionVersion=1, + DistortionR1=0.1/1000, + DistortionR2=0.1/1000, + DistortionTwist=0.0005, + DistortionMean_R=0.12/1000, + DistortionRMS_R=0.08/1000, + DistortionMean_twist=-0.0005, + DistortionRMS_twist=0.0008, + DistortionWriteToFile=False, + DistortionFileName="PixelSurveyDistortions.txt" + ) # set default kwargs CondArgs.update(kwargs) - acc.addCondAlgo(PixelConfigCondAlg(name, **CondArgs)) + acc.addCondAlgo(CompFactory.PixelConfigCondAlg(name, **CondArgs)) + return acc + + +def PixelAlignCondAlgCfg(flags, name="PixelAlignCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelAlignCondAlg""" + acc = ComponentAccumulator() + + if flags.GeoModel.Align.Dynamic: + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/PIX","/Indet/AlignL2/PIX",className="CondAttrListCollection")) + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) + else: + if (not flags.Detector.SimulatePixel) or flags.Detector.OverlayPixel: + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) + else: + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) + + acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/IBLDist","/Indet/IBLDist",className="CondAttrListCollection")) + + kwargs.setdefault("UseDynamicAlignFolders", False) + kwargs.setdefault("ReadKeyStatic", "/Indet/Align") + kwargs.setdefault("ReadKeyDynamicL1", "/Indet/AlignL1/ID") + kwargs.setdefault("ReadKeyDynamicL2", "/Indet/AlignL2/PIX") + kwargs.setdefault("ReadKeyDynamicL3", "/Indet/AlignL3") + kwargs.setdefault("ReadKeyIBLDist", "/Indet/IBLDist") + kwargs.setdefault("WriteKey", "PixelAlignmentStore") + + acc.addCondAlgo(CompFactory.PixelAlignCondAlg(name, **kwargs)) + return acc + +def PixelCablingCondAlgCfg(flags, name="PixelCablingCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelCablingCondAlg""" + acc = ComponentAccumulator() + if not flags.Input.isMC: + acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) + + # Cabling parameters + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + rodIDForSingleLink40=0 + if flags.Input.isMC: + # ITk: + if flags.GeoModel.Run == "RUN4": + IdMappingDat = "ITk_Atlas_IdMapping.dat" + if flags.GeoModel.Type == "BrlIncl4.0_ref": + IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" + elif flags.GeoModel.Type == "IBrlExt4.0ref": + IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" + elif flags.GeoModel.Type == "BrlExt4.0_ref": + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" + elif flags.GeoModel.Type == "BrlExt3.2_ref": + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" + elif flags.GeoModel.Run == "RUN2" or flags.GeoModel.Run == "RUN3": + # Planar IBL + if flags.GeoModel.IBLLayout == "planar": + if flags.GeoModel.Run == "RUN2": + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" + # Hybrid IBL plus DBM + elif flags.GeoModel.IBLLayout == "3D": + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" + + elif not flags.Input.isMC: + runNum = flags.Input.RunNumber + if runNum < 222222: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + rodIDForSingleLink40=1300000 + else: + rodIDForSingleLink40=1300000 + # Even though we are reading from COOL, set the correct fallback map. + if (runNum >= 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" + elif (runNum >= 314940 and runNum < 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_314940.dat" + elif (runNum >= 289350 and runNum < 314940): # 2016 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + elif (runNum >= 222222 and runNum < 289350): # 2015 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + + kwargs.setdefault("RodIDForSingleLink40", rodIDForSingleLink40) + kwargs.setdefault("MappingFile", IdMappingDat) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("PixelReadoutSpeedData", "PixelReadoutSpeedData") + kwargs.setdefault("ReadKey", "/PIXEL/CablingMap") + kwargs.setdefault("WriteKey", "PixelCablingCondData") + acc.addCondAlgo(CompFactory.PixelCablingCondAlg(name, **kwargs)) return acc def PixelChargeCalibCondAlgCfg(flags, name="PixelChargeCalibCondAlg", **kwargs): """Return a ComponentAccumulator with configured PixelChargeCalibCondAlg""" acc = ComponentAccumulator() acc.merge(addFolders(flags, "/PIXEL/PixCalib", "PIXEL_OFL", className="CondAttrListCollection")) + kwargs.setdefault("PixelDetEleCollKey", "PixelDetectorElementCollection") + kwargs.setdefault("PixelModuleData", "PixelModuleData") kwargs.setdefault("ReadKey", "/PIXEL/PixCalib") - acc.addCondAlgo(PixelChargeCalibCondAlg(name, **kwargs)) + kwargs.setdefault("WriteKey", "PixelChargeCalibCondData") + acc.addCondAlgo(CompFactory.PixelChargeCalibCondAlg(name, **kwargs)) return acc -def PixelOfflineCalibCondAlgCfg(flags, name="PixelOfflineCalibCondAlg", **kwargs): - """Return a ComponentAccumulator with configured PixelOfflineCalibCondAlg""" +def PixelDCSCondHVAlgCfg(flags, name="PixelDCSCondHVAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelDCSCondHVAlg""" acc = ComponentAccumulator() - acc.merge(addFolders(flags, "/PIXEL/PixReco", "PIXEL_OFL", className="DetCondCFloat")) - kwargs.setdefault("ReadKey", "/PIXEL/PixReco") - kwargs.setdefault("InputSource", 2) - acc.addCondAlgo(PixelOfflineCalibCondAlg(name, **kwargs)) + if flags.Common.isOnline: + acc.merge(addFolders(flags, "/PIXEL/HLT/DCS/HV", "PIXEL_ONL", className="CondAttrListCollection")) + else: + acc.merge(addFolders(flags, "/PIXEL/DCS/HV", "DCS_OFL", className="CondAttrListCollection")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKey", "/PIXEL/DCS/HV") + kwargs.setdefault("WriteKey", "PixelDCSHVCondData") + acc.addCondAlgo(CompFactory.PixelDCSCondHVAlg(name, **kwargs)) + return acc + +def PixelDCSCondStateAlgCfg(flags, name="PixelDCSCondStateAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelDCSCondStateAlg""" + acc = ComponentAccumulator() + if not flags.Input.isMC: + acc.merge(addFolders(flags, "/PIXEL/DCS/FSMSTATE", "DCS_OFL", className="CondAttrListCollection")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKeyState", "/PIXEL/DCS/FSMSTATE") + kwargs.setdefault("WriteKeyState", "PixelDCSStateCondData") + acc.addCondAlgo(CompFactory.PixelDCSCondStateAlg(name, **kwargs)) + return acc + +def PixelDCSCondStatusAlgCfg(flags, name="PixelDCSCondStatusAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelDCSCondStatusAlg""" + acc = ComponentAccumulator() + if not flags.Input.isMC: + acc.merge(addFolders(flags, "/PIXEL/DCS/FSMSTATUS", "DCS_OFL", className="CondAttrListCollection")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS") + kwargs.setdefault("WriteKeyStatus", "PixelDCSStatusCondData") + acc.addCondAlgo(CompFactory.PixelDCSCondStatusAlg(name, **kwargs)) + return acc + +def PixelDCSCondTempAlgCfg(flags, name="PixelDCSCondTempAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelDCSCondTempAlg""" + acc = ComponentAccumulator() + if flags.Common.isOnline: + acc.merge(addFolders(flags, "/PIXEL/HLT/DCS/TEMPERATURE", "PIXEL_ONL", className="CondAttrListCollection")) + else: + acc.merge(addFolders(flags, "/PIXEL/DCS/TEMPERATURE", "DCS_OFL", className="CondAttrListCollection")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKey", "/PIXEL/DCS/TEMPERATURE") + kwargs.setdefault("WriteKey", "PixelDCSTempCondData") + acc.addCondAlgo(CompFactory.PixelDCSCondTempAlg(name, **kwargs)) + return acc + +# NEW FOR RUN3 def PixelDeadMapCondAlgCfg(flags, name="PixelDeadMapCondAlg", **kwargs): +# NEW FOR RUN3 """Return a ComponentAccumulator with configured PixelDeadMapCondAlg""" +# NEW FOR RUN3 acc = ComponentAccumulator() +# NEW FOR RUN3 acc.merge(addFolders(flags, "/PIXEL/PixelModuleFeMask", "PIXEL_OFL", className="CondAttrListCollection")) +# NEW FOR RUN3 kwargs.setdefault("PixelModuleData", "PixelModuleData") +# NEW FOR RUN3 kwargs.setdefault("ReadKey", "/PIXEL/PixelModuleFeMask") +# NEW FOR RUN3 kwargs.setdefault("WriteKey", "PixelDeadMapCondData") +# NEW FOR RUN3 acc.addCondAlgo(PixelDeadMapCondAlg(name, **kwargs)) +# NEW FOR RUN3 return acc + +def PixelDetectorElementCondAlgCfg(flags, name="PixelDetectorElementCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelDetectorElementCondAlg""" + acc = ComponentAccumulator() + kwargs.setdefault("PixelAlignmentStore", "PixelAlignmentStore") + kwargs.setdefault("WriteKey", "PixelDetectorElementCollection") + acc.addCondAlgo(CompFactory.PixelDetectorElementCondAlg(name, **kwargs)) return acc def PixelDistortionAlgCfg(flags, name="PixelDistortionAlg", **kwargs): """Return a ComponentAccumulator with configured PixelDistortionAlg""" acc = ComponentAccumulator() acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/PixelDist","/Indet/PixelDist",className="DetCondCFloat")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") kwargs.setdefault("ReadKey", "/Indet/PixelDist") - acc.addCondAlgo(PixelDistortionAlg(name, **kwargs)) + kwargs.setdefault("WriteKey", "PixelDistortionData") + acc.addCondAlgo(CompFactory.PixelDistortionAlg(name, **kwargs)) return acc +def PixelHitDiscCnfgAlgCfg(flags, name="PixelHitDiscCnfgAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelHitDiscCnfgAlg""" + acc = ComponentAccumulator() + if (flags.IOVDb.DatabaseInstance=="CONDBR2"): + acc.merge(addFolders(flags, "/PIXEL/HitDiscCnfg", "PIXEL", className="AthenaAttributeList")) + elif (flags.Input.isMC and flags.GeoModel.Run=="RUN2") or (flags.Input.isMC and flags.GeoModel.Run=="RUN3"): + acc.merge(addFoldersSplitOnline(flags,"PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKey", "/PIXEL/HitDiscCnfg") + kwargs.setdefault("WriteKey", "PixelHitDiscCnfgData") + acc.addCondAlgo(CompFactory.PixelHitDiscCnfgAlg(name, **kwargs)) + return acc + +def PixelOfflineCalibCondAlgCfg(flags, name="PixelOfflineCalibCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelOfflineCalibCondAlg""" + acc = ComponentAccumulator() + acc.merge(addFolders(flags, "/PIXEL/PixReco", "PIXEL_OFL", className="DetCondCFloat")) + kwargs.setdefault("InputSource",2) + kwargs.setdefault("PixelClusterErrorDataFile", "PixelClusterErrorData.txt") + kwargs.setdefault("PixelClusterOnTrackErrorDataFile", "PixelClusterOnTrackErrorData.txt") + kwargs.setdefault("PixelChargeInterpolationDataFile", "PixelChargeInterpolationData.txt") + kwargs.setdefault("DumpConstants", 0) + kwargs.setdefault("ReadKey", "/PIXEL/PixReco") + kwargs.setdefault("WriteKey", "PixelOfflineCalibData") + acc.addCondAlgo(CompFactory.PixelOfflineCalibCondAlg(name, **kwargs)) + return acc + +def PixelReadoutSpeedAlgCfg(flags, name="PixelReadoutSpeedAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelReadoutSpeedAlg""" + acc = ComponentAccumulator() + if not flags.Input.isMC: + acc.merge(addFolders(flags, "/PIXEL/ReadoutSpeed", "PIXEL", className="AthenaAttributeList")) + else: + acc.merge(addFoldersSplitOnline(flags, "PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList")) + kwargs.setdefault("ReadKey", "/PIXEL/ReadoutSpeed") + kwargs.setdefault("WriteKey", "PixelReadoutSpeedData") + acc.addCondAlgo(CompFactory.PixelReadoutSpeedAlg(name, **kwargs)) + return acc + +def PixelTDAQCondAlgCfg(flags, name="PixelTDAQCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelTDAQCondAlg""" + acc = ComponentAccumulator() + if flags.Common.isOnline: + acc.merge(addFolders(flags, "/TDAQ/Resources/ATLAS/PIXEL/Modules", "TDAQ_ONL", className="CondAttrListCollection")) + kwargs.setdefault("PixelModuleData", "PixelModuleData") + kwargs.setdefault("ReadKey", "/TDAQ/Resources/ATLAS/PIXEL/Modules") + kwargs.setdefault("WriteKey", "PixelTDAQCondData") + acc.addCondAlgo(CompFactory.PixelTDAQCondAlg(name, **kwargs)) + return acc + + diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx index a3bdaa122c1..712fecc3684 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx @@ -11,9 +11,7 @@ PixelAlignCondAlg::PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : ::AthAlgorithm(name, pSvcLocator) - , m_writeKey{"PixelAlignmentStore", "PixelAlignmentStore"} { - declareProperty("WriteKey", m_writeKey); } StatusCode PixelAlignCondAlg::initialize() @@ -207,8 +205,3 @@ StatusCode PixelAlignCondAlg::execute() return StatusCode::SUCCESS; } -StatusCode PixelAlignCondAlg::finalize() -{ - ATH_MSG_DEBUG("finalize " << name()); - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h index 2a34ff95a05..5a462001c79 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h @@ -29,7 +29,6 @@ class PixelAlignCondAlg : public AthAlgorithm virtual StatusCode initialize() override; virtual StatusCode execute() override; - virtual StatusCode finalize() override; private: BooleanProperty m_useDynamicAlignFolders{ @@ -45,10 +44,11 @@ class PixelAlignCondAlg : public AthAlgorithm SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyIBLDist{ this, "ReadKeyIBLDist", "/Indet/IBLDist", "Key for the IBL alignment folder"}; - SG::WriteCondHandleKey<GeoAlignmentStore> m_writeKey; + SG::WriteCondHandleKey<GeoAlignmentStore> m_writeKey{ + this, "WriteKey", "PixelAlignmentStore", "Output pixel alignment data"}; ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; const InDetDD::PixelDetectorManager* m_detManager{nullptr}; }; -#endif // SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx index cf498fbf3ec..e13b9032f03 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx @@ -15,17 +15,8 @@ #include "CoralBase/Blob.h" PixelCablingCondAlg::PixelCablingCondAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_pixelID(nullptr), - m_condSvc("CondSvc", name), - m_useConditions(true), - m_rodidForSingleLink40(0), - m_dump_map_to_file(false) + ::AthReentrantAlgorithm(name, pSvcLocator) { - declareProperty("MappingFile", m_final_mapping_file="PixelCabling/Pixels_Atlas_IdMapping_2016.dat"); - declareProperty("UseConditions", m_useConditions); - declareProperty("RodIDForSingleLink40", m_rodidForSingleLink40); - declareProperty("DumpMapToFile", m_dump_map_to_file); } StatusCode PixelCablingCondAlg::initialize() { @@ -34,6 +25,7 @@ StatusCode PixelCablingCondAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readoutspeedKey.initialize()); ATH_CHECK(m_readKey.initialize()); @@ -124,10 +116,10 @@ StatusCode PixelCablingCondAlg::initialize() { return StatusCode::SUCCESS; } -StatusCode PixelCablingCondAlg::execute() { +StatusCode PixelCablingCondAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelCablingCondAlg::execute()"); - SG::WriteCondHandle<PixelCablingCondData> writeHandle(m_writeKey); + SG::WriteCondHandle<PixelCablingCondData> writeHandle(m_writeKey, ctx); ATH_MSG_DEBUG("Conditions updates every event!!! This should be avoided once RegionSelectorTable is fixed!!"); // if (writeHandle.isValid()) { // ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); @@ -158,15 +150,17 @@ StatusCode PixelCablingCondAlg::execute() { std::string DCSname; std::string line; + SG::ReadCondHandle<PixelModuleData>moduleData(m_moduleDataKey, ctx); + // For debugging purposes std::ofstream output_mapping_file_raw; - if (m_dump_map_to_file) { output_mapping_file_raw.open("pixel_cabling_map_raw.txt"); } + if (moduleData->getCablingMapToFile()) { output_mapping_file_raw.open("pixel_cabling_map_raw.txt"); } std::ofstream output_mapping_file_interpreted; - if (m_dump_map_to_file) { output_mapping_file_interpreted.open("pixel_cabling_map_interpreted.txt"); } + if (moduleData->getCablingMapToFile()) { output_mapping_file_interpreted.open("pixel_cabling_map_interpreted.txt"); } std::stringstream instr; - if (m_useConditions) { - SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey); + if (moduleData->getUseCablingConditions()) { + SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey, ctx); const AthenaAttributeList* readCdo = *readHandle; if (readCdo==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); @@ -189,24 +183,24 @@ StatusCode PixelCablingCondAlg::execute() { instr.str(std::string(p_cabling,blob_cabling.size())); } else { - std::string filename = PathResolverFindCalibFile(m_final_mapping_file); + std::string filename = PathResolverFindCalibFile(moduleData->getCablingMapFileName()); if (filename.size()==0) { - ATH_MSG_FATAL("Mapping File: " << m_final_mapping_file << " not found!"); + ATH_MSG_FATAL("Mapping File: " << moduleData->getCablingMapFileName() << " not found!"); return StatusCode::FAILURE; } std::ifstream fin(filename.c_str()); if (!fin) { return StatusCode::FAILURE; } instr << fin.rdbuf(); - ATH_MSG_DEBUG("Refilled pixel cabling from file \"" << m_final_mapping_file << "\""); + ATH_MSG_DEBUG("Refilled pixel cabling from file \"" << moduleData->getCablingMapFileName() << "\""); } // Each entry in the mapping is sepated by a newline. // Loop over all lines and parse the values - std::map<uint32_t,bool> rodReadoutMap = SG::ReadCondHandle<PixelReadoutSpeedData>(m_readoutspeedKey)->getReadoutMap(); + std::map<uint32_t,bool> rodReadoutMap = SG::ReadCondHandle<PixelReadoutSpeedData>(m_readoutspeedKey, ctx)->getReadoutMap(); while (instr.good() && getline(instr, line)) { - if (m_dump_map_to_file) { output_mapping_file_raw << line << std::endl; } + if (moduleData->getCablingMapToFile()) { output_mapping_file_raw << line << std::endl; } // Skip empty lines and comments (i.e. starting with a hash or a space) if (line.empty()) { continue; } @@ -222,7 +216,7 @@ StatusCode PixelCablingCondAlg::execute() { parse >> barrel_ec >> layer_disk >> phi_module >> eta_module >> std::hex >> robid >> rodid >> sl_40_fmt >> sl_40_link >> sl_80_fmt >> sl_80_link >> DCSname; // Debug - if (m_dump_map_to_file) { + if (moduleData->getCablingMapToFile()) { output_mapping_file_interpreted << barrel_ec << "\t" << layer_disk << "\t" << phi_module << "\t" << eta_module << "\t" << std::hex << robid << "\t" << rodid << "\t" << sl_40_fmt << "\t" << sl_40_link << "\t" << sl_80_fmt << "\t" @@ -293,7 +287,7 @@ StatusCode PixelCablingCondAlg::execute() { << ", eta_module: " << eta_module << ", phi_module: " << phi_module << ", linknumber: 0x" << std::hex << linknumber); } - if (m_dump_map_to_file) { + if (moduleData->getCablingMapToFile()) { output_mapping_file_raw.close(); output_mapping_file_interpreted.close(); } @@ -310,7 +304,3 @@ StatusCode PixelCablingCondAlg::execute() { return StatusCode::SUCCESS; } -StatusCode PixelCablingCondAlg::finalize() { - ATH_MSG_DEBUG("PixelCablingCondAlg::finalize()"); - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.h index d88e26b8344..7dab96c4b8b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.h @@ -1,16 +1,23 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelCablingCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date December, 2019 + * @brief Store pixel cabling map in PixelCablingCondData. + */ #ifndef PIXELCABLINGCONDALG_H #define PIXELCABLINGCONDALG_H -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "StoreGate/WriteCondHandleKey.h" +#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelReadoutSpeedData.h" #include "PixelConditionsData/PixelCablingCondData.h" @@ -24,22 +31,27 @@ #include <string> #include <istream> -class PixelCablingCondAlg : public AthAlgorithm { +class PixelCablingCondAlg : public AthReentrantAlgorithm { public: PixelCablingCondAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~PixelCablingCondAlg() = default; virtual StatusCode initialize() override; - virtual StatusCode execute() override; - virtual StatusCode finalize() override; + virtual StatusCode execute(const EventContext& ctx) const override; private: - const PixelID* m_pixelID; - ServiceHandle<ICondSvc> m_condSvc; - bool m_useConditions; - uint32_t m_rodidForSingleLink40; - bool m_dump_map_to_file; - std::string m_final_mapping_file; + const PixelID* m_pixelID{nullptr}; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; + + // Keep this untile SegionSelectorTable is fixed. + Gaudi::Property<uint32_t> m_rodidForSingleLink40 + {this, "RodIDForSingleLink40", 0, "(Temporary) const link speed"}; + + Gaudi::Property<std::string> m_final_mapping_file + {this, "MappingFile", "PixelCabling/Pixels_Atlas_IdMapping_2016.dat", "Read cabling map from file"}; + + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; SG::ReadCondHandleKey<PixelReadoutSpeedData> m_readoutspeedKey {this, "PixelReadoutSpeedData", "PixelReadoutSpeedData", "Pixel readout speed data"}; @@ -49,7 +61,6 @@ class PixelCablingCondAlg : public AthAlgorithm { SG::WriteCondHandleKey<PixelCablingCondData> m_writeKey {this, "WriteKey", "PixelCablingCondData", "Output cabling data"}; - }; #endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx index 3cbe8905796..2038e9bb86a 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.cxx @@ -11,9 +11,7 @@ #include <sstream> PixelChargeCalibCondAlg::PixelChargeCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_pixelID(nullptr), - m_condSvc("CondSvc", name) + ::AthAlgorithm(name, pSvcLocator) { } @@ -215,8 +213,3 @@ StatusCode PixelChargeCalibCondAlg::execute() { return StatusCode::SUCCESS; } -StatusCode PixelChargeCalibCondAlg::finalize() { - ATH_MSG_DEBUG("PixelChargeCalibCondAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.h index 498ec09d66d..db6a71afe72 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelChargeCalibCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelChargeCalibCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date December, 2019 + * @brief Store pixel charge calibration constants in PixelChargeCalibCondData. + */ #ifndef PIXELCHARGECALIBCONDALG #define PIXELCHARGECALIBCONDALG @@ -27,10 +33,9 @@ class PixelChargeCalibCondAlg : public AthAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute() override; - virtual StatusCode finalize() override; private: - const PixelID* m_pixelID; + const PixelID* m_pixelID{nullptr}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; @@ -44,7 +49,7 @@ class PixelChargeCalibCondAlg : public AthAlgorithm { SG::WriteCondHandleKey<PixelChargeCalibCondData> m_writeKey {this, "WriteKey", "PixelChargeCalibCondData", "Output charge caliblation data"}; - ServiceHandle<ICondSvc> m_condSvc; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; }; #endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx index 1690b00e161..48dc399d419 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.cxx @@ -10,121 +10,13 @@ PixelConfigCondAlg::PixelConfigCondAlg(const std::string& name, ISvcLocator* pSvcLocator): ::AthReentrantAlgorithm(name, pSvcLocator), - m_bunchSpace(25.0), - m_UseComTime(false), - m_ComTime(0.0), - m_BarrelNumberOfBCID({1,1,1,1}), - m_EndcapNumberOfBCID({1,1,1}), - m_DBMNumberOfBCID({1,1,1}), - m_BarrelTimeOffset({5.0,5.0,5.0,5.0}), - m_EndcapTimeOffset({5.0,5.0,5.0}), - m_DBMTimeOffset({5.0,5.0,5.0}), - m_BarrelTimeJitter({0.0,0.0,0.0,0.0}), - m_EndcapTimeJitter({0.0,0.0,0.0}), - m_DBMTimeJitter({0.0,0.0,0.0}), - m_useCalibConditions(true), - m_BarrelAnalogThreshold({2000,4300,3500,3500}), - m_EndcapAnalogThreshold({3500,3500,3500}), - m_DBMAnalogThreshold({2000,2000,2000}), - m_BarrelAnalogThresholdSigma({45,35,30,30}), - m_EndcapAnalogThresholdSigma({30,30,30}), - m_DBMAnalogThresholdSigma({70,70,70}), - m_BarrelAnalogThresholdNoise({130,150,160,160}), - m_EndcapAnalogThresholdNoise({150,150,150}), - m_DBMAnalogThresholdNoise({190,190,190}), - m_BarrelInTimeThreshold({2000,5000,5000,5000}), - m_EndcapInTimeThreshold({5000,5000,5000}), - m_DBMInTimeThreshold({1200,1200,1200}), - m_CalibrationParameterA(70.2), - m_CalibrationParameterE(-3561.25), - m_CalibrationParameterC(26000), - m_BarrelToTThreshold({-1, 3, 5, 5}), - m_EndcapToTThreshold({ 5, 5, 5}), - m_DBMToTThreshold({-1,-1,-1}), - m_BarrelCrossTalk({0.06,0.06,0.06,0.06}), - m_EndcapCrossTalk({0.06,0.06,0.06}), - m_DBMCrossTalk({0.06,0.06,0.06}), - m_BarrelThermalNoise({160.0,160.0,160.0,160.0}), - m_EndcapThermalNoise({160.0,160.0,160.0}), - m_DBMThermalNoise({160.0,160.0,160.0}), - m_BarrelNoiseOccupancy({5e-8,5e-8,5e-8,5e-8}), - m_EndcapNoiseOccupancy({5e-8,5e-8,5e-8}), - m_DBMNoiseOccupancy({5e-8,5e-8,5e-8}), - m_BarrelDisableProbability({9e-3,9e-3,9e-3,9e-3}), - m_EndcapDisableProbability({9e-3,9e-3,9e-3}), - m_DBMDisableProbability({9e-3,9e-3,9e-3}), - m_BarrelNoiseShape({{0.0,1.0},{0.0,1.0},{0.0,1.0},{0.0,1.0}}), - m_EndcapNoiseShape({{0.0,1.0},{0.0,1.0},{0.0,1.0}}), - m_DBMNoiseShape({{0.0,1.0},{0.0,1.0},{0.0,1.0}}), m_IBLNoiseShape({0.0,1.0}), m_BLayerNoiseShape({0.0,1.0}), - m_PixelNoiseShape({0.0,1.0}), - m_FEI3BarrelLatency({ 0,151,256,256}), - m_FEI3EndcapLatency({256,256,256}), - m_FEI3BarrelHitDuplication({false,false,false,false}), - m_FEI3EndcapHitDuplication({false,false,false}), - m_FEI3BarrelSmallHitToT({-1,-1,-1,-1}), - m_FEI3EndcapSmallHitToT({-1,-1,-1}), - m_FEI3BarrelTimingSimTune({2015,2015,2015,2015}), - m_FEI3EndcapTimingSimTune({2015,2015,2015}), - m_FEI4BarrelHitDiscConfig({2}), - m_FEI4EndcapHitDiscConfig({2}), - m_useDeadMap(true), - m_condSvc("CondSvc", name) + m_PixelNoiseShape({0.0,1.0}) { - declareProperty("BunchSpace", m_bunchSpace); - declareProperty("UseComTime", m_UseComTime); - declareProperty("BarrelNumberOfBCID", m_BarrelNumberOfBCID); - declareProperty("EndcapNumberOfBCID", m_EndcapNumberOfBCID); - declareProperty("DBMNumberOfBCID", m_DBMNumberOfBCID); - declareProperty("BarrelTimeOffset", m_BarrelTimeOffset); - declareProperty("EndcapTimeOffset", m_EndcapTimeOffset); - declareProperty("DBMTimeOffset", m_DBMTimeOffset); - declareProperty("BarrelTimeJitter", m_BarrelTimeJitter); - declareProperty("EndcapTimeJitter", m_EndcapTimeJitter); - declareProperty("DBMTimeJitter", m_DBMTimeJitter); - declareProperty("UseCalibConditions", m_useCalibConditions); - declareProperty("DefaultBarrelAnalogThreshold", m_BarrelAnalogThreshold); - declareProperty("DefaultEndcapAnalogThreshold", m_EndcapAnalogThreshold); - declareProperty("DefaultDBMAnalogThreshold", m_DBMAnalogThreshold); - declareProperty("DefaultBarrelAnalogThresholdSigma", m_BarrelAnalogThresholdSigma); - declareProperty("DefaultEndcapAnalogThresholdSigma", m_EndcapAnalogThresholdSigma); - declareProperty("DefaultDBMAnalogThresholdSigma", m_DBMAnalogThresholdSigma); - declareProperty("DefaultBarrelAnalogThresholdNoise", m_BarrelAnalogThresholdNoise); - declareProperty("DefaultEndcapAnalogThresholdNoise", m_EndcapAnalogThresholdNoise); - declareProperty("DefaultDBMAnalogThresholdNoise", m_DBMAnalogThresholdNoise); - declareProperty("DefaultBarrelInTimeThreshold", m_BarrelInTimeThreshold); - declareProperty("DefaultEndcapInTimeThreshold", m_EndcapInTimeThreshold); - declareProperty("DefaultDBMInTimeThreshold", m_DBMInTimeThreshold); - declareProperty("DefaultCalibrationParameterA", m_CalibrationParameterA); - declareProperty("DefaultCalibrationParameterE", m_CalibrationParameterE); - declareProperty("DefaultCalibrationParameterC", m_CalibrationParameterC); - declareProperty("BarrelToTThreshold", m_BarrelToTThreshold); - declareProperty("EndcapToTThreshold", m_EndcapToTThreshold); - declareProperty("DBMToTThreshold", m_DBMToTThreshold); - declareProperty("BarrelCrossTalk", m_BarrelCrossTalk); - declareProperty("EndcapCrossTalk", m_EndcapCrossTalk); - declareProperty("DBMCrossTalk", m_DBMCrossTalk); - declareProperty("BarrelThermalNoise", m_BarrelThermalNoise); - declareProperty("EndcapThermalNoise", m_EndcapThermalNoise); - declareProperty("DBMThermalNoise", m_DBMThermalNoise); -// declareProperty("BarrelNoiseShape", m_BarrelNoiseShape); // So far deaclareProperty does not accept 2D vector. -// declareProperty("EndcapNoiseShape", m_EndcapNoiseShape); -// declareProperty("DBMNoiseShape", m_DBMNoiseShape); declareProperty("IBLNoiseShape", m_IBLNoiseShape); // This is ad-hoc solution. declareProperty("BLayerNoiseShape", m_BLayerNoiseShape); declareProperty("PixelNoiseShape", m_PixelNoiseShape); - declareProperty("FEI3BarrelLatency", m_FEI3BarrelLatency); - declareProperty("FEI3EndcapLatency", m_FEI3EndcapLatency); - declareProperty("FEI3BarrelHitDuplication", m_FEI3BarrelHitDuplication); - declareProperty("FEI3EndcapHitDuplication", m_FEI3EndcapHitDuplication); - declareProperty("FEI3BarrelSmallHitToT", m_FEI3BarrelSmallHitToT); - declareProperty("FEI3EndcapSmallHitToT", m_FEI3EndcapSmallHitToT); - declareProperty("FEI3BarrelTimingSimTune", m_FEI3BarrelTimingSimTune); - declareProperty("FEI3EndcapTimingSimTune", m_FEI3EndcapTimingSimTune); - declareProperty("FEI4BarrelHitDiscConfig", m_FEI4BarrelHitDiscConfig); - declareProperty("FEI4EndcapHitDiscConfig", m_FEI4EndcapHitDiscConfig); - declareProperty("UseDeadMap", m_useDeadMap, "Switch for usage of dead map"); } StatusCode PixelConfigCondAlg::initialize() { @@ -144,7 +36,7 @@ StatusCode PixelConfigCondAlg::initialize() { ATH_CHECK(m_condSvc.retrieve()); - if (m_useDeadMap) { ATH_CHECK(m_readDeadMapKey.initialize()); } + if (m_useDeadmapConditions) { ATH_CHECK(m_readDeadMapKey.initialize()); } ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { @@ -167,14 +59,16 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { // Construct the output Cond Object and fill it in std::unique_ptr<PixelModuleData> writeCdo(std::make_unique<PixelModuleData>()); - const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; - const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; //============== // Set dead map //============== EventIDRange rangeDeadMap{start, stop}; - if (m_useDeadMap) { + if (m_useDeadmapConditions) { SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readDeadMapKey, ctx); const CondAttrListCollection* readCdo = *readHandle; if (readCdo==nullptr) { @@ -194,48 +88,8 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { const CondAttrListCollection::ChanNum &channelNumber = attrList->first; const CondAttrListCollection::AttributeList &payload = attrList->second; - // RUN-3 format - if (payload.exists("data_array") and not payload["data_array"].isNull()) { - const std::string &stringStatus = payload["data_array"].data<std::string>(); - - std::stringstream ss(stringStatus); - std::vector<std::string> component; - std::string buffer; - while (std::getline(ss,buffer,',')) { component.push_back(buffer); } - - for (int i=0; i<(int)component.size(); i++) { - std::stringstream checkModule(component[i]); - std::vector<std::string> moduleString; - while (std::getline(checkModule,buffer,'"')) { moduleString.push_back(buffer); } - - if (moduleString.size()<4) { - ATH_MSG_FATAL("Not enough moduleString data " << moduleString.size() << " < 4 for " << component[i] - << " channel " << channelNumber << " read from " << readHandle.fullKey()); - return StatusCode::FAILURE; - } - - int moduleHash = std::atoi(moduleString[1].c_str()); - if (moduleHash!=i) { ATH_MSG_ERROR("Mismatch hash ID in DB array."); } - - std::stringstream checkStatus(moduleString[3]); - std::vector<std::string> moduleStringStatus; - while (std::getline(checkStatus,buffer,' ')) { moduleStringStatus.push_back(buffer); } - - if (moduleStringStatus.size()<2) { - ATH_MSG_FATAL("Not enough moduleStringStatus data " << moduleStringStatus.size() << " < 2 for " << component[i] - << " channel " << channelNumber << " read from " << readHandle.fullKey()); - return StatusCode::FAILURE; - } - - int moduleStatus = std::atoi(moduleStringStatus[0].c_str()); - int chipStatus = std::atoi(moduleStringStatus[1].c_str()); - - if (moduleStatus>0) { writeCdo->setModuleStatus(moduleHash, moduleStatus); } - if (chipStatus>0) { writeCdo->setChipStatus(moduleHash, chipStatus); } - } - } // RUN-1, RUN-2 format - else if (payload.exists("moduleID") and not payload["moduleID"].isNull() && payload.exists("ModuleSpecialPixelMap_Clob") and not payload["ModuleSpecialPixelMap_Clob"].isNull()) { + if (payload.exists("moduleID") and not payload["moduleID"].isNull() && payload.exists("ModuleSpecialPixelMap_Clob") and not payload["ModuleSpecialPixelMap_Clob"].isNull()) { int moduleHash = payload["moduleID"].data<int>(); const std::string &stringStatus = payload["ModuleSpecialPixelMap_Clob"].data<std::string>(); @@ -262,10 +116,17 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { } } - //=============== - // Set threshold - //=============== - EventIDRange rangeThreshold{start, stop}; + // Switch parameters + writeCdo -> setUseCalibConditions(m_useCalibConditions); + writeCdo -> setUseDeadmapConditions(m_useDeadmapConditions); + writeCdo -> setUseDCSStateConditions(m_useDCSStateConditions); + writeCdo -> setUseDCSStatusConditions(m_useDCSStatusConditions); + writeCdo -> setUseDCSHVConditions(m_useDCSHVConditions); + writeCdo -> setUseDCSTemperatureConditions(m_useDCSTemperatureConditions); + writeCdo -> setUseTDAQConditions(m_useTDAQConditions); + writeCdo -> setUseCablingConditions(m_useCablingConditions); + + // Digitization parameters writeCdo -> setBunchSpace(m_bunchSpace); writeCdo -> setUseComTime(m_UseComTime); writeCdo -> setComTime(m_ComTime); @@ -278,7 +139,6 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { writeCdo -> setBarrelTimeJitter(m_BarrelTimeJitter); writeCdo -> setEndcapTimeJitter(m_EndcapTimeJitter); writeCdo -> setDBMTimeJitter(m_DBMTimeJitter); - writeCdo -> setUseCalibConditions(m_useCalibConditions); writeCdo -> setDefaultBarrelAnalogThreshold(m_BarrelAnalogThreshold); writeCdo -> setDefaultEndcapAnalogThreshold(m_EndcapAnalogThreshold); writeCdo -> setDefaultDBMAnalogThreshold(m_DBMAnalogThreshold); @@ -291,9 +151,6 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { writeCdo -> setDefaultBarrelInTimeThreshold(m_BarrelInTimeThreshold); writeCdo -> setDefaultEndcapInTimeThreshold(m_EndcapInTimeThreshold); writeCdo -> setDefaultDBMInTimeThreshold(m_DBMInTimeThreshold); - writeCdo -> setDefaultQ2TotA(m_CalibrationParameterA); - writeCdo -> setDefaultQ2TotE(m_CalibrationParameterE); - writeCdo -> setDefaultQ2TotC(m_CalibrationParameterC); writeCdo -> setBarrelToTThreshold(m_BarrelToTThreshold); writeCdo -> setEndcapToTThreshold(m_EndcapToTThreshold); writeCdo -> setDBMToTThreshold(m_DBMToTThreshold); @@ -352,11 +209,36 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { writeCdo -> setFEI4BarrelHitDiscConfig(m_FEI4BarrelHitDiscConfig); writeCdo -> setFEI4EndcapHitDiscConfig(m_FEI4EndcapHitDiscConfig); + // Charge calibration parameters + writeCdo -> setDefaultQ2TotA(m_CalibrationParameterA); + writeCdo -> setDefaultQ2TotE(m_CalibrationParameterE); + writeCdo -> setDefaultQ2TotC(m_CalibrationParameterC); + + // DCS parameters + writeCdo -> setDefaultBiasVoltage(m_biasVoltage); + writeCdo -> setDefaultTemperature(m_temperature); + + // Cabling parameters + writeCdo -> setCablingMapToFile(m_cablingMapToFile); + writeCdo -> setCablingMapFileName(m_cablingMapFileName); + + // Distortion parameters + writeCdo -> setDistortionInputSource(m_distortionInputSource); + writeCdo -> setDistortionVersion(m_distortionVersion); + writeCdo -> setDistortionR1(m_distortionR1); + writeCdo -> setDistortionR2(m_distortionR2); + writeCdo -> setDistortionTwist(m_distortionTwist); + writeCdo -> setDistortionMeanR(m_distortionMeanR); + writeCdo -> setDistortionRMSR(m_distortionRMSR); + writeCdo -> setDistortionMeanTwist(m_distortionMeanTwist); + writeCdo -> setDistortionRMSTwist(m_distortionRMSTwist); + writeCdo -> setDistortionWriteToFile(m_distortionWriteToFile); + writeCdo -> setDistortionFileName(m_distortionFileName); + //======================= // Combine time interval //======================= EventIDRange rangeW{start, stop}; -// rangeW = EventIDRange::intersect(rangeDeadMap, rangeThreshold); rangeW = rangeDeadMap; if (rangeW.stop().isValid() and rangeW.start()>rangeW.stop()) { @@ -373,8 +255,3 @@ StatusCode PixelConfigCondAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } -StatusCode PixelConfigCondAlg::finalize() { - ATH_MSG_DEBUG("PixelConfigCondAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h index 6be5362640e..43800012a50 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelConfigCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelConfigCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date December, 2019 + * @brief Store pixel module parameters in PixelModuleData. + */ #ifndef PIXELCONFIGCONDALG #define PIXELCONFIGCONDALG @@ -16,6 +22,7 @@ #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" +#include "CLHEP/Units/SystemOfUnits.h" class PixelConfigCondAlg : public AthReentrantAlgorithm { public: @@ -23,70 +30,195 @@ class PixelConfigCondAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - double m_bunchSpace; - bool m_UseComTime; - double m_ComTime; - std::vector<int> m_BarrelNumberOfBCID; - std::vector<int> m_EndcapNumberOfBCID; - std::vector<int> m_DBMNumberOfBCID; - std::vector<double> m_BarrelTimeOffset; - std::vector<double> m_EndcapTimeOffset; - std::vector<double> m_DBMTimeOffset; - std::vector<double> m_BarrelTimeJitter; - std::vector<double> m_EndcapTimeJitter; - std::vector<double> m_DBMTimeJitter; - bool m_useCalibConditions; - std::vector<int> m_BarrelAnalogThreshold; - std::vector<int> m_EndcapAnalogThreshold; - std::vector<int> m_DBMAnalogThreshold; - std::vector<int> m_BarrelAnalogThresholdSigma; - std::vector<int> m_EndcapAnalogThresholdSigma; - std::vector<int> m_DBMAnalogThresholdSigma; - std::vector<int> m_BarrelAnalogThresholdNoise; - std::vector<int> m_EndcapAnalogThresholdNoise; - std::vector<int> m_DBMAnalogThresholdNoise; - std::vector<int> m_BarrelInTimeThreshold; - std::vector<int> m_EndcapInTimeThreshold; - std::vector<int> m_DBMInTimeThreshold; - float m_CalibrationParameterA; - float m_CalibrationParameterE; - float m_CalibrationParameterC; - std::vector<int> m_BarrelToTThreshold; - std::vector<int> m_EndcapToTThreshold; - std::vector<int> m_DBMToTThreshold; - std::vector<double> m_BarrelCrossTalk; - std::vector<double> m_EndcapCrossTalk; - std::vector<double> m_DBMCrossTalk; - std::vector<double> m_BarrelThermalNoise; - std::vector<double> m_EndcapThermalNoise; - std::vector<double> m_DBMThermalNoise; - std::vector<double> m_BarrelNoiseOccupancy; - std::vector<double> m_EndcapNoiseOccupancy; - std::vector<double> m_DBMNoiseOccupancy; - std::vector<double> m_BarrelDisableProbability; - std::vector<double> m_EndcapDisableProbability; - std::vector<double> m_DBMDisableProbability; - std::vector<std::vector<float>> m_BarrelNoiseShape; - std::vector<std::vector<float>> m_EndcapNoiseShape; - std::vector<std::vector<float>> m_DBMNoiseShape; + // Switch parameters + Gaudi::Property<bool> m_useCalibConditions + {this, "UseCalibConditions", true, "Use conditions DB for charge calibration"}; + + Gaudi::Property<bool> m_useDeadmapConditions + {this, "UseDeadmapConditions", true, "Use conditions DB for pixel deadmap module/FE"}; + + Gaudi::Property<bool> m_useDCSStateConditions + {this, "UseDCSStateConditions", false, "Use DCSState conditions DB"}; + + Gaudi::Property<bool> m_useDCSStatusConditions + {this, "UseDCSStatusConditions", false, "Use DCSStatus conditions DB"}; + + Gaudi::Property<bool> m_useDCSHVConditions + {this, "UseDCSHVConditions", true, "Use DCS HV conditions DB"}; + + Gaudi::Property<bool> m_useDCSTemperatureConditions + {this, "UseDCSTemperatureConditions", true, "Use DCS temperature conditions DB"}; + + Gaudi::Property<bool> m_useTDAQConditions + {this, "UseTDAQConditions", false, "Use TDAQ conditions DB (NOTE only valid in RUN-1)"}; + + Gaudi::Property<bool> m_useCablingConditions + {this, "UseCablingConditions", true, "Use cabling map conditions DB"}; + + // Digitization parameters + Gaudi::Property<double> m_bunchSpace + {this, "BunchSpace", 25.0, "Bunch space [ns]"}; + + Gaudi::Property<bool> m_UseComTime + {this, "UseComTime", false, "Use computed time used in cosmic/commissioning timing"}; + + double m_ComTime{0.0}; + + Gaudi::Property<std::vector<int>> m_BarrelNumberOfBCID + {this, "BarrelNumberOfBCID", {1,1,1,1}, "BCID numbers for barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapNumberOfBCID + {this, "EndcapNumberOfBCID", {1,1,1}, "BCID numbers for endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMNumberOfBCID + {this, "DBMNumberOfBCID", {1,1,1}, "BCID numbers for DBM layers"}; + + Gaudi::Property<std::vector<double>> m_BarrelTimeOffset + {this, "BarrelTimeOffset", {5.0,5.0,5.0,5.0}, "Offset time of barrel pixel layer"}; + + Gaudi::Property<std::vector<double>> m_EndcapTimeOffset + {this, "EndcapTimeOffset", {5.0,5.0,5.0}, "Offset time of endcap pixel layer"}; + + Gaudi::Property<std::vector<double>> m_DBMTimeOffset + {this, "DBMTimeOffset", {5.0,5.0,5.0}, "Offset time of DBM layer"}; + + Gaudi::Property<std::vector<double>> m_BarrelTimeJitter + {this, "BarrelTimeJitter", {0.0,0.0,0.0,0.0}, "Time jitter of barrel pixel layer"}; + + Gaudi::Property<std::vector<double>> m_EndcapTimeJitter + {this, "EndcapTimeJitter", {0.0,0.0,0.0}, "Time jitter of endcap pixel layer"}; + + Gaudi::Property<std::vector<double>> m_DBMTimeJitter + {this, "DBMTimeJitter", {0.0,0.0,0.0}, "Time jitter of DBM layer"}; + + Gaudi::Property<std::vector<int>> m_BarrelAnalogThreshold + {this, "DefaultBarrelAnalogThreshold", {2000,4300,3500,3500}, "Default analog thresholds of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapAnalogThreshold + {this, "DefaultEndcapAnalogThreshold", {3500,3500,3500}, "Default analog thresholds of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMAnalogThreshold + {this, "DefaultDBMAnalogThreshold", {2000,2000,2000}, "Default analog thresholds of DBMlayers"}; + + Gaudi::Property<std::vector<int>> m_BarrelAnalogThresholdSigma + {this, "DefaultBarrelAnalogThresholdSigma", {45,35,30,30}, "Default analog threshold sigma of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapAnalogThresholdSigma + {this, "DefaultEndcapAnalogThresholdSigma", {30,30,30}, "Default analog threshold sigma of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMAnalogThresholdSigma + {this, "DefaultDBMAnalogThresholdSigma", {70,70,70}, "Default analog threshold sigma of DBM pixel layers"}; + + Gaudi::Property<std::vector<int>> m_BarrelAnalogThresholdNoise + {this, "DefaultBarrelAnalogThresholdNoise", {130,150,160,160}, "Default threshold noise of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapAnalogThresholdNoise + {this, "DefaultEndcapAnalogThresholdNoise", {150,150,150}, "Default threshold noise of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMAnalogThresholdNoise + {this, "DefaultDBMAnalogThresholdNoise", {190,190,190}, "Default threshold noise of DBM pixel layers"}; + + Gaudi::Property<std::vector<int>> m_BarrelInTimeThreshold + {this, "DefaultBarrelInTimeThreshold", {2000,5000,5000,5000}, "Default in-time thresholds of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapInTimeThreshold + {this, "DefaultEndcapInTimeThreshold", {5000,5000,5000}, "Default in-time thresholds of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMInTimeThreshold + {this, "DefaultDBMInTimeThreshold", {1200,1200,1200}, "Default in-time thresholds of DBM pixel layers"}; + + Gaudi::Property<std::vector<int>> m_BarrelToTThreshold + {this, "BarrelToTThreshold", {-1, 3, 5, 5}, "Default ToT thresholds for barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_EndcapToTThreshold + {this, "EndcapToTThreshold", { 5, 5, 5}, "Default ToT thresholds for endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_DBMToTThreshold + {this, "DBMToTThreshold", {-1,-1,-1}, "Default ToT thresholds for DBM layers"}; + + Gaudi::Property<std::vector<double>> m_BarrelCrossTalk + {this, "BarrelCrossTalk", {0.06,0.06,0.06,0.06}, "Cross-talk fraction of barrel pixel layers"}; + + Gaudi::Property<std::vector<double>> m_EndcapCrossTalk + {this, "EndcapCrossTalk", {0.06,0.06,0.06}, "Cross-talk fraction of barrel endcap layers"}; + + Gaudi::Property<std::vector<double>> m_DBMCrossTalk + {this, "DBMCrossTalk", {0.06,0.06,0.06}, "Cross-talk fraction of barrel DBM layers"}; + + Gaudi::Property<std::vector<double>> m_BarrelThermalNoise + {this, "BarrelThermalNoise", {160.0,160.0,160.0,160.0}, "Thermal noise of barrel pixel layers"}; + + Gaudi::Property<std::vector<double>> m_EndcapThermalNoise + {this, "EndcapThermalNoise", {160.0,160.0,160.0}, "Thermal noise of endcap pixel layers"}; + + Gaudi::Property<std::vector<double>> m_DBMThermalNoise + {this, "DBMThermalNoise", {160.0,160.0,160.0}, "Thermal noise of DBM layers"}; + + Gaudi::Property<std::vector<double>> m_BarrelNoiseOccupancy + {this, "BarrelNoiseOccupancy", {5e-8,5e-8,5e-8,5e-8}, "Noise occupancy of barrel pixel layers"}; + + Gaudi::Property<std::vector<double>> m_EndcapNoiseOccupancy + {this, "EndcapNoiseOccupancy", {5e-8,5e-8,5e-8}, "Noise occupancy of endcap pixel layers"}; + + Gaudi::Property<std::vector<double>> m_DBMNoiseOccupancy + {this, "DBMNoiseOccupancy", {5e-8,5e-8,5e-8}, "Noise occupancy of DBM layers"}; + + Gaudi::Property<std::vector<double>> m_BarrelDisableProbability + {this, "BarrelDisableProbability", {9e-3,9e-3,9e-3,9e-3}, "Disable probability of barrel pixel layers"}; + + Gaudi::Property<std::vector<double>> m_EndcapDisableProbability + {this, "EndcapDisableProbability", {9e-3,9e-3,9e-3}, "Disable probability of endcap pixel layers"}; + + Gaudi::Property<std::vector<double>> m_DBMDisableProbability + {this, "DBMDisableProbability", {9e-3,9e-3,9e-3}, "Disable probability of DBM pixel layers"}; + +// +// So far, Gaudi::Property does not support 2D vector. +// +// Gaudi::Property<std::vector<std::vector<float>>> m_BarrelNoiseShape +// {this, "BarrelNoiseShape", {{0.0,1.0},{0.0,1.0},{0.0,1.0},{0.0,1.0}}, "Noise shape of barrel pixel layers"}; + +// Gaudi::Property<std::vector<std::vector<float>>> m_EndcapNoiseShape +// {this, "EndcapNoiseShape", {{0.0,1.0},{0.0,1.0},{0.0,1.0}}, "Noise shape of endcap pixel layers"}; + +// Gaudi::Property<std::vector<std::vector<float>>> m_DBMNoiseShape +// {this, "DBMNoiseShape", {{0.0,1.0},{0.0,1.0},{0.0,1.0}}, "Noise shape of DBM pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3BarrelLatency + {this, "FEI3BarrelLatency", { 0,151,256,256}, "FEI3 latency for barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3EndcapLatency + {this, "FEI3EndcapLatency", {256,256,256}, "FEI3 latency for endcap pixel layers"}; + + Gaudi::Property<std::vector<bool>> m_FEI3BarrelHitDuplication + {this, "FEI3BarrelHitDuplication", {false,false,false,false}, "Use FEI3 hit-duplicaiton for barrel pixel layers"}; + + Gaudi::Property<std::vector<bool>> m_FEI3EndcapHitDuplication + {this, "FEI3EndcapHitDuplication", {false,false,false}, "Use FEI3 hit-duplicaiton for endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3BarrelSmallHitToT + {this, "FEI3BarrelSmallHitToT", {-1,-1,-1,-1}, "Small hit ToT thresold for FEI3 hit-duplication of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3EndcapSmallHitToT + {this, "FEI3EndcapSmallHitToT", {-1,-1,-1}, "Small hit ToT thresold for FEI3 hit-duplication of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3BarrelTimingSimTune + {this, "FEI3BarrelTimingSimTune", {2015,2015,2015,2015}, "FEI3 timing tuning set of barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI3EndcapTimingSimTune + {this, "FEI3EndcapTimingSimTune", {2015,2015,2015}, "FEI3 timing tuning set of endcap pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI4BarrelHitDiscConfig + {this, "FEI4BarrelHitDiscConfig", {2}, "Set HitDiscConfig parameter for barrel pixel layers"}; + + Gaudi::Property<std::vector<int>> m_FEI4EndcapHitDiscConfig + {this, "FEI4EndcapHitDiscConfig", {2}, "Set HitDiscConfig parameter for endcap pixel layers"}; + std::vector<float> m_IBLNoiseShape; // This is ad-hoc solution. std::vector<float> m_BLayerNoiseShape; std::vector<float> m_PixelNoiseShape; - std::vector<int> m_FEI3BarrelLatency; - std::vector<int> m_FEI3EndcapLatency; - std::vector<bool> m_FEI3BarrelHitDuplication; - std::vector<bool> m_FEI3EndcapHitDuplication; - std::vector<int> m_FEI3BarrelSmallHitToT; - std::vector<int> m_FEI3EndcapSmallHitToT; - std::vector<int> m_FEI3BarrelTimingSimTune; - std::vector<int> m_FEI3EndcapTimingSimTune; - std::vector<int> m_FEI4BarrelHitDiscConfig; - std::vector<int> m_FEI4EndcapHitDiscConfig; - - bool m_useDeadMap; SG::ReadHandleKey<ComTime> m_ComTimeKey {this, "ComTimeKey", "ComTime", "Commissioning time for cosmic"}; @@ -97,7 +229,72 @@ class PixelConfigCondAlg : public AthReentrantAlgorithm { SG::WriteCondHandleKey<PixelModuleData> m_writeKey {this, "WriteKey", "PixelModuleData", "Output key of pixel module data"}; - ServiceHandle<ICondSvc> m_condSvc; + // Charge calibration parameters + Gaudi::Property<float> m_CalibrationParameterA + {this, "DefaultCalibrationParameterA", 70.2, "Default charge calibration parameter A"}; + + Gaudi::Property<float> m_CalibrationParameterE + {this, "DefaultCalibrationParameterE", -3561.25, "Default charge calibration parameter E"}; + + Gaudi::Property<float> m_CalibrationParameterC + {this, "DefaultCalibrationParameterC", 26000.0, "Default charge calibration parameter C"}; + + // DCS parameters + Gaudi::Property<float> m_biasVoltage + {this, "DefaultBiasVoltage", 150.0, "Default bias voltage"}; + + Gaudi::Property<float> m_temperature + {this, "DefaultTemperature", -7.0, "Default temperature in Celcius"}; + + // Cabling parameters + Gaudi::Property<bool> m_cablingMapToFile + {this, "CablingMapToFile", false, "Dump pixel cabling map into file"}; + + Gaudi::Property<std::string> m_cablingMapFileName + {this, "CablingMapFileName", "PixelCabling/Pixels_Atlas_IdMapping_2016.dat", "Read cabling map from file"}; + + // Distortion parameters + /** @brief Flag controlling how module distortions are taken into account: + case 0 -----> No distorsions implemented; + case 1 -----> Set curvature (in 1/meter) and twist (in radiant) equal for all modules; + case 2 -----> Read curvatures and twists from textfile containing Survey data; + case 3 -----> Set curvature and twist from Gaussian random generator with mean and RMS coming from Survey data; + case 4 -----> Read curvatures and twists from database; + */ + Gaudi::Property<int> m_distortionInputSource + {this, "DistortionInputSource", 4, "Source of module distortions: 0 (none), 1 (constant), 2 (text file), 3 (random), 4 (database)"}; + + Gaudi::Property<int> m_distortionVersion + {this, "DistortionVersion", 1, "Version number for distortion model"}; + + Gaudi::Property<double> m_distortionR1 + {this, "DistortionR1", 0.1/CLHEP::meter, "Fixed distortion parameters: radius of curvature"}; //corresponding to a sagitta of 50 um + + Gaudi::Property<double> m_distortionR2 + {this, "DistortionR2", 0.1/CLHEP::meter, "Fixed distortion parameters: radius of curvature"}; //corresponding to a sagitta of 50 um + + Gaudi::Property<double> m_distortionTwist + {this, "DistortionTwist", 0.0005,"Fixed distortion parameters: twist angle (tan(theta))"}; + + Gaudi::Property<double> m_distortionMeanR + {this, "DistortionMean_R", 0.12/CLHEP::meter, "Random distortion parameters: Mean of radius of curvature"}; //Mean value from Survey + + Gaudi::Property<double> m_distortionRMSR + {this, "DistortionRMS_R", 0.08/CLHEP::meter, "Random distortion parameters: RMS of curvature radius"}; //RMS value from Survey + + Gaudi::Property<double> m_distortionMeanTwist + {this, "DistortionMean_twist", -0.0005,"Random distortion parameters: Mean twist angle"}; //Mean value from Survey + + Gaudi::Property<double> m_distortionRMSTwist + {this, "DistortionRMS_twist", 0.0008,"Random distortion parameters: RMS of twist angle"}; //RMS value from Survey + + Gaudi::Property<bool> m_distortionWriteToFile + {this, "DistortionWriteToFile", false, "Record data in storegate"}; + + Gaudi::Property<std::string> m_distortionFileName + {this, "DistortionFileName", "PixelSurveyDistortions.txt","Read distortions from this file"}; + + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; }; -#endif // PIXELCONFIGCONDALG +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx index 80722855be2..37e0d7770bc 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx @@ -8,14 +8,8 @@ #include <memory> PixelDCSCondHVAlg::PixelDCSCondHVAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthReentrantAlgorithm(name, pSvcLocator), - m_pixelID(nullptr), - m_useConditions(true), - m_defaultBiasVoltage(150.0), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { - declareProperty("UseConditions", m_useConditions); - declareProperty("BiasVoltage", m_defaultBiasVoltage, "Default bias voltage in Volt." ); } StatusCode PixelDCSCondHVAlg::initialize() { @@ -24,7 +18,7 @@ StatusCode PixelDCSCondHVAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); - + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { @@ -37,40 +31,46 @@ StatusCode PixelDCSCondHVAlg::initialize() { StatusCode PixelDCSCondHVAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelDCSCondHVAlg::execute()"); - SG::WriteCondHandle<PixelModuleData> writeHandle(m_writeKey, ctx); + SG::WriteCondHandle<PixelDCSHVData> writeHandle(m_writeKey, ctx); if (writeHandle.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); - const CondAttrListCollection* readCdo = *readHandle; - if (readCdo==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object"); - return StatusCode::FAILURE; - } - // Get the validitiy range - EventIDRange rangeW; - if (not readHandle.range(rangeW)) { - ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of input is " << rangeW); - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelModuleData> writeCdo(std::make_unique<PixelModuleData>()); + std::unique_ptr<PixelDCSHVData> writeCdo(std::make_unique<PixelDCSHVData>()); + + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; - // Read HV info - std::string param("HV"); - if (m_useConditions) { + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDCSHVConditions()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); + const CondAttrListCollection* readCdo = *readHandle; + if (readCdo==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object"); + return StatusCode::FAILURE; + } + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); + ATH_MSG_INFO("Range of input is " << rangeW); + + // Read HV info + std::string param("HV"); for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { const CondAttrListCollection::ChanNum &channelNumber = attrList->first; const CondAttrListCollection::AttributeList &payload = attrList->second; if (payload.exists(param) and not payload[param].isNull()) { float val = payload[param].data<float>(); if (val>1000.0 || val<-1000.0) { - writeCdo -> setBiasVoltage((int)channelNumber, m_defaultBiasVoltage); + writeCdo -> setBiasVoltage((int)channelNumber, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultBiasVoltage()); } else { writeCdo -> setBiasVoltage((int)channelNumber, val); @@ -78,18 +78,18 @@ StatusCode PixelDCSCondHVAlg::execute(const EventContext& ctx) const { } else { ATH_MSG_WARNING(param << " does not exist for ChanNum " << channelNumber); - writeCdo -> setBiasVoltage((int)channelNumber, m_defaultBiasVoltage); + writeCdo -> setBiasVoltage((int)channelNumber, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultBiasVoltage()); } } } else { for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { - writeCdo -> setBiasVoltage(i, m_defaultBiasVoltage); + writeCdo -> setBiasVoltage(i, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultBiasVoltage()); } } if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) { - ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); + ATH_MSG_FATAL("Could not record PixelDCSHVData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); return StatusCode::FAILURE; } ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << rangeW << " into Conditions Store"); @@ -97,8 +97,3 @@ StatusCode PixelDCSCondHVAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } -StatusCode PixelDCSCondHVAlg::finalize() { - ATH_MSG_DEBUG("PixelDCSCondHVAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.h index e800ba86984..b53d9c22bb0 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelDCSCondHVAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel bias voltage data in PixelDCSHVData. + */ #ifndef PIXELDCSCONDHVALG #define PIXELDCSCONDHVALG @@ -12,6 +18,7 @@ #include "StoreGate/WriteCondHandleKey.h" #include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSHVData.h" #include "InDetIdentifier/PixelID.h" @@ -25,18 +32,20 @@ class PixelDCSCondHVAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - const PixelID* m_pixelID; + const PixelID* m_pixelID{nullptr}; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - bool m_useConditions; - float m_defaultBiasVoltage; + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKey", "/PIXEL/DCS/HV", "Key of input (raw) HV conditions folder"}; - SG::WriteCondHandleKey<PixelModuleData> m_writeKey{this, "WriteKey", "PixelDCSHVCondData", "Key of output (derived) HV conditions data"}; + SG::ReadCondHandleKey<CondAttrListCollection> m_readKey + {this, "ReadKey", "/PIXEL/DCS/HV", "Key of input (raw) HV conditions folder"}; + + SG::WriteCondHandleKey<PixelDCSHVData> m_writeKey + {this, "WriteKey", "PixelDCSHVCondData", "Key of output (derived) HV conditions data"}; - ServiceHandle<ICondSvc> m_condSvc; }; -#endif // PIXELDCSCONDHVALG +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx index 960be695123..2064c95d484 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx @@ -8,28 +8,23 @@ #include <memory> PixelDCSCondStateAlg::PixelDCSCondStateAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthReentrantAlgorithm(name, pSvcLocator), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { } StatusCode PixelDCSCondStateAlg::initialize() { ATH_MSG_DEBUG("PixelDCSCondStateAlg::initialize()"); + ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKeyState.initialize()); - ATH_CHECK(m_readKeyStatus.initialize()); ATH_CHECK(m_writeKeyState.initialize()); - ATH_CHECK(m_writeKeyStatus.initialize()); if (m_condSvc->regHandle(this, m_writeKeyState).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyState.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - if (m_condSvc->regHandle(this, m_writeKeyStatus).isFailure()) { - ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyStatus.fullKey() << " with CondSvc"); - return StatusCode::FAILURE; - } return StatusCode::SUCCESS; } @@ -37,15 +32,23 @@ StatusCode PixelDCSCondStateAlg::initialize() { StatusCode PixelDCSCondStateAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelDCSCondStateAlg::execute()"); - //=========== - // FSM_STATE - //=========== - SG::WriteCondHandle<PixelModuleData> writeHandleState(m_writeKeyState, ctx); - + SG::WriteCondHandle<PixelDCSStateData> writeHandleState(m_writeKeyState, ctx); if (writeHandleState.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandleState.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); + return StatusCode::SUCCESS; } - else { + + // Construct the output Cond Object and fill it in + std::unique_ptr<PixelDCSStateData> writeCdoState(std::make_unique<PixelDCSStateData>()); + + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; + + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDCSStateConditions()) { SG::ReadCondHandle<CondAttrListCollection> readHandleState(m_readKeyState, ctx); const CondAttrListCollection* readCdoState(*readHandleState); if (readCdoState==nullptr) { @@ -53,16 +56,12 @@ StatusCode PixelDCSCondStateAlg::execute(const EventContext& ctx) const { return StatusCode::FAILURE; } // Get the validitiy range (state) - EventIDRange rangeState; - if (not readHandleState.range(rangeState)) { + if (not readHandleState.range(rangeW)) { ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandleState.key()); return StatusCode::FAILURE; } ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleState.fullKey() << " readCdo->size()= " << readCdoState->size()); - ATH_MSG_INFO("Range of state input is " << rangeState); - - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelModuleData> writeCdoState(std::make_unique<PixelModuleData>()); + ATH_MSG_INFO("Range of state input is " << rangeW); // Read state info std::string paramState = "FSM_state"; @@ -71,83 +70,28 @@ StatusCode PixelDCSCondStateAlg::execute(const EventContext& ctx) const { const CondAttrListCollection::AttributeList &payload = attrListState->second; if (payload.exists(paramState.c_str()) and not payload[paramState.c_str()].isNull()) { std::string val = payload[paramState.c_str()].data<std::string>(); - if (val=="READY") { writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::READY); } - else if (val=="ON") { writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::ON); } - else if (val=="UNKNOWN") { writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::UNKNOWN); } - else if (val=="TRANSITION") { writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::TRANSITION); } - else if (val=="UNDEFINED") { writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::UNDEFINED); } + if (val=="READY") { writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::READY); } + else if (val=="ON") { writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::ON); } + else if (val=="UNKNOWN") { writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::UNKNOWN); } + else if (val=="TRANSITION") { writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::TRANSITION); } + else if (val=="UNDEFINED") { writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::UNDEFINED); } } else { ATH_MSG_WARNING(paramState << " does not exist for ChanNum " << channelNumber); - writeCdoState->setModuleStatus(channelNumber,PixelModuleData::DCSModuleState::NOSTATE); + writeCdoState->setModuleStatus(channelNumber,PixelDCSStateData::DCSModuleState::NOSTATE); } } - - if (writeHandleState.record(rangeState, std::move(writeCdoState)).isFailure()) { - ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandleState.key() << " with EventRange " << rangeState << " into Conditions Store"); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("recorded new CDO " << writeHandleState.key() << " with range " << rangeState << " into Conditions Store"); } - - //============ - // FSM_STATUS - //============ - SG::WriteCondHandle<PixelModuleData> writeHandleStatus(m_writeKeyStatus, ctx); - - if (writeHandleStatus.isValid()) { - ATH_MSG_DEBUG("CondHandle " << writeHandleStatus.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); + else { // Set READY for enough large numbers + for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { writeCdoState->setModuleStatus(i,PixelDCSStateData::DCSModuleState::READY); } } - else { - SG::ReadCondHandle<CondAttrListCollection> readHandleStatus(m_readKeyStatus, ctx); - const CondAttrListCollection* readCdoStatus(*readHandleStatus); - if (readCdoStatus==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object (state)"); - return StatusCode::FAILURE; - } - // Get the validitiy range (state) - EventIDRange rangeStatus; - if (not readHandleStatus.range(rangeStatus)) { - ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandleStatus.key()); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleStatus.fullKey() << " readCdo->size()= " << readCdoStatus->size()); - ATH_MSG_INFO("Range of state input is " << rangeStatus); - - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelModuleData> writeCdoStatus(std::make_unique<PixelModuleData>()); - - // Read state info - std::string paramStatus = "FSM_status"; - for (CondAttrListCollection::const_iterator attrListStatus=readCdoStatus->begin(); attrListStatus!=readCdoStatus->end(); ++attrListStatus) { - const CondAttrListCollection::ChanNum &channelNumber = attrListStatus->first; - const CondAttrListCollection::AttributeList &payload = attrListStatus->second; - if (payload.exists(paramStatus.c_str()) and not payload[paramStatus.c_str()].isNull()) { - std::string val = payload[paramStatus.c_str()].data<std::string>(); - if (val=="OK") { writeCdoStatus->setModuleStatus(channelNumber,PixelModuleData::DCSModuleStatus::OK); } - else if (val=="WARNING") { writeCdoStatus->setModuleStatus(channelNumber,PixelModuleData::DCSModuleStatus::WARNING); } - else if (val=="ERROR") { writeCdoStatus->setModuleStatus(channelNumber,PixelModuleData::DCSModuleStatus::ERROR); } - else if (val=="FATAL") { writeCdoStatus->setModuleStatus(channelNumber,PixelModuleData::DCSModuleStatus::FATAL); } - } - else { - ATH_MSG_WARNING(paramStatus << " does not exist for ChanNum " << channelNumber); - writeCdoStatus->setModuleStatus(channelNumber,PixelModuleData::DCSModuleStatus::NOSTATUS); - } - } - - if (writeHandleStatus.record(rangeStatus, std::move(writeCdoStatus)).isFailure()) { - ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandleStatus.key() << " with EventRange " << rangeStatus << " into Conditions Store"); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("recorded new CDO " << writeHandleStatus.key() << " with range " << rangeStatus << " into Conditions Store"); + if (writeHandleState.record(rangeW, std::move(writeCdoState)).isFailure()) { + ATH_MSG_FATAL("Could not record PixelDCSStateData " << writeHandleState.key() << " with EventRange " << rangeW << " into Conditions Store"); + return StatusCode::FAILURE; } + ATH_MSG_INFO("recorded new CDO " << writeHandleState.key() << " with range " << rangeW << " into Conditions Store"); return StatusCode::SUCCESS; } -StatusCode PixelDCSCondStateAlg::finalize() { - ATH_MSG_DEBUG("PixelDCSCondStateAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h index 1e064424d26..9299af32900 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelDCSCondStatusAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Created pixel DCS module status in PixelDCSStatusData. + */ #ifndef PIXELDCSCONDSTATEALG #define PIXELDCSCONDSTATEALG @@ -12,6 +18,9 @@ #include "StoreGate/WriteCondHandleKey.h" #include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSStateData.h" + +#include "InDetIdentifier/PixelID.h" #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" @@ -23,16 +32,21 @@ class PixelDCSCondStateAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyState {this, "ReadKeyState", "/PIXEL/DCS/FSMSTATE", "Key of input (raw) State conditions folder"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyStatus {this, "ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS", "Key of input (raw) Status conditions folder"}; + const PixelID* m_pixelID{nullptr}; + + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; + + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; + + SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyState + {this, "ReadKeyState", "/PIXEL/DCS/FSMSTATE", "Key of input DCS state conditions folder"}; - SG::WriteCondHandleKey<PixelModuleData> m_writeKeyState {this, "WriteKeyState", "PixelDCSStateCondData", "Key of output (derived) State conditions folder"}; - SG::WriteCondHandleKey<PixelModuleData> m_writeKeyStatus{this, "WriteKeyStatus", "PixelDCSStatusCondData", "Key of output (derived) Status conditions folder"}; + SG::WriteCondHandleKey<PixelDCSStateData> m_writeKeyState + {this, "WriteKeyState", "PixelDCSStateCondData", "Key of output DCS state data"}; - ServiceHandle<ICondSvc> m_condSvc; }; -#endif // PIXELDCSCONDSTATEALG +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx new file mode 100644 index 00000000000..5e9424bd9b2 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.cxx @@ -0,0 +1,98 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelDCSCondStatusAlg.h" +#include "Identifier/IdentifierHash.h" +#include "GaudiKernel/EventIDRange.h" +#include <memory> + +PixelDCSCondStatusAlg::PixelDCSCondStatusAlg(const std::string& name, ISvcLocator* pSvcLocator): + ::AthReentrantAlgorithm(name, pSvcLocator) +{ +} + +StatusCode PixelDCSCondStatusAlg::initialize() { + ATH_MSG_DEBUG("PixelDCSCondStatusAlg::initialize()"); + + ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); + ATH_CHECK(m_condSvc.retrieve()); + + ATH_CHECK(m_moduleDataKey.initialize()); + ATH_CHECK(m_readKeyStatus.initialize()); + ATH_CHECK(m_writeKeyStatus.initialize()); + if (m_condSvc->regHandle(this, m_writeKeyStatus).isFailure()) { + ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyStatus.fullKey() << " with CondSvc"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode PixelDCSCondStatusAlg::execute(const EventContext& ctx) const { + ATH_MSG_DEBUG("PixelDCSCondStatusAlg::execute()"); + + SG::WriteCondHandle<PixelDCSStatusData> writeHandleStatus(m_writeKeyStatus, ctx); + if (writeHandleStatus.isValid()) { + ATH_MSG_DEBUG("CondHandle " << writeHandleStatus.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); + return StatusCode::SUCCESS; + } + + // Construct the output Cond Object and fill it in + std::unique_ptr<PixelDCSStatusData> writeCdoStatus(std::make_unique<PixelDCSStatusData>()); + + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; + + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDCSStatusConditions()) { + SG::ReadCondHandle<CondAttrListCollection> readHandleStatus(m_readKeyStatus, ctx); + const CondAttrListCollection* readCdoStatus(*readHandleStatus); + if (readCdoStatus==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object (state)"); + return StatusCode::FAILURE; + } + // Get the validitiy range (state) + if (not readHandleStatus.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandleStatus.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleStatus.fullKey() << " readCdo->size()= " << readCdoStatus->size()); + ATH_MSG_INFO("Range of state input is " << rangeW); + + // Read state info + std::string paramStatus = "FSM_status"; + for (CondAttrListCollection::const_iterator attrListStatus=readCdoStatus->begin(); attrListStatus!=readCdoStatus->end(); ++attrListStatus) { + const CondAttrListCollection::ChanNum &channelNumber = attrListStatus->first; + const CondAttrListCollection::AttributeList &payload = attrListStatus->second; + if (payload.exists(paramStatus.c_str()) and not payload[paramStatus.c_str()].isNull()) { + std::string val = payload[paramStatus.c_str()].data<std::string>(); + if (val=="OK") { writeCdoStatus->setModuleStatus(channelNumber,PixelDCSStatusData::DCSModuleStatus::OK); } + else if (val=="WARNING") { writeCdoStatus->setModuleStatus(channelNumber,PixelDCSStatusData::DCSModuleStatus::WARNING); } + else if (val=="ERROR") { writeCdoStatus->setModuleStatus(channelNumber,PixelDCSStatusData::DCSModuleStatus::ERROR); } + else if (val=="FATAL") { writeCdoStatus->setModuleStatus(channelNumber,PixelDCSStatusData::DCSModuleStatus::FATAL); } + } + else { + ATH_MSG_WARNING(paramStatus << " does not exist for ChanNum " << channelNumber); + writeCdoStatus->setModuleStatus(channelNumber,PixelDCSStatusData::DCSModuleStatus::NOSTATUS); + } + } + } + else { + for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { + writeCdoStatus->setModuleStatus(i,PixelDCSStatusData::DCSModuleStatus::OK); + } + } + + if (writeHandleStatus.record(rangeW, std::move(writeCdoStatus)).isFailure()) { + ATH_MSG_FATAL("Could not record PixelDCSStatusData " << writeHandleStatus.key() << " with EventRange " << rangeW << " into Conditions Store"); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("recorded new CDO " << writeHandleStatus.key() << " with range " << rangeW << " into Conditions Store"); + + return StatusCode::SUCCESS; +} + diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h new file mode 100644 index 00000000000..fe94f516b9c --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStatusAlg.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsAlgorithms/PixelDCSCondStatusAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Created pixel DCS module status in PixelDCSStatusData. + */ + +#ifndef PIXELDCSCONDSTATUSALG +#define PIXELDCSCONDSTATUSALG + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" + +#include "StoreGate/ReadCondHandleKey.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" + +#include "StoreGate/WriteCondHandleKey.h" +#include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSStatusData.h" + +#include "InDetIdentifier/PixelID.h" + +#include "GaudiKernel/ICondSvc.h" +#include "GaudiKernel/Property.h" + +class PixelDCSCondStatusAlg : public AthReentrantAlgorithm { + public: + PixelDCSCondStatusAlg(const std::string& name, ISvcLocator* pSvcLocator); + virtual ~PixelDCSCondStatusAlg() = default; + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + + private: + const PixelID* m_pixelID{nullptr}; + + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; + + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; + + SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyStatus + {this, "ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS", "Key of input DCS status conditions folder"}; + + SG::WriteCondHandleKey<PixelDCSStatusData> m_writeKeyStatus + {this, "WriteKeyStatus", "PixelDCSStatusCondData", "Key of output DCS status data"}; + +}; + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx index e754e7dea80..4d5e4f56fca 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx @@ -9,14 +9,8 @@ #include <memory> PixelDCSCondTempAlg::PixelDCSCondTempAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_pixelID(nullptr), - m_useConditions(true), - m_defaultTemperature(-7.0), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { - declareProperty("UseConditions", m_useConditions); - declareProperty("Temperature", m_defaultTemperature, "Default temperature in Celcius."); } StatusCode PixelDCSCondTempAlg::initialize() { @@ -25,56 +19,60 @@ StatusCode PixelDCSCondTempAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_condSvc.retrieve()); - + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this, m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - return StatusCode::SUCCESS; } -StatusCode PixelDCSCondTempAlg::execute() { +StatusCode PixelDCSCondTempAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelDCSCondTempAlg::execute()"); - SG::WriteCondHandle<PixelModuleData> writeHandle(m_writeKey); + SG::WriteCondHandle<PixelDCSTempData> writeHandle(m_writeKey, ctx); // Do we have a valid Write Cond Handle for current time? if (writeHandle.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - // Read Cond Handle - SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey); - const CondAttrListCollection* readCdo(*readHandle); - if (readCdo==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object"); - return StatusCode::FAILURE; - } - // Get the validitiy range - EventIDRange rangeW; - if (not readHandle.range(rangeW)) { - ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of input is " << rangeW); - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelModuleData> writeCdo(std::make_unique<PixelModuleData>()); + std::unique_ptr<PixelDCSTempData> writeCdo(std::make_unique<PixelDCSTempData>()); + + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; - // Read temperature info - std::string param{"temperature"}; - if (m_useConditions) { + EventIDRange rangeW{start, stop}; + + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDCSTemperatureConditions()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); + const CondAttrListCollection* readCdo(*readHandle); + if (readCdo==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object"); + return StatusCode::FAILURE; + } + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); + ATH_MSG_INFO("Range of input is " << rangeW); + + // Read temperature info + std::string param{"temperature"}; for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { CondAttrListCollection::ChanNum channelNumber{attrList->first}; CondAttrListCollection::AttributeList payload{attrList->second}; if (payload.exists(param) and not payload[param].isNull()) { float val = payload[param].data<float>(); if (val>100.0 || val<-80.0) { - writeCdo->setTemperature((int)channelNumber, m_defaultTemperature); + writeCdo->setTemperature((int)channelNumber, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultTemperature()); } else { writeCdo->setTemperature((int)channelNumber, val); @@ -82,18 +80,18 @@ StatusCode PixelDCSCondTempAlg::execute() { } else { ATH_MSG_WARNING(param << " does not exist for ChanNum " << channelNumber); - writeCdo->setTemperature((int)channelNumber, m_defaultTemperature); + writeCdo->setTemperature((int)channelNumber, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultTemperature()); } } } else { for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { - writeCdo->setTemperature(i, m_defaultTemperature); + writeCdo->setTemperature(i, SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getDefaultTemperature()); } } if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) { - ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); + ATH_MSG_FATAL("Could not record PixelDCSTempData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); return StatusCode::FAILURE; } ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << rangeW << " into Conditions Store"); @@ -101,8 +99,3 @@ StatusCode PixelDCSCondTempAlg::execute() { return StatusCode::SUCCESS; } -StatusCode PixelDCSCondTempAlg::finalize() { - ATH_MSG_DEBUG("PixelDCSCondTempAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.h index d8cace7ce58..6f392dc81c1 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.h @@ -1,42 +1,51 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelDCSCondTempAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Created pixel temperature data in PixelDCSTempData. + */ #ifndef PIXELDCSCONDTEMPALG #define PIXELDCSCONDTEMPALG -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" #include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSTempData.h" #include "InDetIdentifier/PixelID.h" #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" -class PixelDCSCondTempAlg : public AthAlgorithm { +class PixelDCSCondTempAlg : public AthReentrantAlgorithm { public: PixelDCSCondTempAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~PixelDCSCondTempAlg() = default; virtual StatusCode initialize() override; - virtual StatusCode execute() override; - virtual StatusCode finalize() override; + virtual StatusCode execute(const EventContext& ctx) const override; private: - const PixelID* m_pixelID; + const PixelID* m_pixelID{nullptr}; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - bool m_useConditions; - float m_defaultTemperature; + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKey", "/PIXEL/DCS/TEMPERATURE", "Key of input (raw) temperature conditions folder"}; - SG::WriteCondHandleKey<PixelModuleData> m_writeKey{this, "WriteKey", "PixelDCSTempCondData", "Key of output (derived) temperature conditions folder"}; + SG::ReadCondHandleKey<CondAttrListCollection> m_readKey + {this, "ReadKey", "/PIXEL/DCS/TEMPERATURE", "Key of input (raw) temperature conditions folder"}; + + SG::WriteCondHandleKey<PixelDCSTempData> m_writeKey + {this, "WriteKey", "PixelDCSTempCondData", "Key of output (derived) temperature conditions folder"}; - ServiceHandle<ICondSvc> m_condSvc; }; -#endif // PIXELDCSCONDTEMPALG +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx index 42eb8194ee7..4421fc4c34b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.cxx @@ -8,8 +8,7 @@ #include <sstream> PixelDeadMapCondAlg::PixelDeadMapCondAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthReentrantAlgorithm(name, pSvcLocator), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { } @@ -17,7 +16,7 @@ StatusCode PixelDeadMapCondAlg::initialize() { ATH_MSG_DEBUG("PixelDeadMapCondAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); - + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { @@ -36,56 +35,64 @@ StatusCode PixelDeadMapCondAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } - SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); - const CondAttrListCollection* readCdo = *readHandle; - if (readCdo==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object"); - return StatusCode::FAILURE; - } - // Get the validitiy range - EventIDRange rangeW; - if (not readHandle.range(rangeW)) { - ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Size of AthenaAttributeList " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of input is " << rangeW); - // Construct the output Cond Object and fill it in std::unique_ptr<PixelDeadMapCondData> writeCdo(std::make_unique<PixelDeadMapCondData>()); - for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { - const CondAttrListCollection::ChanNum &channelNumber = attrList->first; - const CondAttrListCollection::AttributeList &payload = attrList->second; + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; - // RUN-3 format - if (payload.exists("data_array") and not payload["data_array"].isNull()) { - const std::string &stringStatus = payload["data_array"].data<std::string>(); + EventIDRange rangeW{start, stop}; - std::stringstream ss(stringStatus); - std::vector<std::string> component; - std::string buffer; - while (std::getline(ss,buffer,',')) { component.push_back(buffer); } + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseDeadmapConditions()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); + const CondAttrListCollection* readCdo = *readHandle; + if (readCdo==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object"); + return StatusCode::FAILURE; + } + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of AthenaAttributeList " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); + ATH_MSG_INFO("Range of input is " << rangeW); - for (int i=0; i<(int)component.size(); i++) { - std::stringstream checkModule(component[i]); - std::vector<std::string> moduleString; - while (std::getline(checkModule,buffer,':')) { moduleString.push_back(buffer); } + for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { + const CondAttrListCollection::ChanNum &channelNumber = attrList->first; + const CondAttrListCollection::AttributeList &payload = attrList->second; - if (moduleString.size()!=2) { - ATH_MSG_FATAL("String size (moduleString) is not 2. " << moduleString.size() << " in " << component[i] << " channel " << channelNumber << " read from " << readHandle.fullKey()); - return StatusCode::FAILURE; - } + // RUN-3 format + if (payload.exists("data_array") and not payload["data_array"].isNull()) { + const std::string &stringStatus = payload["data_array"].data<std::string>(); + + std::stringstream ss(stringStatus); + std::vector<std::string> component; + std::string buffer; + while (std::getline(ss,buffer,',')) { component.push_back(buffer); } + + for (int i=0; i<(int)component.size(); i++) { + std::stringstream checkModule(component[i]); + std::vector<std::string> moduleString; + while (std::getline(checkModule,buffer,':')) { moduleString.push_back(buffer); } + + if (moduleString.size()!=2) { + ATH_MSG_FATAL("String size (moduleString) is not 2. " << moduleString.size() << " in " << component[i] << " channel " << channelNumber << " read from " << readHandle.fullKey()); + return StatusCode::FAILURE; + } - std::stringstream checkModuleHash(moduleString[0]); - std::vector<std::string> moduleStringHash; - while (std::getline(checkModuleHash,buffer,'"')) { moduleStringHash.push_back(buffer); } + std::stringstream checkModuleHash(moduleString[0]); + std::vector<std::string> moduleStringHash; + while (std::getline(checkModuleHash,buffer,'"')) { moduleStringHash.push_back(buffer); } - int moduleHash = std::atoi(moduleStringHash[1].c_str()); - int moduleStatus = std::atoi(moduleString[1].c_str()); + int moduleHash = std::atoi(moduleStringHash[1].c_str()); + int moduleStatus = std::atoi(moduleString[1].c_str()); - if (moduleStatus<0) { writeCdo->setModuleStatus(moduleHash, 1); } - else { writeCdo->setChipStatus(moduleHash, moduleStatus); } + if (moduleStatus<0) { writeCdo->setModuleStatus(moduleHash, 1); } + else { writeCdo->setChipStatus(moduleHash, moduleStatus); } + } } } } @@ -104,7 +111,3 @@ StatusCode PixelDeadMapCondAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } -StatusCode PixelDeadMapCondAlg::finalize() { - ATH_MSG_DEBUG("PixelDeadMapCondAlg::finalize()"); - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h index 189b4826e6d..cd76863789c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDeadMapCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelDeadMapCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date December, 2019 + * @brief Store pixel module/FE status in PixelDeadMapCondData. + */ #ifndef PIXELDEADMAPCONDALG_H #define PIXELDEADMAPCONDALG_H @@ -11,6 +17,7 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/WriteCondHandleKey.h" +#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelDeadMapCondData.h" #include "GaudiKernel/ICondSvc.h" @@ -22,10 +29,12 @@ class PixelDeadMapCondAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - ServiceHandle<ICondSvc> m_condSvc; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; + + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; SG::ReadCondHandleKey<CondAttrListCollection> m_readKey {this, "ReadKey", "/PIXEL/PixelModuleFeMask", "Input deadmap folder"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx index 0c13b136711..08424b9af64 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx @@ -13,7 +13,6 @@ PixelDetectorElementCondAlg::PixelDetectorElementCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : ::AthReentrantAlgorithm(name, pSvcLocator) - , m_readKey{"PixelAlignmentStore", "PixelAlignmentStore"} { declareProperty("ReadKey", m_readKey); } @@ -133,9 +132,3 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const return StatusCode::SUCCESS; } -StatusCode PixelDetectorElementCondAlg::finalize() -{ - ATH_MSG_DEBUG("finalize " << name()); - - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.h index a6f79d258f8..3cec075e825 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.h @@ -29,13 +29,15 @@ class PixelDetectorElementCondAlg : public AthReentrantAlgorithm virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; /** Make this algorithm clonable. */ virtual bool isClonable() const override { return true; }; private: - SG::ReadCondHandleKey<GeoAlignmentStore> m_readKey; - SG::WriteCondHandleKey<InDetDD::SiDetectorElementCollection> m_writeKey{this, "WriteKey", "PixelDetectorElementCollection", "Key of output SiDetectorElementCollection for Pixel"}; + SG::ReadCondHandleKey<GeoAlignmentStore> m_readKey + {this, "PixelAlignmentStore", "PixelAlignmentStore", "PixelAlignmentStore data"}; + + SG::WriteCondHandleKey<InDetDD::SiDetectorElementCollection> m_writeKey + {this, "WriteKey", "PixelDetectorElementCollection", "Key of output SiDetectorElementCollection for Pixel"}; ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; const InDetDD::PixelDetectorManager* m_detManager{nullptr}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.cxx index a075e21202a..62a061a6d72 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.cxx @@ -11,6 +11,7 @@ #include "CLHEP/Random/RandGaussZiggurat.h" #include "PathResolver/PathResolver.h" +#include "CLHEP/Units/SystemOfUnits.h" #include <map> #include <stdint.h> @@ -18,8 +19,9 @@ #include <istream> PixelDistortionAlg::PixelDistortionAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_pixelID(nullptr) { } + ::AthAlgorithm(name, pSvcLocator) +{ +} StatusCode PixelDistortionAlg::initialize() { ATH_MSG_DEBUG("PixelDistortionAlg::initialize()"); @@ -27,16 +29,14 @@ StatusCode PixelDistortionAlg::initialize() { ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); ATH_CHECK(m_rndmSvc.retrieve()); - ATH_CHECK(m_condSvc.retrieve()); - + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - return StatusCode::SUCCESS; } @@ -49,45 +49,38 @@ StatusCode PixelDistortionAlg::execute() { return StatusCode::SUCCESS; } - SG::ReadCondHandle<DetCondCFloat> readHandle(m_readKey); - const DetCondCFloat* readCdo = *readHandle; - if (readCdo==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object"); - return StatusCode::FAILURE; - } - // Get the validitiy range - ATH_MSG_DEBUG("Size of DetCondCFloat " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - // Construct the output Cond Object and fill it in std::unique_ptr<PixelDistortionData> writeCdo(std::make_unique<PixelDistortionData>()); + SG::ReadCondHandle<PixelModuleData> moduleData(m_moduleDataKey); + constexpr int nmodule_max = 2048; std::unordered_map<uint32_t,std::vector<float>> distortionMap; - if (m_inputSource==0) { // no bow correction + if (moduleData->getDistortionInputSource()==0) { // no bow correction ATH_MSG_DEBUG("No bow correction"); - writeCdo -> setVersion(m_version); + writeCdo -> setVersion(moduleData->getDistortionVersion()); for (int i=0; i<nmodule_max; i++) { distortionMap[i].push_back(0.0); distortionMap[i].push_back(0.0); distortionMap[i].push_back(0.0); } } - else if (m_inputSource==1) { // constant bow + else if (moduleData->getDistortionInputSource()==1) { // constant bow ATH_MSG_DEBUG("Using constant pixel distortions "); - writeCdo -> setVersion(m_version); + writeCdo -> setVersion(moduleData->getDistortionVersion()); for (int i=0; i<nmodule_max; i++) { - distortionMap[i].push_back(m_R1*CLHEP::meter); // convert to 1/mm - distortionMap[i].push_back(m_R2*CLHEP::meter); // convert to 1/mm - distortionMap[i].push_back(2.0*atan(m_twist)/CLHEP::degree); // convert to degree + distortionMap[i].push_back(moduleData->getDistortionR1()*CLHEP::meter); // convert to 1/mm + distortionMap[i].push_back(moduleData->getDistortionR2()*CLHEP::meter); // convert to 1/mm + distortionMap[i].push_back(2.0*atan(moduleData->getDistortionTwist())/CLHEP::degree); // convert to degree } } - else if (m_inputSource==2) { // read from file - ATH_MSG_DEBUG("Reading pixel distortions from file: " << m_textFileName); - writeCdo -> setVersion(m_version); + else if (moduleData->getDistortionInputSource()==2) { // read from file + ATH_MSG_DEBUG("Reading pixel distortions from file: " << moduleData->getDistortionFileName()); + writeCdo -> setVersion(moduleData->getDistortionVersion()); - std::string file_name = PathResolver::find_file(m_textFileName, "DATAPATH"); + std::string file_name = PathResolver::find_file(moduleData->getDistortionFileName(), "DATAPATH"); if (file_name.size()==0) { - ATH_MSG_ERROR("Distortion file " << m_textFileName << " not found! No pixel distortion will be applied."); + ATH_MSG_ERROR("Distortion file " << moduleData->getDistortionFileName() << " not found! No pixel distortion will be applied."); return StatusCode::FAILURE; } std::ifstream input(file_name.c_str()); @@ -99,11 +92,11 @@ StatusCode PixelDistortionAlg::execute() { unsigned int idmod; float r1,r2,twist; unsigned int hashID = 0; - if (m_version==0) { + if (moduleData->getDistortionVersion()==0) { input >> std::hex >> idmod >> std::dec >> r1 >> r2 >> twist; hashID = m_pixelID->wafer_hash((Identifier)idmod); } - else if (m_version>0) { + else if (moduleData->getDistortionVersion()>0) { input >> idmod >> r1 >> r2 >> twist; hashID = idmod; } @@ -114,24 +107,33 @@ StatusCode PixelDistortionAlg::execute() { } input.close(); } - else if (m_inputSource==3) { // random generation + else if (moduleData->getDistortionInputSource()==3) { // random generation ATH_MSG_DEBUG("Using random pixel distortions"); - writeCdo -> setVersion(m_version); + writeCdo -> setVersion(moduleData->getDistortionVersion()); ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this); rngWrapper->setSeed(name(),Gaudi::Hive::currentContext()); CLHEP::HepRandomEngine *rndmEngine = *rngWrapper; for (int i=0; i<nmodule_max; i++) { - float r1 = CLHEP::RandGaussZiggurat::shoot(rndmEngine,m_mean_R,m_RMS_R); - float r2 = CLHEP::RandGaussZiggurat::shoot(rndmEngine,r1,m_RMS_R/10.);//to implement a correlation between distortions on 2 sides of the module - float twist = CLHEP::RandGaussZiggurat::shoot(rndmEngine,m_mean_twist,m_RMS_twist); + float r1 = CLHEP::RandGaussZiggurat::shoot(rndmEngine,moduleData->getDistortionMeanR(),moduleData->getDistortionRMSR()); + float r2 = CLHEP::RandGaussZiggurat::shoot(rndmEngine,r1,moduleData->getDistortionRMSR()/10.);//to implement a correlation between distortions on 2 sides of the module + float twist = CLHEP::RandGaussZiggurat::shoot(rndmEngine,moduleData->getDistortionMeanTwist(),moduleData->getDistortionMeanTwist()); distortionMap[i].push_back(r1*CLHEP::meter); // convert to 1/mm distortionMap[i].push_back(r2*CLHEP::meter); // convert to 1/mm distortionMap[i].push_back(2.0*atan(twist)/CLHEP::degree); // convert to degree } } - else if (m_inputSource==4) { // read from database here + else if (moduleData->getDistortionInputSource()==4) { // read from database here + SG::ReadCondHandle<DetCondCFloat> readHandle(m_readKey); + const DetCondCFloat* readCdo = *readHandle; + if (readCdo==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object"); + return StatusCode::FAILURE; + } + // Get the validitiy range + ATH_MSG_DEBUG("Size of DetCondCFloat " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); + int version = 0; if (readCdo->tag()=="/Indet/PixelDist") { version = 0; // For reproducing bug in earlier versions for backward compatibility @@ -168,14 +170,14 @@ StatusCode PixelDistortionAlg::execute() { } writeCdo -> setDistortionMap(distortionMap); - if (m_write) { + if (moduleData->getDistortionWriteToFile()) { std::ofstream* outfile = new std::ofstream("output_distortion.txt"); for (int i=0; i<nmodule_max; i++) { if (distortionMap[i].size()) { - if (m_version==0) { + if (moduleData->getDistortionVersion()==0) { *outfile << m_pixelID->wafer_id(IdentifierHash(i)) << " " << distortionMap[i].at(0) << " " << distortionMap[i].at(1) << " " << distortionMap[i].at(2) << std::endl; } - else if (m_version>0) { + else if (moduleData->getDistortionVersion()>0) { *outfile << i << " " << distortionMap[i].at(0) << " " << distortionMap[i].at(1) << " " << distortionMap[i].at(2) << std::endl; } } diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.h index d42d7b61bc1..17fa99956bd 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDistortionAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelDistortionAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date December, 2019 + * @brief Store pixel distortion data in PixelDistortionData. + */ #ifndef PIXELDISTORTIONALG_H #define PIXELDISTORTIONALG_H @@ -11,6 +17,7 @@ #include "DetDescrConditions/DetCondCFloat.h" #include "StoreGate/WriteCondHandleKey.h" +#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelDistortionData.h" #include "InDetIdentifier/PixelID.h" @@ -19,8 +26,6 @@ #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" -#include "CLHEP/Units/SystemOfUnits.h" - class PixelDistortionAlg : public AthAlgorithm { public: PixelDistortionAlg(const std::string& name, ISvcLocator* pSvcLocator); @@ -30,53 +35,12 @@ class PixelDistortionAlg : public AthAlgorithm { virtual StatusCode execute() override; private: - /** @brief Flag controlling how module distortions are taken into account: - case 0 -----> No distorsions implemented; - case 1 -----> Set curvature (in 1/meter) and twist (in radiant) equal for all modules; - case 2 -----> Read curvatures and twists from textfile containing Survey data; - case 3 -----> Set curvature and twist from Gaussian random generator with mean and RMS coming from Survey data; - case 4 -----> Read curvatures and twists from database; - */ - Gaudi::Property<int> m_inputSource - {this, "InputSource", 4, "Source of module distortions: 0 (none), 1 (constant), 2 (text file), 3 (random), 4 (database)"}; - - Gaudi::Property<int> m_version - {this, "Version", 1, "Version number"}; - - Gaudi::Property<double> m_R1 - {this, "R1", 0.1/CLHEP::meter, "Fixed distortion parameters: radius of curvature"}; //corresponding to a sagitta of 50 um - - Gaudi::Property<double> m_R2 - {this, "R2", 0.1/CLHEP::meter, "Fixed distortion parameters: radius of curvature"}; //corresponding to a sagitta of 50 um - - Gaudi::Property<double> m_twist - {this, "tantwist", 0.0005,"Fixed distortion parameters: twist angle"}; - - Gaudi::Property<double> m_mean_R - {this, "Mean_R", 0.12/CLHEP::meter, "Random distortion parameters: Mean of radius of curvature"}; //Mean value from Survey - - Gaudi::Property<double> m_RMS_R - {this, "RMS_R", 0.08/CLHEP::meter, "Random distortion parameters: RMS of curvature radius"}; //RMS value from Survey - - Gaudi::Property<double> m_mean_twist - {this, "Mean_twist", -0.0005,"Random distortion parameters: Mean twist angle"}; //Mean value from Survey - - Gaudi::Property<double> m_RMS_twist - {this, "RMS_twist", 0.0008,"Random distortion parameters: RMS of twist angle"}; //RMS value from Survey - - Gaudi::Property<bool> m_write - {this, "WriteData", false, "Record data in storegate"}; - - Gaudi::Property<std::string> m_textFileName - {this, "TextFileName", "PixelSurveyDistortions.txt","Read distortions from this file"}; - - const PixelID* m_pixelID; - - ServiceHandle<IAthRNGSvc> m_rndmSvc - {this, "RndmSvc", "AthRNGSvc", ""}; //!< Random number service + const PixelID* m_pixelID{nullptr}; + ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc"}; //!< Random number service + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - ServiceHandle<ICondSvc> m_condSvc - {this, "CondSvc", "CondSvc", ""}; + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; SG::ReadCondHandleKey<DetCondCFloat> m_readKey {this, "ReadKey", "/Indet/PixelDist", "Input readout distortion folder"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.cxx index 5ff6401c0ad..eda30d55c9c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.cxx @@ -13,38 +13,37 @@ #include <istream> PixelHitDiscCnfgAlg::PixelHitDiscCnfgAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_condSvc("CondSvc", name), - m_defaultHitDiscCnfg(2) + ::AthReentrantAlgorithm(name, pSvcLocator) { - declareProperty("FEI4HitDiscConfig", m_defaultHitDiscCnfg); } StatusCode PixelHitDiscCnfgAlg::initialize() { ATH_MSG_DEBUG("PixelHitDiscCnfgAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); - + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - return StatusCode::SUCCESS; } -StatusCode PixelHitDiscCnfgAlg::execute() { +StatusCode PixelHitDiscCnfgAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelHitDiscCnfgAlg::execute()"); - SG::WriteCondHandle<PixelHitDiscCnfgData> writeHandle(m_writeKey); + SG::WriteCondHandle<PixelHitDiscCnfgData> writeHandle(m_writeKey, ctx); if (writeHandle.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey); + // Construct the output Cond Object and fill it in + std::unique_ptr<PixelHitDiscCnfgData> writeCdo(std::make_unique<PixelHitDiscCnfgData>()); + + SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey, ctx); const AthenaAttributeList* readCdo = *readHandle; if (readCdo==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); @@ -59,9 +58,6 @@ StatusCode PixelHitDiscCnfgAlg::execute() { ATH_MSG_DEBUG("Size of AthenaAttributeList " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); ATH_MSG_DEBUG("Range of input is " << rangeW); - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelHitDiscCnfgData> writeCdo(std::make_unique<PixelHitDiscCnfgData>()); - const coral::Blob& blob=(*readCdo)["HitDiscCnfgData"].data<coral::Blob>(); const uint32_t* p = static_cast<const uint32_t*>(blob.startingAddress()); @@ -104,8 +100,9 @@ StatusCode PixelHitDiscCnfgAlg::execute() { } } // Take average. - double aveHitPL = 1.0*m_defaultHitDiscCnfg; - double aveHit3D = 1.0*m_defaultHitDiscCnfg; + double aveHitPL = 1.0*SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getFEI4HitDiscConfig(0,0); + double aveHit3D = 1.0*SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getFEI4HitDiscConfig(0,0); + if (nhitPL) { aveHitPL = hitPL/(1.0*nhitPL); } if (nhit3D) { aveHit3D = hit3D/(1.0*nhit3D); } @@ -129,7 +126,3 @@ StatusCode PixelHitDiscCnfgAlg::execute() { return StatusCode::SUCCESS; } -StatusCode PixelHitDiscCnfgAlg::finalize() { - ATH_MSG_DEBUG("PixelHitDiscCnfgAlg::finalize()"); - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.h index f68793e3422..cdb463b0d8f 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelHitDiscCnfgAlg.h @@ -1,33 +1,41 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelHitDiscCnfgAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store FEI4 HitDiscCofig parameter in PixelHitDiscCnfgData. + */ #ifndef PIXELHITDISCCNFGALG_H #define PIXELHITDISCCNFGALG_H -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "StoreGate/WriteCondHandleKey.h" +#include "PixelConditionsData/PixelModuleData.h" #include "PixelConditionsData/PixelHitDiscCnfgData.h" #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" -class PixelHitDiscCnfgAlg : public AthAlgorithm { +class PixelHitDiscCnfgAlg : public AthReentrantAlgorithm { public: PixelHitDiscCnfgAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~PixelHitDiscCnfgAlg() = default; virtual StatusCode initialize() override; - virtual StatusCode execute() override; - virtual StatusCode finalize() override; + virtual StatusCode execute(const EventContext& ctx) const override; private: - ServiceHandle<ICondSvc> m_condSvc; - int m_defaultHitDiscCnfg; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; + + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; SG::ReadCondHandleKey<AthenaAttributeList> m_readKey {this, "ReadKey", "/PIXEL/HitDiscCnfg", "Input HitDiscCnfg folder"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.cxx index 35e8b642911..3f992ef2071 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.cxx @@ -10,14 +10,8 @@ #include <sstream> PixelOfflineCalibCondAlg::PixelOfflineCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthReentrantAlgorithm(name, pSvcLocator), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { - declareProperty("InputSource",m_inputSource=2,"Source of data: 0 (none), 1 (text file), 2 (database)"); - declareProperty("PixelClusterErrorDataFile", m_textFileName1="PixelClusterErrorData.txt","Read constants from this file"); - declareProperty("PixelClusterOnTrackErrorDataFile", m_textFileName2="PixelClusterOnTrackErrorData.txt","Read constants from this file"); - declareProperty("PixelChargeInterpolationDataFile", m_textFileName3="PixelChargeInterpolationData.txt","Read constants from this file"); - declareProperty("DumpConstants", m_dump=0, "Dump constants to text file"); } StatusCode PixelOfflineCalibCondAlg::initialize() { @@ -52,7 +46,7 @@ StatusCode PixelOfflineCalibCondAlg::execute(const EventContext& ctx) const { std::unique_ptr<PixelCalib::PixelOfflineCalibData> writeCdo(std::make_unique<PixelCalib::PixelOfflineCalibData>()); if (m_inputSource==0) { - ATH_MSG_WARNING("So far do nithing!! return StatusCode::FAILURE"); + ATH_MSG_WARNING("So far do nothing!! return StatusCode::FAILURE"); return StatusCode::FAILURE; } else if (m_inputSource==1) { @@ -159,8 +153,3 @@ StatusCode PixelOfflineCalibCondAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } -StatusCode PixelOfflineCalibCondAlg::finalize() { - ATH_MSG_DEBUG("PixelOfflineCalibCondAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.h index b631a865f2d..c2a600172ee 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelOfflineCalibCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelOfflineCalibCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel offline calibration data in PixelOfflineCalibData. + */ #ifndef PIXELOFFLINECALIBCONDALG #define PIXELOFFLINECALIBCONDALG @@ -23,14 +29,22 @@ class PixelOfflineCalibCondAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - int m_inputSource; - std::string m_textFileName1; - std::string m_textFileName2; - std::string m_textFileName3; - int m_dump; + Gaudi::Property<int> m_inputSource + {this, "InputSource",2,"Source of data: 0 (none), 1 (text file), 2 (database)"}; + + Gaudi::Property<std::string> m_textFileName1 + {this, "PixelClusterErrorDataFile", "PixelClusterErrorData.txt","Read constants from this file"}; + + Gaudi::Property<std::string> m_textFileName2 + {this, "PixelClusterOnTrackErrorDataFile", "PixelClusterOnTrackErrorData.txt","Read constants from this file"}; + + Gaudi::Property<std::string> m_textFileName3 + {this, "PixelChargeInterpolationDataFile", "PixelChargeInterpolationData.txt","Read constants from this file"}; + + Gaudi::Property<int> m_dump + {this, "DumpConstants", 0, "Dump constants to text file"}; SG::ReadCondHandleKey<DetCondCFloat> m_readKey {this, "ReadKey", "/PIXEL/PixReco", "Input key of pixreco conditions folder"}; @@ -38,7 +52,7 @@ class PixelOfflineCalibCondAlg : public AthReentrantAlgorithm { SG::WriteCondHandleKey<PixelCalib::PixelOfflineCalibData> m_writeKey {this, "WriteKey", "PixelOfflineCalibData", "Output key of pixel module data"}; - ServiceHandle<ICondSvc> m_condSvc; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; }; #endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.cxx index 253499ce13b..bfd7f0a8b79 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.cxx @@ -13,8 +13,7 @@ #include <istream> PixelReadoutSpeedAlg::PixelReadoutSpeedAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthAlgorithm(name, pSvcLocator), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { } @@ -33,16 +32,16 @@ StatusCode PixelReadoutSpeedAlg::initialize() { return StatusCode::SUCCESS; } -StatusCode PixelReadoutSpeedAlg::execute() { +StatusCode PixelReadoutSpeedAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("PixelReadoutSpeedAlg::execute()"); - SG::WriteCondHandle<PixelReadoutSpeedData> writeHandle(m_writeKey); + SG::WriteCondHandle<PixelReadoutSpeedData> writeHandle(m_writeKey, ctx); if (writeHandle.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey); + SG::ReadCondHandle<AthenaAttributeList> readHandle(m_readKey, ctx); const AthenaAttributeList* readCdo = *readHandle; if (readCdo==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); @@ -92,7 +91,3 @@ StatusCode PixelReadoutSpeedAlg::execute() { return StatusCode::SUCCESS; } -StatusCode PixelReadoutSpeedAlg::finalize() { - ATH_MSG_DEBUG("PixelReadoutSpeedAlg::finalize()"); - return StatusCode::SUCCESS; -} diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.h index 60388c7cfb9..afc8034ec6f 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelReadoutSpeedAlg.h @@ -1,11 +1,17 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelReadoutSpeedAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel FE link data in PixelReadoutSpeedData. + */ #ifndef PIXELREADOUTSPEEDALG_H #define PIXELREADOUTSPEEDALG_H -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" @@ -16,17 +22,16 @@ #include "GaudiKernel/ICondSvc.h" #include "GaudiKernel/Property.h" -class PixelReadoutSpeedAlg : public AthAlgorithm { +class PixelReadoutSpeedAlg : public AthReentrantAlgorithm { public: PixelReadoutSpeedAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~PixelReadoutSpeedAlg() = default; virtual StatusCode initialize() override; - virtual StatusCode execute() override; - virtual StatusCode finalize() override; + virtual StatusCode execute(const EventContext& ctx) const override; private: - ServiceHandle<ICondSvc> m_condSvc; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; SG::ReadCondHandleKey<AthenaAttributeList> m_readKey {this, "ReadKey", "/PIXEL/ReadoutSpeed", "Input readout speed folder"}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.cxx index a9aaad8641f..65c962e91d2 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.cxx @@ -19,7 +19,6 @@ StatusCode PixelSiliconConditionsTestAlg::initialize() ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKeyTemp.initialize()); ATH_CHECK(m_readKeyHV.initialize()); - ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_lorentzAngleTool.retrieve()); ATH_CHECK(m_chargeDataKey.initialize()); ATH_CHECK(m_distortionKey.initialize()); @@ -29,8 +28,8 @@ StatusCode PixelSiliconConditionsTestAlg::initialize() StatusCode PixelSiliconConditionsTestAlg::execute(){ - SG::ReadCondHandle<PixelModuleData> hv(m_readKeyHV); - SG::ReadCondHandle<PixelModuleData> temp(m_readKeyTemp); + SG::ReadCondHandle<PixelDCSHVData> hv(m_readKeyHV); + SG::ReadCondHandle<PixelDCSTempData> temp(m_readKeyTemp); SG::ReadCondHandle<PixelModuleData> deadmap(m_moduleDataKey); SG::ReadCondHandle<PixelChargeCalibCondData> calib(m_chargeDataKey); SG::ReadCondHandle<PixelDistortionData> distortion(m_distortionKey); diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.h index 41e6a8a7911..78cbb624f78 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelSiliconConditionsTestAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelSiliconConditionsTestAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Test algorithm to check the various contents from the Data. + */ #ifndef PIXELSILICONcONDITIONSTESTALG_H #define PIXELSILICONcONDITIONSTESTALG_H @@ -10,6 +16,8 @@ #include "GaudiKernel/ToolHandle.h" #include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSHVData.h" +#include "PixelConditionsData/PixelDCSTempData.h" #include "PixelConditionsData/PixelChargeCalibCondData.h" #include "PixelConditionsData/PixelDistortionData.h" #include "StoreGate/ReadCondHandleKey.h" @@ -28,10 +36,10 @@ class PixelSiliconConditionsTestAlg : public AthAlgorithm { SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey {this, "PixelModuleData", "PixelModuleData", "Output key"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyTemp + SG::ReadCondHandleKey<PixelDCSTempData> m_readKeyTemp {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyHV + SG::ReadCondHandleKey<PixelDCSHVData> m_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx index f6343a0404d..55f16fde569 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.cxx @@ -8,9 +8,7 @@ #include <sstream> PixelTDAQCondAlg::PixelTDAQCondAlg(const std::string& name, ISvcLocator* pSvcLocator): - ::AthReentrantAlgorithm(name, pSvcLocator), - m_pixelID(nullptr), - m_condSvc("CondSvc", name) + ::AthReentrantAlgorithm(name, pSvcLocator) { } @@ -21,6 +19,7 @@ StatusCode PixelTDAQCondAlg::initialize() { ATH_CHECK(m_condSvc.retrieve()); + ATH_CHECK(m_moduleDataKey.initialize()); ATH_CHECK(m_readKey.initialize()); ATH_CHECK(m_writeKey.initialize()); if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { @@ -33,45 +32,53 @@ StatusCode PixelTDAQCondAlg::initialize() { StatusCode PixelTDAQCondAlg::execute(const EventContext& ctx) const { ATH_MSG_INFO("PixelTDAQCondAlg::execute()"); - SG::WriteCondHandle<PixelModuleData> writeHandle(m_writeKey, ctx); + SG::WriteCondHandle<PixelTDAQData> writeHandle(m_writeKey, ctx); if (writeHandle.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order."); return StatusCode::SUCCESS; } - SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); - const CondAttrListCollection* readCdo = *readHandle; - if (readCdo==nullptr) { - ATH_MSG_FATAL("Null pointer to the read conditions object"); - return StatusCode::FAILURE; - } - // Get the validitiy range - EventIDRange rangeW; - if (not readHandle.range(rangeW)) { - ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); - ATH_MSG_INFO("Range of input is " << rangeW); - // Construct the output Cond Object and fill it in - std::unique_ptr<PixelModuleData> writeCdo(std::make_unique<PixelModuleData>()); - - // Read dead map info - std::vector<int> checkActive; - for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { - CondAttrListCollection::ChanNum channelNumber = attrList->first; - CondAttrListCollection::AttributeList payload = attrList->second; - checkActive.push_back((int)channelNumber-1); - } - - for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { - auto itr = std::find(checkActive.begin(),checkActive.end(),i); - if ((size_t)std::distance(checkActive.begin(),itr)==checkActive.size()) { writeCdo->setModuleStatus(i,1); } + std::unique_ptr<PixelTDAQData> writeCdo(std::make_unique<PixelTDAQData>()); + + const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, + 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, + EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM}; + + EventIDRange rangeW{start, stop}; + + if (SG::ReadCondHandle<PixelModuleData>(m_moduleDataKey,ctx)->getUseTDAQConditions()) { + SG::ReadCondHandle<CondAttrListCollection> readHandle(m_readKey, ctx); + const CondAttrListCollection* readCdo = *readHandle; + if (readCdo==nullptr) { + ATH_MSG_FATAL("Null pointer to the read conditions object"); + return StatusCode::FAILURE; + } + // Get the validitiy range + if (not readHandle.range(rangeW)) { + ATH_MSG_FATAL("Failed to retrieve validity range for " << readHandle.key()); + return StatusCode::FAILURE; + } + ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size()); + ATH_MSG_INFO("Range of input is " << rangeW); + + // Read dead map info + std::vector<int> checkActive; + for (CondAttrListCollection::const_iterator attrList=readCdo->begin(); attrList!=readCdo->end(); ++attrList) { + CondAttrListCollection::ChanNum channelNumber = attrList->first; + CondAttrListCollection::AttributeList payload = attrList->second; + checkActive.push_back((int)channelNumber-1); + } + + for (int i=0; i<(int)m_pixelID->wafer_hash_max(); i++) { + auto itr = std::find(checkActive.begin(),checkActive.end(),i); + if ((size_t)std::distance(checkActive.begin(),itr)==checkActive.size()) { writeCdo->setModuleStatus(i,1); } + } } if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) { - ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); + ATH_MSG_FATAL("Could not record PixelTDAQData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store"); return StatusCode::FAILURE; } ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << rangeW << " into Conditions Store"); @@ -79,8 +86,3 @@ StatusCode PixelTDAQCondAlg::execute(const EventContext& ctx) const { return StatusCode::SUCCESS; } -StatusCode PixelTDAQCondAlg::finalize() { - ATH_MSG_INFO("PixelTDAQCondAlg::finalize()"); - return StatusCode::SUCCESS; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h index a86395e104c..1285b56fae4 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelTDAQCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsAlgorithms/PixelTDAQCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel TDAQ module state to PixelTDAQData. + */ #ifndef PIXELTDAQCONDALG #define PIXELTDAQCONDALG @@ -12,6 +18,7 @@ #include "StoreGate/WriteCondHandleKey.h" #include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelTDAQData.h" #include "InDetIdentifier/PixelID.h" @@ -25,15 +32,20 @@ class PixelTDAQCondAlg : public AthReentrantAlgorithm { virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& ctx) const override; - virtual StatusCode finalize() override; private: - const PixelID* m_pixelID; + const PixelID* m_pixelID{nullptr}; + ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKey", "/TDAQ/Resources/ATLAS/PIXEL/Modules", "Input key of TDAQ deadmap conditions folder"}; - SG::WriteCondHandleKey<PixelModuleData> m_writeKey{this, "WriteKey", "PixelTDAQCondData", "Output key of pixel module data"}; + SG::ReadCondHandleKey<PixelModuleData> m_moduleDataKey + {this, "PixelModuleData", "PixelModuleData", "Pixel module data"}; + + SG::ReadCondHandleKey<CondAttrListCollection> m_readKey + {this, "ReadKey", "/TDAQ/Resources/ATLAS/PIXEL/Modules", "Input key of TDAQ deadmap conditions folder"}; + + SG::WriteCondHandleKey<PixelTDAQData> m_writeKey + {this, "WriteKey", "PixelTDAQCondData", "Output key of pixel module data"}; - ServiceHandle<ICondSvc> m_condSvc; }; -#endif // PIXELDEADMAPCONDALG +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/components/PixelConditionsAlgorithms_entries.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/components/PixelConditionsAlgorithms_entries.cxx index c7bbf02dfe1..c6efa6f0d5a 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/components/PixelConditionsAlgorithms_entries.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/components/PixelConditionsAlgorithms_entries.cxx @@ -1,5 +1,6 @@ #include "../PixelDCSCondHVAlg.h" #include "../PixelDCSCondTempAlg.h" +#include "../PixelDCSCondStatusAlg.h" #include "../PixelDCSCondStateAlg.h" #include "../PixelConfigCondAlg.h" #include "../PixelDeadMapCondAlg.h" @@ -17,6 +18,7 @@ DECLARE_COMPONENT( PixelDCSCondHVAlg ) DECLARE_COMPONENT( PixelDCSCondTempAlg ) +DECLARE_COMPONENT( PixelDCSCondStatusAlg ) DECLARE_COMPONENT( PixelDCSCondStateAlg ) DECLARE_COMPONENT( PixelConfigCondAlg ) DECLARE_COMPONENT( PixelDeadMapCondAlg ) diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibData.h deleted file mode 100755 index 0f79866c020..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibData.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// PixelCalibData.h, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -#ifndef PIXELCALIBDATA_H -#define PIXELCALIBDATA_H - -#include "AthenaKernel/CLASS_DEF.h" - -#include <algorithm> -#include <vector> -#include "Identifier/Identifier.h" -#include "Identifier/Identifier32.h" -#include "PixelCoralClientUtils/PixelCalibData.hh" - -/** @class PixelCalibData - - The PixelCalibData is a class that designed to hold the calibration data for each module that contains - 16 FE PixelChipSummaryData. The calibration data consist of threshold, timewalk information and Time over - threshold calibration that averages per FE chip. The details can be found at - https://twiki.cern.ch/twiki/bin/view/Atlas/PixelCOOLoffline#Calibrations - . - - @author Weiming Yao <WMYAO@LBL.GOV> -*/ - -namespace PixelCalib { - - - class PixelCalibData : public PixelCoralClientUtils::PixelCalibData { - - public: - /** Constructor:*/ - PixelCalibData(); - PixelCalibData(const Identifier & ident, int nmax); - PixelCalibData(Identifier & ident, int nmax); - - /** default destructor */ - ~PixelCalibData (); - - const Identifier& getModuleID() const; - - private: - Identifier m_id; //<! module identifier -}; - -//CLASS_DEF(PixelCalibData, 27089939, 1) - - -inline PixelCalibData::PixelCalibData() : - PixelCoralClientUtils::PixelCalibData(), - m_id(PixelCoralClientUtils::PixelCalibData::getModuleID()) -{ - -} - -inline PixelCalibData::PixelCalibData(const Identifier& ident,int nmax) - : - PixelCoralClientUtils::PixelCalibData(), - m_id(ident) - { - m_ident = m_id.get_identifier32().get_compact(); - m_nfeix = nmax; - } - -inline PixelCalibData::PixelCalibData(Identifier& ident,int nmax) - : - PixelCoralClientUtils::PixelCalibData(), - m_id(ident) - { - m_ident = m_id.get_identifier32().get_compact(); - m_nfeix = nmax; - } - - -//================ Destructor ================================================= -inline PixelCalibData::~PixelCalibData(){} - - -inline const Identifier& PixelCalibData::getModuleID() const { return m_id;} - -} -#endif - diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibDataColl.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibDataColl.h deleted file mode 100755 index 10610a91546..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelCalibDataColl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCALIBDATACOLL_H -#define PIXELCALIBDATACOLL_H -#include "AthContainers/DataVector.h" -#include "PixelConditionsData/PixelCalibData.h" -#include "AthenaKernel/CLASS_DEF.h" - -/** This typedef represents a collection of PixelCalibData objects. -It is a DataVector. It can be saved -to storegate and persistified using POOL */ - -typedef DataVector<PixelCalib::PixelCalibData> PixelCalibDataColl; - -CLASS_DEF(PixelCalibDataColl, 146316417, 1 ) - -#endif // PIXELCALIBDATACOLL_H - diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSData.h deleted file mode 100644 index 9f4cb9cfd17..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSData.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -//**************************************************************************** -// PixelDCSData.h -// -// Class that handles Pixel DCS data -// -// 09-13-2007 -// -// author Georges AAD <aad@cppm.in2p3.fr> -// -//**************************************************************************** - -#ifndef PIXEL_DSC_DATA_H -#define PIXEL_DSC_DATA_H - -#include <string> -#include <iostream> -#include "AthContainers/DataVector.h" -#include "AthenaKernel/CLASS_DEF.h" -#include "Identifier/Identifier.h" - -class PixelModuleDCSData; - -std::ostream& operator<<(std::ostream& out, const PixelModuleDCSData&); - -typedef DataVector<PixelModuleDCSData> PixelDCSData; - -class PixelModuleDCSData { - - public: - PixelModuleDCSData(); - explicit PixelModuleDCSData(const Identifier& ident); - explicit PixelModuleDCSData(Identifier& ident); - - ~PixelModuleDCSData(){}; - - void setModuleID(const Identifier& ident); - void setModuleID(Identifier& ident); - const Identifier& getModuleID() const; - - void setTemperature(float temp); - float getTemperature() const; - - void setHV(float hv); - float getHV() const; - - void setFSMStatus(std::string fsms); - const std::string& getFSMStatus() const; - - void setFSMState(std::string fsms); - const std::string& getFSMState() const; - - private: - Identifier m_ident; - - float m_temperature; - float m_hightVoltage; - std::string m_fsmStatus; - std::string m_fsmState; -}; - - -inline void PixelModuleDCSData::setModuleID(const Identifier& ident) { m_ident = ident; } - -inline void PixelModuleDCSData::setModuleID(Identifier& ident) { m_ident = ident; } - -inline const Identifier& PixelModuleDCSData::getModuleID() const { return m_ident; } - -inline void PixelModuleDCSData::setTemperature(float temp) { m_temperature = temp; } - -inline float PixelModuleDCSData::getTemperature() const { return m_temperature; } - -inline void PixelModuleDCSData::setHV(float hv) { m_hightVoltage = hv; } - -inline float PixelModuleDCSData::getHV() const { return m_hightVoltage; } - -inline void PixelModuleDCSData::setFSMStatus(std::string fsms) { m_fsmStatus = fsms; } - -inline const std::string& PixelModuleDCSData::getFSMStatus() const { return m_fsmStatus; } - -inline void PixelModuleDCSData::setFSMState(std::string fsms) { m_fsmState = fsms; } - -inline const std::string& PixelModuleDCSData::getFSMState() const { return m_fsmState; } - -CLASS_DEF(PixelModuleDCSData, 88201164, 1) -CLASS_DEF(PixelDCSData, 21396826, 1) - -#endif // PIXEL_DSC_DATA_H diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSHVData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSHVData.h new file mode 100644 index 00000000000..c9acc4bd8eb --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSHVData.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsData/PixelDCSHVData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel HV data in PixelDCSHVData. + */ + +#ifndef PIXELDCSHVDATA_H +#define PIXELDCSHVDATA_H + +#include "AthenaKernel/CLASS_DEF.h" +#include <unordered_map> + +#include "AthenaKernel/CondCont.h" + +class PixelDCSHVData { + public: + void setBiasVoltage(const int chanNum, const float value); + float getBiasVoltage(const int chanNum) const; + + private: + typedef std::unordered_map<int, float> FloatConditions; + FloatConditions m_biasVoltage; +}; + +CLASS_DEF( PixelDCSHVData , 345932813 , 1 ) + +CONDCONT_DEF( PixelDCSHVData, 578988313 ); + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStateData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStateData.h new file mode 100644 index 00000000000..9597c9eb4d6 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStateData.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsData/PixelDCSStateData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel DCS module state in PixelDCSStateData. + */ + +#ifndef PIXELDCSSTATEDATA_H +#define PIXELDCSSTATEDATA_H + +#include "AthenaKernel/CLASS_DEF.h" +#include <unordered_map> + +#include "AthenaKernel/CondCont.h" + +class PixelDCSStateData { + public: + void setModuleStatus(const int chanNum, const int value); + int getModuleStatus(const int chanNum) const; + + enum DCSModuleState{READY,ON,UNKNOWN,TRANSITION,UNDEFINED,NOSTATE}; + + private: + typedef std::unordered_map<int, int> IntConditions; + IntConditions m_moduleStatus; +}; + +CLASS_DEF( PixelDCSStateData , 345932855 , 1 ) + +CONDCONT_DEF( PixelDCSStateData, 578988355 ); + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStatusData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStatusData.h new file mode 100644 index 00000000000..7d6cb2a866e --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSStatusData.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsData/PixelDCSStatusData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel DCS module status in PixelDCSStatusData. + */ + +#ifndef PIXELDCSSTATUSDATA_H +#define PIXELDCSSTATUSDATA_H + +#include "AthenaKernel/CLASS_DEF.h" +#include <unordered_map> + +#include "AthenaKernel/CondCont.h" + +class PixelDCSStatusData { + public: + void setModuleStatus(const int chanNum, const int value); + int getModuleStatus(const int chanNum) const; + + enum DCSModuleStatus{OK,WARNING,ERROR,FATAL,NOSTATUS}; + + private: + typedef std::unordered_map<int, int> IntConditions; + IntConditions m_moduleStatus; +}; + +CLASS_DEF( PixelDCSStatusData , 345932844 , 1 ) + +CONDCONT_DEF( PixelDCSStatusData, 578988344 ); + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSTempData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSTempData.h new file mode 100644 index 00000000000..aa9f33df8b4 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelDCSTempData.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsData/PixelDCSTempData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel temperature data in PixelDCSTempData. + */ + +#ifndef PIXELDCSTEMPDATA_H +#define PIXELDCSTEMPDATA_H + +#include "AthenaKernel/CLASS_DEF.h" +#include <unordered_map> + +#include "AthenaKernel/CondCont.h" + +class PixelDCSTempData { + public: + void setTemperature(const int chanNum, const float value); + float getTemperature(const int chanNum) const; + + private: + typedef std::unordered_map<int, float> FloatConditions; + FloatConditions m_temperature; +}; + +CLASS_DEF( PixelDCSTempData , 345932822 , 1 ) + +CONDCONT_DEF( PixelDCSTempData, 578988322 ); + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h index a093094bac8..f9a0e096c39 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelModuleData.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsData/PixelModuleData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel constant parameters in PixelModuleData. + */ #ifndef PIXELMODULEDATA_H #define PIXELMODULEDATA_H @@ -8,27 +14,45 @@ #include "AthenaKernel/CLASS_DEF.h" #include <map> +#include "AthenaKernel/CondCont.h" + class PixelModuleData { public: PixelModuleData(); virtual ~PixelModuleData(); - void setBiasVoltage(const int chanNum, const float value); - float getBiasVoltage(const int chanNum) const; - - void setTemperature(const int chanNum, const float value); - float getTemperature(const int chanNum) const; - void setModuleStatus(const int chanNum, const int value); int getModuleStatus(const int chanNum) const; void setChipStatus(const int chanNum, const int value); int getChipStatus(const int chanNum) const; - enum DCSModuleStatus{OK,WARNING,ERROR,FATAL,NOSTATUS}; - enum DCSModuleState{READY,ON,UNKNOWN,TRANSITION,UNDEFINED,NOSTATE}; + // Switch parameters + void setUseCalibConditions(bool UseCalibConditions); + bool getUseCalibConditions() const; + + void setUseDeadmapConditions(bool UseDeadmapConditions); + bool getUseDeadmapConditions() const; + + void setUseDCSStateConditions(bool UseDCSStateConditions); + bool getUseDCSStateConditions() const; - // set via job option + void setUseDCSStatusConditions(bool UseDCSStatusConditions); + bool getUseDCSStatusConditions() const; + + void setUseDCSHVConditions(bool UseDCSHVConditions); + bool getUseDCSHVConditions() const; + + void setUseDCSTemperatureConditions(bool UseDCSTemperatureConditions); + bool getUseDCSTemperatureConditions() const; + + void setUseTDAQConditions(bool UseTDAQConditions); + bool getUseTDAQConditions() const; + + void setUseCablingConditions(bool UseCablingConditions); + bool getUseCablingConditions() const; + + // Digitization parameters void setBunchSpace(double bunchSpace); double getBunchSpace() const; @@ -53,9 +77,6 @@ class PixelModuleData { void setDBMTimeJitter(std::vector<double> DBMTimeJitter); double getTimeJitter(int bec, int layer) const; - void setUseCalibConditions(bool UseCalibConditions); - bool getUseCalibConditions() const; - void setDefaultBarrelAnalogThreshold(std::vector<int> BarrelAnalogThreshold); void setDefaultEndcapAnalogThreshold(std::vector<int> EndcapAnalogThreshold); void setDefaultDBMAnalogThreshold(std::vector<int> DBMAnalogThreshold); @@ -76,13 +97,6 @@ class PixelModuleData { void setDefaultDBMInTimeThreshold(std::vector<int> DBMInTimeThreshold); int getDefaultInTimeThreshold(int bec, int layer) const; - void setDefaultQ2TotA(float paramA); - void setDefaultQ2TotE(float paramE); - void setDefaultQ2TotC(float paramC); - float getDefaultQ2TotA() const; - float getDefaultQ2TotE() const; - float getDefaultQ2TotC() const; - void setBarrelToTThreshold(std::vector<int> BarrelToTThreshold); void setEndcapToTThreshold(std::vector<int> EndcapToTThreshold); void setDBMToTThreshold(std::vector<int> DBMToTThreshold); @@ -134,18 +148,80 @@ class PixelModuleData { int getFEI4HitDiscConfig(int bec, int layer) const; int getFEI4OverflowToT(int bec, int layer) const; + // Charge calibration parameters + void setDefaultQ2TotA(float paramA); + void setDefaultQ2TotE(float paramE); + void setDefaultQ2TotC(float paramC); + float getDefaultQ2TotA() const; + float getDefaultQ2TotE() const; + float getDefaultQ2TotC() const; + + // DCS parameters + void setDefaultBiasVoltage(float biasVoltage); + float getDefaultBiasVoltage() const; + + void setDefaultTemperature(float temperature); + float getDefaultTemperature() const; + + // Cabling parameters + void setCablingMapToFile(bool cablingMapToFile); + bool getCablingMapToFile() const; + + void setCablingMapFileName(std::string cablingMapFileName); + std::string getCablingMapFileName() const; + + // Distortion parameters + void setDistortionInputSource(int distortionInputSource); + int getDistortionInputSource() const; + + void setDistortionVersion(int distortionVersion); + int getDistortionVersion() const; + + void setDistortionR1(double distortionR1); + double getDistortionR1() const; + + void setDistortionR2(double distortionR2); + double getDistortionR2() const; + + void setDistortionTwist(double distortionTwist); + double getDistortionTwist() const; + + void setDistortionMeanR(double distortionMeanR); + double getDistortionMeanR() const; + + void setDistortionRMSR(double distortionRMSR); + double getDistortionRMSR() const; + + void setDistortionMeanTwist(double distortionMeanTwist); + double getDistortionMeanTwist() const; + + void setDistortionRMSTwist(double distortionRMSTwist); + double getDistortionRMSTwist() const; + + void setDistortionWriteToFile(bool distortionWriteToFile); + bool getDistortionWriteToFile() const; + + void setDistortionFileName(std::string distortionFileName); + std::string getDistortionFileName() const; + void clear(); private: - typedef std::map<int, float> FloatConditions; typedef std::map<int, int> IntConditions; - FloatConditions m_biasVoltage; - FloatConditions m_temperature; IntConditions m_moduleStatus; IntConditions m_chipStatus; typedef std::map<int, std::vector<float>> chipCharge; + bool m_useCalibConditions; + bool m_useDeadmapConditions; + bool m_useDCSStateConditions; + bool m_useDCSStatusConditions; + bool m_useDCSHVConditions; + bool m_useDCSTemperatureConditions; + bool m_useTDAQConditions; + bool m_useCablingConditions; + double m_bunchSpace; bool m_UseComTime; double m_ComTime; @@ -160,8 +236,6 @@ class PixelModuleData { std::vector<double> m_EndcapTimeJitter; std::vector<double> m_DBMTimeJitter; - bool m_useCalibConditions; - std::vector<int> m_defaultBarrelAnalogThreshold; std::vector<int> m_defaultEndcapAnalogThreshold; std::vector<int> m_defaultDBMAnalogThreshold; @@ -175,10 +249,6 @@ class PixelModuleData { std::vector<int> m_defaultEndcapInTimeThreshold; std::vector<int> m_defaultDBMInTimeThreshold; - float m_paramA; - float m_paramE; - float m_paramC; - std::vector<int> m_BarrelToTThreshold; std::vector<int> m_EndcapToTThreshold; std::vector<int> m_DBMToTThreshold; @@ -199,8 +269,8 @@ class PixelModuleData { chipCharge m_EndcapNoiseShape; chipCharge m_DBMNoiseShape; - std::vector<int> m_FEI3BarrelLatency; - std::vector<int> m_FEI3EndcapLatency; + std::vector<int> m_FEI3BarrelLatency; + std::vector<int> m_FEI3EndcapLatency; std::vector<bool> m_FEI3BarrelHitDuplication; std::vector<bool> m_FEI3EndcapHitDuplication; std::vector<int> m_FEI3BarrelSmallHitToT; @@ -210,11 +280,32 @@ class PixelModuleData { std::vector<int> m_FEI4BarrelHitDiscConfig; std::vector<int> m_FEI4EndcapHitDiscConfig; + float m_paramA; + float m_paramE; + float m_paramC; + + float m_biasVoltage; + float m_temperature; + + bool m_cablingMapToFile; + std::string m_cablingMapFileName; + + int m_distortionInputSource; + int m_distortionVersion; + double m_distortionR1; + double m_distortionR2; + double m_distortionTwist; + double m_distortionMeanR; + double m_distortionRMSR; + double m_distortionMeanTwist; + double m_distortionRMSTwist; + bool m_distortionWriteToFile; + std::string m_distortionFileName; + }; CLASS_DEF( PixelModuleData , 345932873 , 1 ) -#include "AthenaKernel/CondCont.h" CONDCONT_DEF( PixelModuleData, 578988393 ); #endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelTDAQData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelTDAQData.h new file mode 100644 index 00000000000..624d33fbca9 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelTDAQData.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/** + * @file PixelConditionsData/PixelTDAQData.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel TDAQ information to PixelTDAQData. + */ + +#ifndef PIXELTDAQDATA_H +#define PIXELTDAQDATA_H + +#include "AthenaKernel/CLASS_DEF.h" +#include <unordered_map> + +#include "AthenaKernel/CondCont.h" + +class PixelTDAQData { + public: + void setModuleStatus(const int chanNum, const int value); + int getModuleStatus(const int chanNum) const; + + private: + typedef std::unordered_map<int, int> IntConditions; + IntConditions m_moduleStatus; +}; + +CLASS_DEF( PixelTDAQData , 345932866 , 1 ) + +CONDCONT_DEF( PixelTDAQData, 578988366 ); + +#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelCalibData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelCalibData.cxx deleted file mode 100755 index 9c81c7716a2..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelCalibData.cxx +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// PixelCalibData.cxx, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -#include "PixelConditionsData/PixelCalibData.h" -#include <iostream> - -namespace PixelCalib{ - - // PixelCalibData::~PixelCalibData(){} - - -} // end of namespace diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSData.cxx deleted file mode 100644 index 56e2702fcf2..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSData.cxx +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include <iostream> -#include <iomanip> - -#include "PixelConditionsData/PixelDCSData.h" - - -std::ostream& operator<<(std::ostream& out, const PixelModuleDCSData& pmdscd) -{ - - out << std::setw(2) << "Module:" << std::setw(10) << pmdscd.getModuleID().get_compact() << std::endl - << std::setw(20) << "->Temperature:" << std::setw(10) << pmdscd.getTemperature() << std::endl - << std::setw(20) << "->HV :" << std::setw(10) << pmdscd.getHV() << std::endl - << std::setw(20) << "->FSM status :" << std::setw(10) << pmdscd.getFSMStatus() << std::endl - << std::setw(20) << "->FSM state :" << std::setw(10) << pmdscd.getFSMState() << std::endl; - - return out; - -} - -PixelModuleDCSData::PixelModuleDCSData(): m_ident(0), - m_temperature(-9999), - m_hightVoltage(-9999), - m_fsmStatus("NO_DATA"), - m_fsmState("NO_DATA") - -{ -} - -PixelModuleDCSData::PixelModuleDCSData(const Identifier& ident): m_ident(ident), - m_temperature(-9999), - m_hightVoltage(-9999), - m_fsmStatus("NO_DATA"), - m_fsmState("NO_DATA") - -{ -} - -PixelModuleDCSData::PixelModuleDCSData(Identifier& ident): m_ident(ident), - m_temperature(-9999), - m_hightVoltage(-9999), - m_fsmStatus("NO_DATA"), - m_fsmState("NO_DATA") - -{ -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSHVData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSHVData.cxx new file mode 100644 index 00000000000..7356790dee1 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSHVData.cxx @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelConditionsData/PixelDCSHVData.h" + +void PixelDCSHVData::setBiasVoltage(const int chanNum, const float value) { + m_biasVoltage[chanNum] = value; +} + +float PixelDCSHVData::getBiasVoltage(const int chanNum) const { + auto itr = m_biasVoltage.find(chanNum); + if (itr!=m_biasVoltage.end()) { return itr->second; } + return 0; +} + diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStateData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStateData.cxx new file mode 100644 index 00000000000..0528b1ee90b --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStateData.cxx @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelConditionsData/PixelDCSStateData.h" + +void PixelDCSStateData::setModuleStatus(const int chanNum, const int value) { + m_moduleStatus[chanNum] = value; +} + +int PixelDCSStateData::getModuleStatus(const int chanNum) const { + auto itr = m_moduleStatus.find(chanNum); + if (itr!=m_moduleStatus.end()) { return itr->second; } + return 0; +} + diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStatusData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStatusData.cxx new file mode 100644 index 00000000000..50beb73dfbd --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSStatusData.cxx @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelConditionsData/PixelDCSStatusData.h" + +void PixelDCSStatusData::setModuleStatus(const int chanNum, const int value) { + m_moduleStatus[chanNum] = value; +} + +int PixelDCSStatusData::getModuleStatus(const int chanNum) const { + auto itr = m_moduleStatus.find(chanNum); + if (itr!=m_moduleStatus.end()) { return itr->second; } + return 0; +} + diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSTemp.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSTemp.cxx new file mode 100644 index 00000000000..029709c74ad --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelDCSTemp.cxx @@ -0,0 +1,17 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelConditionsData/PixelDCSTempData.h" + +void PixelDCSTempData::setTemperature(const int chanNum, const float value) { + m_temperature[chanNum] = value; +} + +float PixelDCSTempData::getTemperature(const int chanNum) const { + auto itr = m_temperature.find(chanNum); + if (itr!=m_temperature.end()) { return itr->second; } + return -7.0; // this is temporaly fix +} + + diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx index b542c7aac5b..8418d74e105 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelModuleData.cxx @@ -5,8 +5,6 @@ #include "PixelConditionsData/PixelModuleData.h" PixelModuleData::PixelModuleData(): - m_biasVoltage(), - m_temperature(), m_moduleStatus(), m_chipStatus() { @@ -14,26 +12,6 @@ PixelModuleData::PixelModuleData(): PixelModuleData::~PixelModuleData() { } -void PixelModuleData::setBiasVoltage(const int chanNum, const float value) { - m_biasVoltage[chanNum] = value; -} - -float PixelModuleData::getBiasVoltage(const int chanNum) const { - auto itr = m_biasVoltage.find(chanNum); - if (itr!=m_biasVoltage.end()) { return itr->second; } - return 0; -} - -void PixelModuleData::setTemperature(const int chanNum, const float value) { - m_temperature[chanNum] = value; -} - -float PixelModuleData::getTemperature(const int chanNum) const { - auto itr = m_temperature.find(chanNum); - if (itr!=m_temperature.end()) { return itr->second; } - return -7.0; // this is temporaly fix -} - // Module status void PixelModuleData::setModuleStatus(const int chanNum, const int value) { m_moduleStatus[chanNum] = value; @@ -56,7 +34,32 @@ int PixelModuleData::getChipStatus(const int chanNum) const { return 0; } -// set via job option +// Switch parameters +void PixelModuleData::setUseCalibConditions(bool UseCalibConditions) { m_useCalibConditions = UseCalibConditions; } +bool PixelModuleData::getUseCalibConditions() const { return m_useCalibConditions; } + +void PixelModuleData::setUseDeadmapConditions(bool UseDeadmapConditions) { m_useDeadmapConditions = UseDeadmapConditions; } +bool PixelModuleData::getUseDeadmapConditions() const { return m_useDeadmapConditions; } + +void PixelModuleData::setUseDCSStateConditions(bool UseDCSStateConditions) { m_useDCSStateConditions = UseDCSStateConditions; } +bool PixelModuleData::getUseDCSStateConditions() const { return m_useDCSStateConditions; } + +void PixelModuleData::setUseDCSStatusConditions(bool UseDCSStatusConditions) { m_useDCSStatusConditions = UseDCSStatusConditions; } +bool PixelModuleData::getUseDCSStatusConditions() const { return m_useDCSStatusConditions; } + +void PixelModuleData::setUseDCSHVConditions(bool UseDCSHVConditions) { m_useDCSHVConditions = UseDCSHVConditions; } +bool PixelModuleData::getUseDCSHVConditions() const { return m_useDCSHVConditions; } + +void PixelModuleData::setUseDCSTemperatureConditions(bool UseDCSTemperatureConditions) { m_useDCSTemperatureConditions = UseDCSTemperatureConditions; } +bool PixelModuleData::getUseDCSTemperatureConditions() const { return m_useDCSTemperatureConditions; } + +void PixelModuleData::setUseTDAQConditions(bool UseTDAQConditions) { m_useTDAQConditions = UseTDAQConditions; } +bool PixelModuleData::getUseTDAQConditions() const { return m_useTDAQConditions; } + +void PixelModuleData::setUseCablingConditions(bool UseCablingConditions) { m_useCablingConditions = UseCablingConditions; } +bool PixelModuleData::getUseCablingConditions() const { return m_useCablingConditions; } + +// Digitization parameters void PixelModuleData::setBunchSpace(double bunchSpace) { m_bunchSpace = bunchSpace; } double PixelModuleData::getBunchSpace() const { return m_bunchSpace; } @@ -99,9 +102,6 @@ double PixelModuleData::getTimeJitter(int bec, int layer) const { return timeJitter; } -void PixelModuleData::setUseCalibConditions(bool UseCalibConditions) { m_useCalibConditions = UseCalibConditions; } -bool PixelModuleData::getUseCalibConditions() const { return m_useCalibConditions; } - void PixelModuleData::setDefaultBarrelAnalogThreshold(std::vector<int> BarrelAnalogThreshold) { m_defaultBarrelAnalogThreshold = BarrelAnalogThreshold; } void PixelModuleData::setDefaultEndcapAnalogThreshold(std::vector<int> EndcapAnalogThreshold) { m_defaultEndcapAnalogThreshold = EndcapAnalogThreshold; } void PixelModuleData::setDefaultDBMAnalogThreshold(std::vector<int> DBMAnalogThreshold) { m_defaultDBMAnalogThreshold = DBMAnalogThreshold; } @@ -150,13 +150,6 @@ int PixelModuleData::getDefaultInTimeThreshold(int bec, int layer) const { return analogInTimeThreshold; } -void PixelModuleData::setDefaultQ2TotA(float paramA) { m_paramA=paramA; } -void PixelModuleData::setDefaultQ2TotE(float paramE) { m_paramE=paramE; } -void PixelModuleData::setDefaultQ2TotC(float paramC) { m_paramC=paramC; } -float PixelModuleData::getDefaultQ2TotA() const { return m_paramA; } -float PixelModuleData::getDefaultQ2TotE() const { return m_paramE; } -float PixelModuleData::getDefaultQ2TotC() const { return m_paramC; } - void PixelModuleData::setBarrelToTThreshold(std::vector<int> BarrelToTThreshold) { m_BarrelToTThreshold = BarrelToTThreshold; } void PixelModuleData::setEndcapToTThreshold(std::vector<int> EndcapToTThreshold) { m_EndcapToTThreshold = EndcapToTThreshold; } void PixelModuleData::setDBMToTThreshold(std::vector<int> DBMToTThreshold) { m_DBMToTThreshold = DBMToTThreshold; } @@ -299,9 +292,63 @@ int PixelModuleData::getFEI4OverflowToT(int bec, int layer) const { return overflow[idx]; } +// Charge calibration parameters +void PixelModuleData::setDefaultQ2TotA(float paramA) { m_paramA=paramA; } +void PixelModuleData::setDefaultQ2TotE(float paramE) { m_paramE=paramE; } +void PixelModuleData::setDefaultQ2TotC(float paramC) { m_paramC=paramC; } +float PixelModuleData::getDefaultQ2TotA() const { return m_paramA; } +float PixelModuleData::getDefaultQ2TotE() const { return m_paramE; } +float PixelModuleData::getDefaultQ2TotC() const { return m_paramC; } + +// DCS parameters +void PixelModuleData::setDefaultBiasVoltage(float biasVoltage) { m_biasVoltage=biasVoltage; } +float PixelModuleData::getDefaultBiasVoltage() const { return m_biasVoltage; } + +void PixelModuleData::setDefaultTemperature(float temperature) { m_temperature=temperature; } +float PixelModuleData::getDefaultTemperature() const { return m_temperature; } + +// Cabling parameters +void PixelModuleData::setCablingMapToFile(bool cablingMapToFile) { m_cablingMapToFile = cablingMapToFile; } +bool PixelModuleData::getCablingMapToFile() const { return m_cablingMapToFile; } + +void PixelModuleData::setCablingMapFileName(std::string cablingMapFileName) { m_cablingMapFileName = cablingMapFileName; } +std::string PixelModuleData::getCablingMapFileName() const { return m_cablingMapFileName; } + +// Distortion parameters +void PixelModuleData::setDistortionInputSource(int distortionInputSource) { m_distortionInputSource = distortionInputSource; } +int PixelModuleData::getDistortionInputSource() const { return m_distortionInputSource; } + +void PixelModuleData::setDistortionVersion(int distortionVersion) { m_distortionVersion = distortionVersion; } +int PixelModuleData::getDistortionVersion() const { return m_distortionVersion; } + +void PixelModuleData::setDistortionR1(double distortionR1) { m_distortionR1 = distortionR1; } +double PixelModuleData::getDistortionR1() const { return m_distortionR1; } + +void PixelModuleData::setDistortionR2(double distortionR2) { m_distortionR2 = distortionR2; } +double PixelModuleData::getDistortionR2() const { return m_distortionR2; } + +void PixelModuleData::setDistortionTwist(double distortionTwist) { m_distortionTwist = distortionTwist; } +double PixelModuleData::getDistortionTwist() const { return m_distortionTwist; } + +void PixelModuleData::setDistortionMeanR(double distortionMeanR) { m_distortionMeanR = distortionMeanR; } +double PixelModuleData::getDistortionMeanR() const { return m_distortionMeanR; } + +void PixelModuleData::setDistortionRMSR(double distortionRMSR) { m_distortionRMSR = distortionRMSR; } +double PixelModuleData::getDistortionRMSR() const { return m_distortionRMSR; } + +void PixelModuleData::setDistortionMeanTwist(double distortionMeanTwist) { m_distortionMeanTwist = distortionMeanTwist; } +double PixelModuleData::getDistortionMeanTwist() const { return m_distortionMeanTwist; } + +void PixelModuleData::setDistortionRMSTwist(double distortionRMSTwist) { m_distortionRMSTwist = distortionRMSTwist; } +double PixelModuleData::getDistortionRMSTwist() const { return m_distortionRMSTwist; } + +void PixelModuleData::setDistortionWriteToFile(bool distortionWriteToFile) { m_distortionWriteToFile = distortionWriteToFile; } +bool PixelModuleData::getDistortionWriteToFile() const { return m_distortionWriteToFile; } + +void PixelModuleData::setDistortionFileName(std::string distortionFileName) { m_distortionFileName = distortionFileName; } +std::string PixelModuleData::getDistortionFileName() const { return m_distortionFileName; } + void PixelModuleData::clear() { - m_biasVoltage.clear(); - m_temperature.clear(); m_moduleStatus.clear(); m_chipStatus.clear(); } diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelTDAQData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelTDAQData.cxx new file mode 100644 index 00000000000..fdfed12c2ef --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelTDAQData.cxx @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PixelConditionsData/PixelTDAQData.h" + +void PixelTDAQData::setModuleStatus(const int chanNum, const int value) { + m_moduleStatus[chanNum] = value; +} + +int PixelTDAQData::getModuleStatus(const int chanNum) const { + auto itr = m_moduleStatus.find(chanNum); + if (itr!=m_moduleStatus.end()) { return itr->second; } + return 0; +} + diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelTDAQSvc.h b/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelTDAQSvc.h deleted file mode 100644 index 91f5f1190a1..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelTDAQSvc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -/* - * IPixelTDAQSvc.h - * - * Interface for PixelTDAQSvc - * Service to get the status of pixel modules from TDAQ - * - * georg@cern.ch - */ - - -#ifndef I_PIXEL_TDAQ_SVC_H -#define I_PIXEL_TDAQ_SVC_H - - -#include "GaudiKernel/IInterface.h" -#include "AthenaKernel/IOVSvcDefs.h" - - -class Identifier; -class IdentifierHash; - - -class IPixelTDAQSvc: virtual public IInterface{ - - public: - virtual ~IPixelTDAQSvc(){}; - static const InterfaceID& interfaceID(); - - virtual bool tdaq_module_enabled(const Identifier& moduleId) = 0; - virtual bool tdaq_module_enabled(const IdentifierHash & elementHash) = 0; -}; - - -inline const InterfaceID& IPixelTDAQSvc::interfaceID(){ - static const InterfaceID IID_IPixelTDAQSvc("IPixelTDAQSvc", 1, 0); - return IID_IPixelTDAQSvc; -} - -#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py index 2ce9ed70ac0..b8383518e87 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py +++ b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py @@ -4,31 +4,20 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders -PixelConditionsSummaryTool=CompFactory.PixelConditionsSummaryTool -PixelTDAQCondAlg=CompFactory.PixelTDAQCondAlg -from PixelConditionsTools.PixelDCSConditionsConfig import PixelDCSConditionsCfg -from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg + +from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, PixelTDAQCondAlgCfg +# NEW FOR RUN3 , PixelDeadMapCondAlgCfg +) def PixelConditionsSummaryCfg(flags, name="PixelConditionsSummary", **kwargs): """Return configured ComponentAccumulator with tool for Pixel Conditions""" acc = ComponentAccumulator() - kwargs.setdefault("UseDCSState", False) kwargs.setdefault("UseByteStream", False) - kwargs.setdefault("UseTDAQ", False) - kwargs.setdefault("UseDeadMap", True) - PixelDeadMapFolder = "/PIXEL/PixMapOverlay" - if kwargs["UseDCSState"]: - acc.merge(PixelDCSConditionsCfg(flags)) - if kwargs["UseTDAQ"]: - PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules" - acc.merge(addFolders(flags, PixelTDAQFolder, "TDAQ_ONL", "CondAttrListCollection")) - acc.addCondAlgo(PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey=PixelTDAQFolder)) - if kwargs["UseDeadMap"]: - acc.merge(addFolders(flags, PixelDeadMapFolder, "PIXEL_OFL","CondAttrListCollection")) - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixMapOverlay", - "/PIXEL/PixMapOverlay", "CondAttrListCollection")) - acc.merge(PixelConfigCondAlgCfg(flags, UseDeadMap=kwargs["UseDeadMap"], ReadDeadMapKey=PixelDeadMapFolder)) - acc.setPrivateTools(PixelConditionsSummaryTool(name=name + "Tool", **kwargs)) + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) +# NEW FOR RUN3 acc.merge(PixelDeadMapCondAlgCfg(flags)) + acc.merge(PixelTDAQCondAlgCfg(flags)) + acc.setPrivateTools(CompFactory.PixelConditionsSummaryTool(name=name + "Tool", **kwargs)) return acc diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py deleted file mode 100644 index b2bb74eadbb..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -class PixelConditionsSummaryToolSetup: - "Class to simplify setup of PixelConditionsSummaryTool and required conditions algorithms" - - def __init__(self): - self.toolName = "PixelConditionsSummaryTool" - self.tool = None - self.useConditions = True - self.useDCSState = False - self.useByteStream = False - self.useTDAQ = False - self.useDeadMap = True - - def setUseConditions(self, useConditions): - self.useConditions = useConditions - - def getUseConditions(self): - return self.useConditions - - def setUseDCSState(self, useDCSState): - self.useDCSState = useDCSState - - def getUseDCSState(self): - return self.useDCSState - - def setUseByteStream(self, useByteStream): - self.useByteStream = useByteStream - - def getUseByteStream(self): - return self.useByteStream - - def setUseTDAQ(self, useTDAQ): - self.useTDAQ = useTDAQ - - def getUseTDAQ(self): - return self.useTDAQ - - def setUseDeadMap(self, useDeadMap): - self.useDeadMap = useDeadMap - - def getUseDeadMap(self): - return self.useDeadMap - - def getTool(self): - return self.tool - - def getToolName(self): - return self.toolName - - def setToolName(self, toolName): - self.toolName = toolName - - def setTool(self): - from AthenaCommon.GlobalFlags import globalflags - from IOVDbSvc.CondDB import conddb - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - - if (self.useDCSState): - if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): - conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") - if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): - conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS", className="CondAttrListCollection") - - if not hasattr(condSeq, "PixelDCSCondStateAlg"): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg - condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") - - if (self.useTDAQ): - if not conddb.folderRequested("/TDAQ/Resources/ATLAS/PIXEL/Modules"): - conddb.addFolder("TDAQ_ONL", "/TDAQ/Resources/ATLAS/PIXEL/Modules", className="CondAttrListCollection") - - if not hasattr(condSeq, "PixelTDAQCondAlg"): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg - condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey="/TDAQ/Resources/ATLAS/PIXEL/Modules") - - if (self.useDeadMap): - if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): - conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay","/PIXEL/PixMapOverlay", className='CondAttrListCollection') - - if not hasattr(condSeq, "PixelConfigCondAlg"): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadMap=self.useDeadMap, - ReadDeadMapKey="/PIXEL/PixMapOverlay", - UseCalibConditions=True) - -# if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): -# conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") -# if not hasattr(condSeq, "PixelDeadMapCondAlg"): -# from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg -# condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") - - if self.tool is None: - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - self.tool = PixelConditionsSummaryTool(name=self.toolName, - UseDCSState=self.useDCSState, - UseByteStream=self.useByteStream, - UseTDAQ=self.useTDAQ, - UseDeadMap=self.useDeadMap) - - def setup(self): - self.setTool() - diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsConfig.py deleted file mode 100644 index b162e59325a..00000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsConfig.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Define methods to configure PixelDCSConditions - -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -""" -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.ComponentFactory import CompFactory -from IOVDbSvc.IOVDbSvcConfig import addFolders -PixelDCSCondStateAlg=CompFactory.PixelDCSCondStateAlg -PixelDCSCondHVAlg=CompFactory.PixelDCSCondHVAlg -PixelDCSCondTempAlg=CompFactory.PixelDCSCondTempAlg - -def PixelDCSConditionsCfg(flags, name="PixelDCSCond", **kwargs): - """Return configured ComponentAccumulator and tool for PixelDCSConditions""" - acc = ComponentAccumulator() - kwargs.setdefault("UseConditions", True) - if flags.Common.isOnline: - hvFolder = "/PIXEL/HLT/DCS/HV" - tempFolder = "/PIXEL/HLT/DCS/TEMPERATURE" - dbInstance = "PIXEL_ONL" - else: - hvFolder = "/PIXEL/DCS/HV" - tempFolder = "/PIXEL/DCS/TEMPERATURE" - dbInstance = "DCS_OFL" - folders = [hvFolder, tempFolder] - if not flags.Input.isMC: - folders.extend(["/PIXEL/DCS/FSMSTATE", "/PIXEL/DCS/FSMSTATUS"]) - acc.addCondAlgo(PixelDCSCondStateAlg(name=name + "StateAlg")) - acc.merge(addFolders(flags, folders, dbInstance, "CondAttrListCollection")) - acc.addCondAlgo(PixelDCSCondHVAlg(name=name + "HVAlg", ReadKey=hvFolder)) - acc.addCondAlgo(PixelDCSCondTempAlg(name=name + "TempAlg", ReadKey=tempFolder)) - return acc - diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx index bde856b4493..fdf9d215b11 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx @@ -7,20 +7,14 @@ PixelConditionsSummaryTool::PixelConditionsSummaryTool(const std::string& type, const std::string& name, const IInterface* parent) :AthAlgTool(type, name, parent), m_pixelID(nullptr), - m_useDCSState(false), - m_useByteStream(false), - m_useTDAQ(false), - m_useDeadMap(true) + m_useByteStream(false) { m_isActiveStatus.push_back("OK"); m_isActiveStates.push_back("READY"); declareProperty("IsActiveStatus", m_isActiveStatus); declareProperty("IsActiveStates", m_isActiveStates); - declareProperty("UseDCSState", m_useDCSState, "Switch for usage of DCS"); declareProperty("UseByteStream", m_useByteStream, "Switch for usage of the ByteStream error service"); - declareProperty("UseTDAQ", m_useTDAQ, "Switch for usage of TDAQ"); - declareProperty("UseDeadMap", m_useDeadMap, "Switch for usage of dead map"); } PixelConditionsSummaryTool::~PixelConditionsSummaryTool(){} @@ -30,10 +24,8 @@ StatusCode PixelConditionsSummaryTool::initialize(){ ATH_CHECK(setProperties()); - if (m_useDCSState) { - ATH_CHECK(m_condDCSStateKey.initialize()); - ATH_CHECK(m_condDCSStatusKey.initialize()); - } + ATH_CHECK(m_condDCSStateKey.initialize()); + ATH_CHECK(m_condDCSStatusKey.initialize()); #ifndef SIMULATIONBASE if (m_useByteStream) { ATH_CHECK(m_BSErrContReadKey.initialize()); } @@ -41,17 +33,16 @@ StatusCode PixelConditionsSummaryTool::initialize(){ ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); - if (m_useTDAQ) { ATH_CHECK(m_condTDAQKey.initialize()); } - - if (m_useDeadMap) { ATH_CHECK(m_condDeadMapKey.initialize()); } + ATH_CHECK(m_condTDAQKey.initialize()); + ATH_CHECK(m_condDeadMapKey.initialize()); for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { - if (m_isActiveStates[istate]=="READY") { m_activeState.push_back(PixelModuleData::DCSModuleState::READY); } - else if (m_isActiveStates[istate]=="ON") { m_activeState.push_back(PixelModuleData::DCSModuleState::ON); } - else if (m_isActiveStates[istate]=="UNKNOWN") { m_activeState.push_back(PixelModuleData::DCSModuleState::UNKNOWN); } - else if (m_isActiveStates[istate]=="TRANSITION") { m_activeState.push_back(PixelModuleData::DCSModuleState::TRANSITION); } - else if (m_isActiveStates[istate]=="UNDEFINED") { m_activeState.push_back(PixelModuleData::DCSModuleState::UNDEFINED); } - else if (m_isActiveStates[istate]=="NOSTATE") { m_activeState.push_back(PixelModuleData::DCSModuleState::NOSTATE); } + if (m_isActiveStates[istate]=="READY") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::READY); } + else if (m_isActiveStates[istate]=="ON") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::ON); } + else if (m_isActiveStates[istate]=="UNKNOWN") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNKNOWN); } + else if (m_isActiveStates[istate]=="TRANSITION") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::TRANSITION); } + else if (m_isActiveStates[istate]=="UNDEFINED") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNDEFINED); } + else if (m_isActiveStates[istate]=="NOSTATE") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::NOSTATE); } else { ATH_MSG_ERROR("No matching DCS state " << m_isActiveStates[istate] << " in DCSModuleState"); return StatusCode::FAILURE; @@ -59,11 +50,11 @@ StatusCode PixelConditionsSummaryTool::initialize(){ } for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) { - if (m_isActiveStatus[istatus]=="OK") { m_activeStatus.push_back(PixelModuleData::DCSModuleStatus::OK); } - else if (m_isActiveStatus[istatus]=="WARNING") { m_activeStatus.push_back(PixelModuleData::DCSModuleStatus::WARNING); } - else if (m_isActiveStatus[istatus]=="ERROR") { m_activeStatus.push_back(PixelModuleData::DCSModuleStatus::ERROR); } - else if (m_isActiveStatus[istatus]=="FATAL") { m_activeStatus.push_back(PixelModuleData::DCSModuleStatus::FATAL); } - else if (m_isActiveStatus[istatus]=="NOSTATUS") { m_activeStatus.push_back(PixelModuleData::DCSModuleStatus::NOSTATUS); } + if (m_isActiveStatus[istatus]=="OK") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::OK); } + else if (m_isActiveStatus[istatus]=="WARNING") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::WARNING); } + else if (m_isActiveStatus[istatus]=="ERROR") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::ERROR); } + else if (m_isActiveStatus[istatus]=="FATAL") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::FATAL); } + else if (m_isActiveStatus[istatus]=="NOSTATUS") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::NOSTATUS); } else { ATH_MSG_ERROR("No matching DCS status " << m_isActiveStatus[istatus] << " in DCSModuleStatus"); return StatusCode::FAILURE; @@ -131,41 +122,34 @@ bool PixelConditionsSummaryTool::isActive(const IdentifierHash & moduleHash) con if (m_useByteStream && !isBSActive(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } } + if (!isDCSActive) { return false; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } return true; } -bool PixelConditionsSummaryTool::isActive(const IdentifierHash & moduleHash, - const Identifier & /*elementId*/) const -{ +bool PixelConditionsSummaryTool::isActive(const IdentifierHash & moduleHash, const Identifier & /*elementId*/) const { + if (m_useByteStream && !isBSActive(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } } + if (!isDCSActive) { return false; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } return true; } @@ -185,26 +169,23 @@ bool PixelConditionsSummaryTool::isGood(const Identifier & elementId, if (m_useByteStream && !isBSError(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } + } + if (!isDCSActive) { return false; } - SG::ReadCondHandle<PixelModuleData> dcsstatus_data(m_condDCSStatusKey); - bool isDCSGood = false; - for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { - if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } - } - if (!isDCSGood) { return false; } + SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey); + bool isDCSGood = false; + for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { + if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } } + if (!isDCSGood) { return false; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } return true; } @@ -213,26 +194,23 @@ bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash) const if (m_useByteStream && !isBSError(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } + } + if (!isDCSActive) { return false; } - SG::ReadCondHandle<PixelModuleData> dcsstatus_data(m_condDCSStatusKey); - bool isDCSGood = false; - for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { - if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } - } - if (!isDCSGood) { return false; } + SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey); + bool isDCSGood = false; + for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { + if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } } + if (!isDCSGood) { return false; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } return true; } @@ -240,28 +218,26 @@ bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash) const bool PixelConditionsSummaryTool::isGood(const IdentifierHash & moduleHash, const Identifier & /*elementId*/) const { + if (m_useByteStream && !isBSError(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } + } + if (!isDCSActive) { return false; } - SG::ReadCondHandle<PixelModuleData> dcsstatus_data(m_condDCSStatusKey); - bool isDCSGood = false; - for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { - if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } - } - if (!isDCSGood) { return false; } + SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey); + bool isDCSGood = false; + for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { + if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } } + if (!isDCSGood) { return false; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return false; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return false; } return true; } @@ -270,28 +246,26 @@ double PixelConditionsSummaryTool::goodFraction(const IdentifierHash & moduleHas const Identifier & /*idStart*/, const Identifier & /*idEnd*/) const { + if (m_useByteStream && !isBSError(moduleHash)) { return false; } - if (m_useDCSState) { - SG::ReadCondHandle<PixelModuleData> dcsstate_data(m_condDCSStateKey); - bool isDCSActive = false; - for (unsigned int istate=0; istate<m_activeState.size(); istate++) { - if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } - } - if (!isDCSActive) { return false; } + SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey); + bool isDCSActive = false; + for (unsigned int istate=0; istate<m_activeState.size(); istate++) { + if (m_activeState[istate]==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; } + } + if (!isDCSActive) { return false; } - SG::ReadCondHandle<PixelModuleData> dcsstatus_data(m_condDCSStatusKey); - bool isDCSGood = false; - for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { - if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } - } - if (!isDCSGood) { return 0.0; } + SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey); + bool isDCSGood = false; + for (unsigned int istatus=0; istatus<m_activeStatus.size(); istatus++) { + if (m_activeStatus[istatus]==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; } } + if (!isDCSGood) { return 0.0; } - if (m_useTDAQ && SG::ReadCondHandle<PixelModuleData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return 1.0; } + if (SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey)->getModuleStatus(moduleHash)) { return 1.0; } - if (m_useDeadMap && SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return 1.0; } -// if (m_useDeadMap && SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return 1.0; } + if (SG::ReadCondHandle<PixelModuleData>(m_condDeadMapKey)->getModuleStatus(moduleHash)) { return 1.0; } // TODO!!! Calculate active fraction from dead map. diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h index 4c90a2f3cec..916df3458c6 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file PixelConditionsTools/PixelConditionsSummaryTool.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Return pixel module/FE status. + */ #ifndef PIXELCONDITIONSSERVICES_PIXELCONDITIONSSUMMARYTOOL_H #define PIXELCONDITIONSSERVICES_PIXELCONDITIONSSUMMARYTOOL_H @@ -20,6 +26,9 @@ #include "PixelConditionsData/PixelModuleData.h" //#include "PixelConditionsData/PixelDeadMapCondData.h" +#include "PixelConditionsData/PixelDCSStateData.h" +#include "PixelConditionsData/PixelDCSStatusData.h" +#include "PixelConditionsData/PixelTDAQData.h" #include "StoreGate/ReadCondHandleKey.h" class PixelConditionsSummaryTool: public AthAlgTool, public IInDetConditionsTool{ @@ -51,18 +60,15 @@ class PixelConditionsSummaryTool: public AthAlgTool, public IInDetConditionsTool std::vector<int> m_activeState; std::vector<int> m_activeStatus; - bool m_useDCSState; bool m_useByteStream; - bool m_useTDAQ; - bool m_useDeadMap; - SG::ReadCondHandleKey<PixelModuleData> m_condDCSStateKey + SG::ReadCondHandleKey<PixelDCSStateData> m_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}; - SG::ReadCondHandleKey<PixelModuleData> m_condDCSStatusKey + SG::ReadCondHandleKey<PixelDCSStatusData> m_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}; - SG::ReadCondHandleKey<PixelModuleData> m_condTDAQKey + SG::ReadCondHandleKey<PixelTDAQData> m_condTDAQKey {this, "PixelTDAQCondData", "PixelTDAQCondData", "Pixel TDAQ conditions key"}; SG::ReadCondHandleKey<PixelModuleData> m_condDeadMapKey diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py index 2849fe50c43..3423ea4dd07 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py @@ -6,9 +6,13 @@ from SiPropertiesTool.PixelSiPropertiesConfig import PixelSiPropertiesCfg from AthenaConfiguration.ComponentFactory import CompFactory SiLorentzAngleTool=CompFactory.SiLorentzAngleTool PixelSiLorentzAngleCondAlg=CompFactory.PixelSiLorentzAngleCondAlg -from PixelConditionsTools.PixelDCSConditionsConfig import PixelDCSConditionsCfg from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg +from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelDCSCondHVAlgCfg, PixelDCSCondTempAlgCfg, + PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg +) + def PixelLorentzAngleToolCfg(flags, name="PixelLorentzAngleTool", **kwargs): """Return a SiLorentzAngleTool configured for Pixel""" kwargs.setdefault("DetectorName", "Pixel") @@ -23,9 +27,10 @@ def PixelLorentzAngleCfg(flags, name="PixelSiLorentzAngleCondAlg", **kwargs): """ acc = MagneticFieldSvcCfg(flags) tool = kwargs.get("SiLorentzAngleTool", PixelLorentzAngleToolCfg(flags)) - DCSCondAcc = PixelDCSConditionsCfg(flags) - DCSCondAcc.popPrivateTools() - acc.merge(DCSCondAcc) + acc.merge(PixelDCSCondHVAlgCfg(flags)) + acc.merge(PixelDCSCondTempAlgCfg(flags)) + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) SiPropAcc = PixelSiPropertiesCfg(flags) kwargs.setdefault("SiPropertiesTool", SiPropAcc.popPrivateTools()) acc.merge(SiPropAcc) diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py index f9f0e2b6d0e..bb6da3d8e81 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleToolSetup.py @@ -25,11 +25,11 @@ class PixelLorentzAngleToolSetup: if not hasattr(condSeq,"PixelDCSCondHVAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg - condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey=hvFolder, UseConditions=True) + condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey=hvFolder) if not hasattr(condSeq,"PixelDCSCondTempAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg - condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=tempFolder, UseConditions=True) + condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=tempFolder) if not hasattr(condSeq, "PixelSiPropertiesCondAlg"): from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx index fc0565a6406..bb6dc195d98 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.cxx @@ -76,8 +76,8 @@ PixelSiLorentzAngleCondAlg::execute() { EventIDRange rangeBField{eidStart, eidStop}; // Read Cond Handle (temperature) - SG::ReadCondHandle<PixelModuleData> readHandleTemp(m_readKeyTemp); - const PixelModuleData* readCdoTemp(*readHandleTemp); + SG::ReadCondHandle<PixelDCSTempData> readHandleTemp(m_readKeyTemp); + const PixelDCSTempData* readCdoTemp(*readHandleTemp); if (readCdoTemp==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; @@ -91,8 +91,8 @@ PixelSiLorentzAngleCondAlg::execute() { ATH_MSG_DEBUG("Input is " << readHandleTemp.fullKey() << " with the range of " << rangeTemp); // Read Cond Handle (HV) - SG::ReadCondHandle<PixelModuleData> readHandleHV(m_readKeyHV); - const PixelModuleData* readCdoHV(*readHandleHV); + SG::ReadCondHandle<PixelDCSHVData> readHandleHV(m_readKeyHV); + const PixelDCSHVData* readCdoHV(*readHandleHV); if (readCdoHV==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h index 77952eb387b..63e9def527f 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h +++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/src/PixelSiLorentzAngleCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file SiLorentzAngleTool/PixelSiLorentzAngleCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Return Lorentz angle information for pixel. + */ #ifndef PIXELSILORENTZANGLECONDALG #define PIXELSILORENTZANGLECONDALG @@ -12,7 +18,8 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "GeoPrimitives/GeoPrimitives.h" #include "InDetReadoutGeometry/SiDetectorElementCollection.h" -#include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSHVData.h" +#include "PixelConditionsData/PixelDCSTempData.h" #include "GaudiKernel/ICondSvc.h" #include "SiPropertiesTool/ISiPropertiesTool.h" @@ -38,14 +45,23 @@ class PixelSiLorentzAngleCondAlg: public AthAlgorithm { ServiceHandle<ICondSvc> m_condSvc; ServiceHandle<MagField::IMagFieldSvc> m_magFieldSvc; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyTemp{this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; - SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyBFieldSensor{this, "ReadKeyBFieldSensor", "/EXT/DCS/MAGNETS/SENSORDATA", "Key of input B-field sensor"}; - SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; + SG::ReadCondHandleKey<PixelDCSTempData> m_readKeyTemp + {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; - SG::WriteCondHandleKey<SiLorentzAngleCondData> m_writeKey{this, "WriteKey", "PixelSiLorentzAngleCondData", "Key of output SiLorentzAngleCondData"}; + SG::ReadCondHandleKey<PixelDCSHVData> m_readKeyHV + {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; - ToolHandle<ISiPropertiesTool> m_siPropertiesTool{this, "SiPropertiesTool", "SiPropertiesTool", "Tool to retrieve SiProperties"}; + SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyBFieldSensor + {this, "ReadKeyBFieldSensor", "/EXT/DCS/MAGNETS/SENSORDATA", "Key of input B-field sensor"}; + + SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey + {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; + + SG::WriteCondHandleKey<SiLorentzAngleCondData> m_writeKey + {this, "WriteKey", "PixelSiLorentzAngleCondData", "Key of output SiLorentzAngleCondData"}; + + ToolHandle<ISiPropertiesTool> m_siPropertiesTool + {this, "SiPropertiesTool", "SiPropertiesTool", "Tool to retrieve SiProperties"}; // Properties double m_nominalField; @@ -56,4 +72,4 @@ class PixelSiLorentzAngleCondAlg: public AthAlgorithm { Amg::Vector3D getMagneticField(const InDetDD::SiDetectorElement* element) const; }; -#endif // PIXELSILORENTZANGLECONDALG +#endif diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py index 8af3b93f645..0101f2bcaed 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py +++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py @@ -2,11 +2,16 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ -from PixelConditionsTools.PixelDCSConditionsConfig import PixelDCSConditionsCfg +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory SiPropertiesTool=CompFactory.SiPropertiesTool PixelSiPropertiesCondAlg=CompFactory.PixelSiPropertiesCondAlg +from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelDCSCondHVAlgCfg, PixelDCSCondTempAlgCfg, + PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg +) + def PixelSiPropertiesToolCfg(flags, name="PixelSiPropertiesTool", **kwargs): """Return a SiPropertiesTool configured for Pixel""" kwargs.setdefault("DetectorName", "Pixel") @@ -18,7 +23,11 @@ def PixelSiPropertiesCfg(flags, name="PixelSiPropertiesCondAlg", **kwargs): SiPropertiesTool may be provided in kwargs """ - acc = PixelDCSConditionsCfg(flags) + acc = ComponentAccumulator() + acc.merge(PixelDCSCondHVAlgCfg(flags)) + acc.merge(PixelDCSCondTempAlgCfg(flags)) + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) tool = kwargs.get("SiPropertiesTool", PixelSiPropertiesToolCfg(flags)) acc.addCondAlgo(PixelSiPropertiesCondAlg(name, **kwargs)) acc.setPrivateTools(tool) diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py index 76531152b44..d72aca0715c 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py +++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py @@ -50,11 +50,11 @@ class PixelSiPropertiesToolSetup: if not hasattr(condSeq,"PixelDCSCondHVAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg - condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey=hvFolder, UseConditions=True) + condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey=hvFolder) if not hasattr(condSeq,"PixelDCSCondTempAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg - condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=tempFolder, UseConditions=True) + condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=tempFolder) from AthenaCommon.AppMgr import ToolSvc if not hasattr(condSeq, "PixelSiPropertiesCondAlg"): diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx index a40a7c513d2..d1db4145432 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx +++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx @@ -45,8 +45,8 @@ StatusCode PixelSiPropertiesCondAlg::execute() { } // Read Cond Handle (temperature) - SG::ReadCondHandle<PixelModuleData> readHandleTemp(m_readKeyTemp); - const PixelModuleData* readCdoTemp(*readHandleTemp); + SG::ReadCondHandle<PixelDCSTempData> readHandleTemp(m_readKeyTemp); + const PixelDCSTempData* readCdoTemp(*readHandleTemp); if (readCdoTemp==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; @@ -59,8 +59,8 @@ StatusCode PixelSiPropertiesCondAlg::execute() { ATH_MSG_INFO("Input is " << readHandleTemp.fullKey() << " with the range of " << rangeTemp); // Read Cond Handle (HV) - SG::ReadCondHandle<PixelModuleData> readHandleHV(m_readKeyHV); - const PixelModuleData* readCdoHV(*readHandleHV); + SG::ReadCondHandle<PixelDCSHVData> readHandleHV(m_readKeyHV); + const PixelDCSHVData* readCdoHV(*readHandleHV); if (readCdoHV==nullptr) { ATH_MSG_FATAL("Null pointer to the read conditions object"); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h index 5e674d62df4..3a75f6519ce 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h +++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file SiPropertiesTool/PixelSiPropertiesCondAlg.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Return pixel property. + */ #ifndef PIXELSIPROPERTIESCONDALG #define PIXELSIPROPERTIESCONDALG @@ -9,7 +15,8 @@ #include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h" -#include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSHVData.h" +#include "PixelConditionsData/PixelDCSTempData.h" #include "GaudiKernel/ICondSvc.h" #include "SiPropertiesTool/SiliconPropertiesVector.h" @@ -29,11 +36,17 @@ class PixelSiPropertiesCondAlg : public AthAlgorithm { ServiceHandle<ICondSvc> m_condSvc; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyTemp {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; - SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; - SG::WriteCondHandleKey<InDet::SiliconPropertiesVector> m_writeKey{this, "WriteKey", "PixelSiliconPropertiesVector", "Key of output silicon properties conditions folder"}; + SG::ReadCondHandleKey<PixelDCSTempData> m_readKeyTemp + {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; + SG::ReadCondHandleKey<PixelDCSHVData> m_readKeyHV + {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; + + SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey + {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; + + SG::WriteCondHandleKey<InDet::SiliconPropertiesVector> m_writeKey + {this, "WriteKey", "PixelSiliconPropertiesVector", "Key of output silicon properties conditions folder"}; }; -#endif // PIXELSIPROPERTIESCONDALG +#endif diff --git a/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfig.py b/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfig.py deleted file mode 100644 index 95cbabda6e2..00000000000 --- a/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfig.py +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon import CfgMgr - -def getPixelCablingSvc(name="PixelCablingSvc", **kwargs): - from AthenaCommon.Logging import logging - logger = logging.getLogger("PixelCablingSvc") - from IOVDbSvc.CondDB import conddb - from AthenaCommon.GlobalFlags import globalflags - from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags - from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - - if not conddb.folderRequested("/PIXEL/ReadoutSpeed"): - if not (globalflags.DataSource() == 'geant4'): - conddb.addFolder("PIXEL", "/PIXEL/ReadoutSpeed", className="AthenaAttributeList") - else: - conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList") - - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg - pixelCablingArgs = {} - pixelCablingArgs['UseConditions']=False - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" - pixelCablingArgs['RodIDForSingleLink40']=0 - pixelCablingArgs['DumpMapToFile']=False - - if (conddb.dbdata=="CONDBR2" or (conddb.dbmc=="OFLP200" and geoFlags.isIBL()==True)) and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): - conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList") - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg - condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg") - - # SIMULATION - if (globalflags.DataSource() == 'geant4'): - logger.debug("Running on simulation") - - pixelCablingArgs['UseConditions']=False - pixelCablingArgs['RodIDForSingleLink40']=0 - - # ITk: - if geoFlags.isSLHC(): - IdMappingDat = "ITk_Atlas_IdMapping.dat" - if "BrlIncl4.0_ref" == commonGeoFlags.GeoType(): - IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" - elif "IBrlExt4.0ref" == commonGeoFlags.GeoType(): - IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" - elif "BrlExt4.0_ref" == commonGeoFlags.GeoType(): - IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" - elif "BrlExt3.2_ref" == commonGeoFlags.GeoType(): - IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" - logger.info("Using ITk pixel mapping: %s" % IdMappingDat) - pixelCablingArgs['MappingFile']=IdMappingDat - - - # No IBL - elif (geoFlags.isIBL() == False): - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping.dat" - - else: - # Planar IBL - if (geoFlags.IBLLayout() == "planar"): - - # DBM or not - if (geoFlags.isDBM() == True): - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" - else: - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" - - # Hybrid IBL plus DBM - elif (geoFlags.IBLLayout() == "3D"): - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" - - elif (geoFlags.IBLLayout() == "UNDEFINED"): - logger.warning("Got GeometryFlags.isIBL = True, but IBLLayout is UNDEFINED") - logger.warning("Pixel cabling map cannot be set at this point") - - - # DATA - elif (globalflags.DataSource == 'data'): - - from RecExConfig.AutoConfiguration import GetRunNumber - runNum = GetRunNumber() - logger.debug("Running on data, run number %d" % runNum) - - # For data older than run number 222222, use the appropriate text file - if (runNum < 222222): - pixelCablingArgs['UseConditions']=False - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - pixelCablingArgs['RodIDForSingleLink40']=1300000 - - # For Run-2 onwards, get cabling map from database - else: - if not conddb.folderRequested("/PIXEL/CablingMap"): - conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList") - pixelCablingArgs['UseConditions']=True - pixelCablingArgs['RodIDForSingleLink40']=1300000 - - # Even though we are reading from COOL, set the correct fallback map. - if (runNum >= 344494): - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" - elif (runNum >= 314940 and runNum < 344494): - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_314940.dat" - elif (runNum >= 289350 and runNum < 314940): # 2016 - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" - elif (runNum >= 222222 and runNum < 289350): # 2015 - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" - else: - pixelCablingArgs['MappingFile']="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - - # Unknown input - else: - logger.warning("Unknown input source. Pixel cabling map cannot be set at this point") - - condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg") - condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", **pixelCablingArgs) - - return CfgMgr.PixelCablingSvc(name, **kwargs) diff --git a/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfigNew.py b/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfigNew.py index 1f0894abcc6..46d0d96ab0f 100644 --- a/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfigNew.py +++ b/InnerDetector/InDetDetDescr/PixelCabling/python/PixelCablingConfigNew.py @@ -4,121 +4,16 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from AthenaCommon.Logging import logging -from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders -PixelCablingSvc=CompFactory.PixelCablingSvc -PixelReadoutSpeedAlg=CompFactory.PixelReadoutSpeedAlg -PixelCablingCondAlg=CompFactory.PixelCablingCondAlg -PixelHitDiscCnfgAlg=CompFactory.PixelHitDiscCnfgAlg +from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelCablingCondAlgCfg, PixelHitDiscCnfgAlgCfg, PixelReadoutSpeedAlgCfg +) def PixelCablingSvcCfg(flags, name="PixelCablingSvc", **kwargs): """Return a ComponentAccumulator with configured PixelCablingSvc""" acc = ComponentAccumulator() - logger = logging.getLogger("PixelCablingSvc") - - if flags.Input.isMC: - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/ReadoutSpeed", "/PIXEL/ReadoutSpeed", className="AthenaAttributeList")) - else: - acc.merge(addFolders(flags, "/PIXEL/ReadoutSpeed", "PIXEL", className="AthenaAttributeList")) - - # default arguments for PixelCablingCondAlg - AlgKwargs = {} - AlgKwargs["UseConditions"] = False - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_2016.dat" - AlgKwargs["RodIDForSingleLink40"] = 0 - AlgKwargs["DumpMapToFile"] = False - - # Add the HitDiscCnfg folder - if (flags.IOVDb.DatabaseInstance == "CONDBR2") or (flags.Input.isMC and flags.GeoModel.Run == "RUN2"): - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/HitDiscCnfg", "/PIXEL/HitDiscCnfg", className="AthenaAttributeList")) - acc.addCondAlgo(PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")) - - # Online mode - if flags.Common.isOnline: - logger.debug("Running in online mode") - # Request the CablingMap folder - # (COOL is the default mapping type) - if flags.IOVDb.DatabaseInstance == "CONDBR2": - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) - logger.debug("Requested CablingMap folder") - - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_344494.dat" - AlgKwargs["RodIDForSingleLink40"] = 1300000 - - # Offline mode - else: - logger.debug("Running in offline mode") - # SIMULATION - if flags.Input.isMC: - logger.debug("Running on simulation") - - AlgKwargs["RodIDForSingleLink40"] = 0 - - # ITk: - if flags.GeoModel.Run == "RUN4": - IdMappingDat = "ITk_Atlas_IdMapping.dat" - if flags.GeoModel.Type == "BrlIncl4.0_ref": - IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" - elif flags.GeoModel.Type == "IBrlExt4.0ref": - IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" - elif flags.GeoModel.Type == "BrlExt4.0_ref": - IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" - elif flags.GeoModel.Type == "BrlExt3.2_ref": - IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" - logger.info("Using ITk pixel mapping: %s", IdMappingDat) - AlgKwargs["MappingFile"] = IdMappingDat - # IBL - elif flags.GeoModel.Run == "RUN2" or flags.GeoModel.Run == "RUN3": - # Planar IBL - if flags.GeoModel.IBLLayout == "planar": - # DBM or not - if flags.GeoModel.Run == "RUN2": - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" - else: - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" - # Hybrid IBL plus DBM - elif flags.GeoModel.IBLLayout == "3D": - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" - elif flags.GeoModel.IBLLayout == "UNDEFINED": - logger.warning("IBL is required, but flags.GeoModel.IBLLayout is \"UNDEFINED\"") - logger.warning("Pixel cabling map cannot be set at this point") - # No IBL - else: - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping.dat" - # DATA - elif not flags.Input.isMC: - runNum = flags.Input.RunNumber - logger.debug("Running on data, run number %d", runNum) - - AlgKwargs["RodIDForSingleLink40"] = 1300000 - - # For data older than run number 222222, use the appropriate text file - if runNum < 222222: - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - # For Run-2 onwards, get cabling map from database - else: - # Request the CablingMap folder - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) - logger.debug("Requested CablingMap folder") - - # Even though we are reading from COOL, set the correct fallback map. - if (runNum >= 344494): - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_344494.dat" - elif (runNum >= 314940 and runNum < 344494): - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_314940.dat" - elif (runNum >= 289350 and runNum < 314940): # 2016 - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_2016.dat" - elif (runNum >= 222222 and runNum < 289350): # 2015 - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" - else: - AlgKwargs["MappingFile"] = "PixelCabling/Pixels_Atlas_IdMapping_May08.dat" - # Unknown input - else: - logger.warning("Unknown input source. Pixel cabling map cannot be set at this point") - - acc.addCondAlgo(PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")) - acc.addCondAlgo(PixelCablingCondAlg(name="PixelCablingCondAlg", **AlgKwargs)) - - acc.addService(PixelCablingSvc(name, **kwargs)) + acc.merge(PixelHitDiscCnfgAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + acc.addService(CompFactory.PixelCablingSvc(name, **kwargs)) return acc diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py index 2143c9d390d..951f0ca4bc3 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py @@ -39,7 +39,7 @@ def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): if not hasattr(condSeq, 'PixelConfigCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadMap=False, + UseDeadmapConditions=False, ReadDeadMapKey="/PIXEL/PixMapOverlay", UseCalibConditions=True) diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py index 66b674bf7b9..779edc32d41 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/PixelDigitization_jobOptions.py @@ -28,7 +28,7 @@ condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, 'PixelConfigCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadMap=False, + UseDeadmapConditions=False, ReadDeadMapKey="/PIXEL/PixMapOverlay", UseCalibConditions=True) diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py index 0c667b223cd..00d077d7040 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py @@ -59,7 +59,7 @@ def SensorSimTool(name="SensorSimTool", **kwargs): def FrontEndSimTool(name="FrontEndSimTool", **kwargs): from AthenaCommon.AppMgr import ToolSvc - kwargs.setdefault("PixelConditionsSummaryTool", pixelConditionsSummaryToolSetup.getTool()) + kwargs.setdefault("PixelConditionsSummaryTool", pixelConditionsSummaryToolSetup) return CfgMgr.FrontEndSimTool(name, **kwargs) def BarrelRD53SimTool(name="BarrelRD53SimTool", **kwargs): @@ -94,143 +94,243 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): from AthenaCommon import CfgGetter from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon.AppMgr import ToolSvc - from AthenaCommon.CfgGetter import getService from IOVDbSvc.CondDB import conddb + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags + from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags ############################################################################################ -# Set up Pixel Module data +# Set up Pixel Module data (2018 condition) ############################################################################################ from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") - conddb.addFolder("PIXEL_OFL", "/PIXEL/PixMapOverlay", className="CondAttrListCollection") + if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): + conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay","/PIXEL/PixMapOverlay", className='CondAttrListCollection') + if not hasattr(condSeq, 'PixelConfigCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - - from AthenaCommon.BeamFlags import jobproperties - if jobproperties.Beam.beamType == "cosmics" : - PixelConfigCondAlg.UseComTime=True - PixelConfigCondAlg.BarrelTimeJitter=[25.0,25.0,25.0,25.0] - PixelConfigCondAlg.EndcapTimeJitter=[25.0,25.0,25.0] - PixelConfigCondAlg.DBMTimeJitter=[25.0,25.0,25.0] - PixelConfigCondAlg.BarrelNumberOfBCID=[8,8,8,8] - PixelConfigCondAlg.EndcapNumberOfBCID=[8,8,8] - PixelConfigCondAlg.DBMNumberOfBCID=[8,8,8] - PixelConfigCondAlg.BarrelTimeOffset=[100.0,100.0,100.0,100.0] - PixelConfigCondAlg.EndcapTimeOffset=[100.0,100.0,100.0] - PixelConfigCondAlg.DBMTimeOffset=[100.0,100.0,100.0] - else: - PixelConfigCondAlg.UseComTime=False - PixelConfigCondAlg.BarrelTimeJitter=[0.0,0.0,0.0,0.0] - PixelConfigCondAlg.EndcapTimeJitter=[0.0,0.0,0.0] - PixelConfigCondAlg.DBMTimeJitter=[0.0,0.0,0.0] - PixelConfigCondAlg.BarrelNumberOfBCID=[1,1,1,1] - PixelConfigCondAlg.EndcapNumberOfBCID=[1,1,1] - PixelConfigCondAlg.DBMNumberOfBCID=[1,1,1] - PixelConfigCondAlg.BarrelTimeOffset=[5.0,5.0,5.0,5.0] - PixelConfigCondAlg.EndcapTimeOffset=[5.0,5.0,5.0] - PixelConfigCondAlg.DBMTimeOffset=[5.0,5.0,5.0] - - PixelConfigCondAlg.BunchSpace=25.0 + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + + PixelConfigCondAlg.UseCalibConditions=True + PixelConfigCondAlg.UseDeadmapConditions=True + PixelConfigCondAlg.UseDCSStateConditions=False + PixelConfigCondAlg.UseDCSStatusConditions=False + PixelConfigCondAlg.UseDCSHVConditions=True + PixelConfigCondAlg.UseDCSTemperatureConditions=True + PixelConfigCondAlg.UseTDAQConditions=False + PixelConfigCondAlg.UseCablingConditions=False + + from AthenaCommon.BeamFlags import jobproperties + if jobproperties.Beam.beamType == "cosmics" : + PixelConfigCondAlg.UseComTime=True + PixelConfigCondAlg.BarrelTimeJitter=[25.0,25.0,25.0,25.0] + PixelConfigCondAlg.EndcapTimeJitter=[25.0,25.0,25.0] + PixelConfigCondAlg.DBMTimeJitter=[25.0,25.0,25.0] + PixelConfigCondAlg.BarrelNumberOfBCID=[8,8,8,8] + PixelConfigCondAlg.EndcapNumberOfBCID=[8,8,8] + PixelConfigCondAlg.DBMNumberOfBCID=[8,8,8] + PixelConfigCondAlg.BarrelTimeOffset=[100.0,100.0,100.0,100.0] + PixelConfigCondAlg.EndcapTimeOffset=[100.0,100.0,100.0] + PixelConfigCondAlg.DBMTimeOffset=[100.0,100.0,100.0] + else: + PixelConfigCondAlg.UseComTime=False + PixelConfigCondAlg.BarrelTimeJitter=[0.0,0.0,0.0,0.0] + PixelConfigCondAlg.EndcapTimeJitter=[0.0,0.0,0.0] + PixelConfigCondAlg.DBMTimeJitter=[0.0,0.0,0.0] + PixelConfigCondAlg.BarrelNumberOfBCID=[1,1,1,1] + PixelConfigCondAlg.EndcapNumberOfBCID=[1,1,1] + PixelConfigCondAlg.DBMNumberOfBCID=[1,1,1] + PixelConfigCondAlg.BarrelTimeOffset=[5.0,5.0,5.0,5.0] + PixelConfigCondAlg.EndcapTimeOffset=[5.0,5.0,5.0] + PixelConfigCondAlg.DBMTimeOffset=[5.0,5.0,5.0] + + PixelConfigCondAlg.BunchSpace=25.0 - PixelConfigCondAlg.UseCalibConditions=True - - PixelConfigCondAlg.BarrelAnalogThreshold=[-1,-1,-1,-1] - PixelConfigCondAlg.BarrelToTThreshold=[-1, 5, 5, 5] - PixelConfigCondAlg.BarrelCrossTalk=[0.06,0.06,0.06,0.06] - PixelConfigCondAlg.BarrelThermalNoise=[160.0,160.0,160.0,160.0] - PixelConfigCondAlg.BarrelNoiseOccupancy=[5e-8,5e-8,5e-8,5e-8] - PixelConfigCondAlg.BarrelDisableProbability=[9e-3,9e-3,9e-3,9e-3] - - PixelConfigCondAlg.IBLNoiseShape=[0.0,1.0] - PixelConfigCondAlg.BLayerNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000] - PixelConfigCondAlg.PixelNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000] - - PixelConfigCondAlg.FEI3BarrelLatency=[ -1, 151, 256, 256] - PixelConfigCondAlg.FEI3BarrelHitDuplication=[False, False, False, False] - PixelConfigCondAlg.FEI3BarrelSmallHitToT=[-1, -1, -1, -1] - PixelConfigCondAlg.FEI3BarrelTimingSimTune=[2015,2015,2015,2015] - - PixelConfigCondAlg.FEI4BarrelHitDiscConfig=[2] - - PixelConfigCondAlg.EndcapAnalogThreshold=[-1,-1,-1,] - PixelConfigCondAlg.EndcapToTThreshold=[ 5, 5, 5] - PixelConfigCondAlg.EndcapCrossTalk=[0.06,0.06,0.06] - PixelConfigCondAlg.EndcapThermalNoise=[160.0,160.0,160.0] - PixelConfigCondAlg.EndcapNoiseOccupancy=[5e-8,5e-8,5e-8] - PixelConfigCondAlg.EndcapDisableProbability=[9e-3,9e-3,9e-3] - PixelConfigCondAlg.EndcapNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]] - - PixelConfigCondAlg.FEI3EndcapLatency=[256, 256, 256] - PixelConfigCondAlg.FEI3EndcapHitDuplication=[False, False, False] - PixelConfigCondAlg.FEI3EndcapSmallHitToT=[-1, -1, -1] - PixelConfigCondAlg.FEI3EndcapTimingSimTune=[2015,2015,2015] - - PixelConfigCondAlg.DBMAnalogThreshold=[-1,-1,-1] - PixelConfigCondAlg.DBMToTThreshold=[-1,-1,-1] - PixelConfigCondAlg.DBMCrossTalk=[0.06,0.06,0.06] - PixelConfigCondAlg.DBMThermalNoise=[160.0,160.0,160.0] - PixelConfigCondAlg.DBMNoiseOccupancy=[5e-8,5e-8,5e-8] - PixelConfigCondAlg.DBMDisableProbability=[9e-3,9e-3,9e-3] - PixelConfigCondAlg.DBMNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]] - PixelConfigCondAlg.FEI4EndcapHitDiscConfig=[2,2,2] - - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg") + PixelConfigCondAlg.BarrelAnalogThreshold=[-1,-1,-1,-1] + PixelConfigCondAlg.BarrelToTThreshold=[-1, 5, 5, 5] + PixelConfigCondAlg.BarrelCrossTalk=[0.06,0.06,0.06,0.06] + PixelConfigCondAlg.BarrelThermalNoise=[160.0,160.0,160.0,160.0] + PixelConfigCondAlg.BarrelNoiseOccupancy=[5e-8,5e-8,5e-8,5e-8] + PixelConfigCondAlg.BarrelDisableProbability=[9e-3,9e-3,9e-3,9e-3] + + PixelConfigCondAlg.IBLNoiseShape=[0.0,1.0] + PixelConfigCondAlg.BLayerNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000] + PixelConfigCondAlg.PixelNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000] + + PixelConfigCondAlg.FEI3BarrelLatency=[ -1, 151, 256, 256] + PixelConfigCondAlg.FEI3BarrelHitDuplication=[False, False, False, False] + PixelConfigCondAlg.FEI3BarrelSmallHitToT=[-1, -1, -1, -1] + PixelConfigCondAlg.FEI3BarrelTimingSimTune=[2015,2015,2015,2015] + + PixelConfigCondAlg.FEI4BarrelHitDiscConfig=[2] + + PixelConfigCondAlg.EndcapAnalogThreshold=[-1,-1,-1,] + PixelConfigCondAlg.EndcapToTThreshold=[ 5, 5, 5] + PixelConfigCondAlg.EndcapCrossTalk=[0.06,0.06,0.06] + PixelConfigCondAlg.EndcapThermalNoise=[160.0,160.0,160.0] + PixelConfigCondAlg.EndcapNoiseOccupancy=[5e-8,5e-8,5e-8] + PixelConfigCondAlg.EndcapDisableProbability=[9e-3,9e-3,9e-3] + PixelConfigCondAlg.EndcapNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]] + + PixelConfigCondAlg.FEI3EndcapLatency=[256, 256, 256] + PixelConfigCondAlg.FEI3EndcapHitDuplication=[False, False, False] + PixelConfigCondAlg.FEI3EndcapSmallHitToT=[-1, -1, -1] + PixelConfigCondAlg.FEI3EndcapTimingSimTune=[2015,2015,2015] + + PixelConfigCondAlg.DBMAnalogThreshold=[-1,-1,-1] + PixelConfigCondAlg.DBMToTThreshold=[-1,-1,-1] + PixelConfigCondAlg.DBMCrossTalk=[0.06,0.06,0.06] + PixelConfigCondAlg.DBMThermalNoise=[160.0,160.0,160.0] + PixelConfigCondAlg.DBMNoiseOccupancy=[5e-8,5e-8,5e-8] + PixelConfigCondAlg.DBMDisableProbability=[9e-3,9e-3,9e-3] + PixelConfigCondAlg.DBMNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]] + PixelConfigCondAlg.FEI4EndcapHitDiscConfig=[2,2,2] + + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + # ITk: + if geoFlags.isSLHC(): + IdMappingDat = "ITk_Atlas_IdMapping.dat" + if "BrlIncl4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" + elif "IBrlExt4.0ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" + elif "BrlExt4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" + elif "BrlExt3.2_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" + elif (geoFlags.isIBL() == False): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" + else: + # Planar IBL + if (geoFlags.IBLLayout() == "planar"): + if (geoFlags.isDBM() == True): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" + # Hybrid IBL plus DBM + elif (geoFlags.IBLLayout() == "3D"): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + + PixelConfigCondAlg.CablingMapFileName=IdMappingDat + + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg") + +############################################################################################ +# Set up Conditions DB ############################################################################################ + if not hasattr(condSeq, "PixelDCSCondStateAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg + condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") + + if not hasattr(condSeq, "PixelDCSCondStatusAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg + condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg") + + if not conddb.folderRequested("/PIXEL/DCS/HV"): + conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HV", className="CondAttrListCollection") + + if not hasattr(condSeq,"PixelDCSCondHVAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg + condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg") + + if not conddb.folderRequested("/PIXEL/DCS/TEMPERATURE"): + conddb.addFolder("DCS_OFL", "/PIXEL/DCS/TEMPERATURE", className="CondAttrListCollection") + + if not hasattr(condSeq,"PixelDCSCondTempAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg + condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg") + + if not hasattr(condSeq, "PixelTDAQCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg + condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey="/TDAQ/Resources/ATLAS/PIXEL/Modules") + + if not conddb.folderRequested("/PIXEL/PixCalib"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib", className="CondAttrListCollection") + + if geoFlags.isIBL()==True and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): + conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelHitDiscCnfgAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg + condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg") - ############################ - # Setup charge calibration # - ############################ - conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib", className="CondAttrListCollection") if not hasattr(condSeq, 'PixelChargeCalibCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg - condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg + condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") - ################# - # Setup deadmap # - ################# - from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup - pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() - pixelConditionsSummaryToolSetup.setUseConditions(True) - pixelConditionsSummaryToolSetup.setUseDCSState(False) - pixelConditionsSummaryToolSetup.setUseByteStream(False) - pixelConditionsSummaryToolSetup.setUseTDAQ(False) - pixelConditionsSummaryToolSetup.setUseDeadMap(True) - pixelConditionsSummaryToolSetup.setup() + if not conddb.folderRequested("/PIXEL/ReadoutSpeed"): + conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelReadoutSpeedAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg + condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg") + + if not hasattr(condSeq, 'PixelCablingCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg + condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", + MappingFile=IdMappingDat, + RodIDForSingleLink40=0) + + if not conddb.folderRequested("/PIXEL/PixReco"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/PixReco", className="DetCondCFloat") + + if not hasattr(condSeq, 'PixelOfflineCalibCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg + condSeq += PixelOfflineCalibCondAlg(name="PixelOfflineCalibCondAlg", ReadKey="/PIXEL/PixReco") + PixelOfflineCalibCondAlg.InputSource = 2 + + if not conddb.folderRequested("/Indet/PixelDist"): + conddb.addFolder("INDET", "/Indet/PixelDist", className="DetCondCFloat") + + if not hasattr(condSeq, 'PixelDistortionAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDistortionAlg + condSeq += PixelDistortionAlg(name="PixelDistortionAlg", ReadKey="/Indet/PixelDist") ####################### # Setup Lorentz angle # ####################### - from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup - pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() - pixelSiPropertiesToolSetup.setup() + if not hasattr(condSeq, "PixelSiPropertiesCondAlg"): + from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg + condSeq += PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg") + + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool + ToolSvc += SiPropertiesTool(name = "PixelSiPropertiesTool", + DetectorName = "Pixel", + ReadKey = "PixelSiliconPropertiesVector") + + if not hasattr(condSeq, "PixelSiLorentzAngleCondAlg"): + from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg + condSeq += PixelSiLorentzAngleCondAlg(name = "PixelSiLorentzAngleCondAlg", + SiPropertiesTool = ToolSvc.PixelSiPropertiesTool, + UseMagFieldSvc = True, + UseMagFieldDcs = True) + + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool + ToolSvc += SiLorentzAngleTool(name="PixelLorentzAngleTool", + DetectorName="Pixel", + UseMagFieldSvc = True, + SiLorentzAngleCondData="PixelSiLorentzAngleCondData") - from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup - pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() +############################################################################################ +# Set up Tool/Service +############################################################################################ + + ################# + # Setup deadmap # + ################# + from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool + pixelConditionsSummaryToolSetup = PixelConditionsSummaryTool("PixelConditionsSummaryTool", UseByteStream=False) ##################### # Setup Cabling Svc # ##################### - PixelCablingSvc = getService("PixelCablingSvc") + from PixelCabling.PixelCablingConf import PixelCablingSvc + PixelCablingSvc = PixelCablingSvc() ServiceMgr += PixelCablingSvc print ( PixelCablingSvc) kwargs.setdefault("InputObjectName", "PixelHits") - if not conddb.folderRequested("/PIXEL/PixReco"): - conddb.addFolder("PIXEL_OFL", "/PIXEL/PixReco", className="DetCondCFloat") - - if not hasattr(condSeq, 'PixelOfflineCalibCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg - condSeq += PixelOfflineCalibCondAlg(name="PixelOfflineCalibCondAlg", ReadKey="/PIXEL/PixReco") - PixelOfflineCalibCondAlg.InputSource = 2 - - if not conddb.folderRequested("/Indet/PixelDist"): - conddb.addFolder("INDET", "/Indet/PixelDist", className="DetCondCFloat") - - if not hasattr(condSeq, 'PixelDistortionAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDistortionAlg - condSeq += PixelDistortionAlg(name="PixelDistortionAlg", ReadKey="/Indet/PixelDist") - chargeTools = [] feSimTools = [] if InDetGeometryFlags.isSLHC(): diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py index fc12fb90de2..dc5093d5635 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py @@ -11,11 +11,20 @@ from PixelDigitization.PixelDigitizationConf import ( EnergyDepositionTool, SensorSimPlanarTool, SensorSim3DTool, RD53SimTool, FEI4SimTool, FEI3SimTool, ) +from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelCablingCondAlgCfg, PixelChargeCalibCondAlgCfg, PixelConfigCondAlgCfg, + PixelDCSCondHVAlgCfg, PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, + PixelDCSCondTempAlgCfg, PixelDistortionAlgCfg, + PixelHitDiscCnfgAlgCfg, PixelOfflineCalibCondAlgCfg, PixelReadoutSpeedAlgCfg, + PixelTDAQCondAlgCfg +# NEW FOR RUN3 PixelDeadMapCondAlgCfg +) + from Digitization.PileUpToolsConfig import PileUpToolsCfg from SiPropertiesTool.PixelSiPropertiesConfig import PixelSiPropertiesCfg from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg -from PixelConditionsAlgorithms.PixelConditionsConfig import PixelChargeCalibCondAlgCfg, PixelOfflineCalibCondAlgCfg, PixelDistortionAlgCfg + from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg @@ -117,13 +126,39 @@ def EndcapFEI3SimToolCfg(flags, name="EndcapFEI3SimTool", **kwargs): def PixelDigitizationBasicToolCfg(flags, name="PixelDigitizationBasicTool", **kwargs): """Return ComponentAccumulator with configured PixelDigitizationTool""" acc = PixelGeometryCfg(flags) - acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) + + # module parameters + acc.merge(PixelConfigCondAlgCfg(flags, + UseCalibConditions=True, + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False)) + # charge calibration acc.merge(PixelChargeCalibCondAlgCfg(flags)) + # DCS setup + acc.merge(PixelDCSCondHVAlgCfg(flags)) + acc.merge(PixelDCSCondTempAlgCfg(flags)) + # cabling setup + acc.merge(PixelHitDiscCnfgAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + # deadmap + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) +# NEW FOR RUN3 acc.merge(PixelDeadMapCondAlgCfg(flags)) + acc.merge(PixelTDAQCondAlgCfg(flags)) + # offline calibration + acc.merge(PixelDistortionAlgCfg(flags)) + acc.merge(PixelOfflineCalibCondAlgCfg(flags)) + + acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) acc.popToolsAndMerge(PixelSiPropertiesCfg(flags)) acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) acc.merge(PixelCablingSvcCfg(flags)) - acc.merge(PixelOfflineCalibCondAlgCfg(flags)) - acc.merge(PixelDistortionAlgCfg(flags)) + # set up tool handle lists chargeTools = [] feSimTools = [] diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py index af7cbeb4793..f6fdcd44812 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py @@ -412,9 +412,18 @@ if dumpPixInfo: from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") + if not hasattr(condSeq, "PixelConfigCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", + UseDCSStateConditions=True, + UseDCSStatusConditions=True) + if not hasattr(condSeq, "PixelDCSCondStateAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") + if not hasattr(condSeq, "PixelDCSCondStatusAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg + condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg") from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, "PixelLorentzAngleTool"): diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx index 50facd2a6b8..5aa58695bc5 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx @@ -173,9 +173,9 @@ StatusCode PixelPrepDataToxAOD::execute() // Loop over the container unsigned int counter(0); - SG::ReadCondHandle<PixelModuleData> dcsState(m_condDCSStateKey); - SG::ReadCondHandle<PixelModuleData> dcsHV(m_readKeyHV); - SG::ReadCondHandle<PixelModuleData> dcsTemp(m_readKeyTemp); + SG::ReadCondHandle<PixelDCSStateData> dcsState(m_condDCSStateKey); + SG::ReadCondHandle<PixelDCSHVData> dcsHV(m_readKeyHV); + SG::ReadCondHandle<PixelDCSTempData> dcsTemp(m_readKeyTemp); for( const auto& clusterCollection : * PixelClusterContainer ){ diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h index 039fba26135..156ead8f435 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h @@ -1,6 +1,12 @@ /* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +/** + * @file InDetPrepRawDataToxAOD/PixelPrepDataToxAOD.h + * @author Soshi Tsuno <Soshi.Tsuno@cern.ch> + * @date November, 2019 + * @brief Store pixel data in xAOD. + */ /////////////////////////////////////////////////////////////////// // PixelPrepDataToxAOD.h @@ -20,7 +26,10 @@ #include "xAODTracking/TrackMeasurementValidation.h" #include "xAODTracking/TrackMeasurementValidationContainer.h" -#include "PixelConditionsData/PixelModuleData.h" +#include "PixelConditionsData/PixelDCSStateData.h" +#include "PixelConditionsData/PixelDCSStatusData.h" +#include "PixelConditionsData/PixelDCSHVData.h" +#include "PixelConditionsData/PixelDCSTempData.h" #include "PixelConditionsData/PixelChargeCalibCondData.h" #include "InDetCondTools/ISiLorentzAngleTool.h" #include "InDetConditionsSummaryService/IInDetConditionsTool.h" @@ -112,16 +121,16 @@ private: SG::ReadCondHandleKey<PixelChargeCalibCondData> m_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Pixel charge calibration data"}; - SG::ReadCondHandleKey<PixelModuleData> m_condDCSStateKey + SG::ReadCondHandleKey<PixelDCSStateData> m_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}; - SG::ReadCondHandleKey<PixelModuleData> m_condDCSStatusKey + SG::ReadCondHandleKey<PixelDCSStatusData> m_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyTemp + SG::ReadCondHandleKey<PixelDCSTempData> m_readKeyTemp {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}; - SG::ReadCondHandleKey<PixelModuleData> m_readKeyHV + SG::ReadCondHandleKey<PixelDCSHVData> m_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}; ToolHandle<IInDetConditionsTool> m_pixelSummary diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py index 62f954c6d96..b6841a2132d 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py @@ -733,18 +733,15 @@ def getInDetPrdAssociationTool_setup(name='InDetPrdAssociationTool_setup',**kwar def getInDetPixelConditionsSummaryTool() : from AthenaCommon.GlobalFlags import globalflags - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from InDetRecExample.InDetJobProperties import InDetFlags - - from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup - pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() - pixelConditionsSummaryToolSetup.setUseConditions(True) - pixelConditionsSummaryToolSetup.setUseDCSState((globalflags.DataSource=='data') and InDetFlags.usePixelDCS()) - pixelConditionsSummaryToolSetup.setUseByteStream((globalflags.DataSource=='data')) - pixelConditionsSummaryToolSetup.setUseTDAQ(athenaCommonFlags.isOnline()) - pixelConditionsSummaryToolSetup.setUseDeadMap((not athenaCommonFlags.isOnline())) - pixelConditionsSummaryToolSetup.setup() - return pixelConditionsSummaryToolSetup.getTool() + from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool + pixelConditionsSummaryToolSetup = PixelConditionsSummaryTool("PixelConditionsSummaryTool", + UseByteStream=(globalflags.DataSource=='data')) + if InDetFlags.usePixelDCS(): + pixelConditionsSummaryToolSetup.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] + pixelConditionsSummaryToolSetup.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] + + return pixelConditionsSummaryToolSetup @makePublicTool def getInDetTestPixelLayerTool(name = "InDetTestPixelLayerTool", **kwargs) : diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py index 7c7235c6be5..1bd41c8feb4 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py @@ -13,8 +13,8 @@ from AthenaCommon.DetFlags import DetFlags # --- Pixel cabling # if DetFlags.detdescr.pixel_on() and not 'PixelCabling' in dir(): - from AthenaCommon.CfgGetter import getService - PixelCablingSvc = getService("PixelCablingSvc") + from PixelCabling.PixelCablingConf import PixelCablingSvc + PixelCablingSvc = PixelCablingSvc() ServiceMgr += PixelCablingSvc if (InDetFlags.doPrintConfigurables()): printfunc (PixelCablingSvc) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py index 83d652ec1d3..524be82bee9 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py @@ -40,29 +40,80 @@ if not hasattr(condSeq, "BeamSpotCondAlg"): if DetFlags.haveRIO.pixel_on(): # Load pixel conditions summary service from AthenaCommon.AppMgr import ToolSvc + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags + from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags ################# # Module status # ################# useNewConditionsFormat = False - if not athenaCommonFlags.isOnline(): - if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): - conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") - if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): - conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS", className="CondAttrListCollection") - if not hasattr(condSeq, "PixelDCSCondStateAlg"): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg - condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") + if not useNewConditionsFormat: + if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): + conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay","/PIXEL/PixMapOverlay", className='CondAttrListCollection') - if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): - conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay","/PIXEL/PixMapOverlay", className='CondAttrListCollection') if not hasattr(condSeq, "PixelConfigCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + rodIDForSingleLink40=0 + if (globalflags.DataSource()=='geant4'): + # ITk: + if geoFlags.isSLHC(): + IdMappingDat = "ITk_Atlas_IdMapping.dat" + if "BrlIncl4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" + elif "IBrlExt4.0ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" + elif "BrlExt4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" + elif "BrlExt3.2_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" + elif (geoFlags.isIBL() == False): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" + else: + # Planar IBL + if (geoFlags.IBLLayout() == "planar"): + if (geoFlags.isDBM() == True): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" + # Hybrid IBL plus DBM + elif (geoFlags.IBLLayout() == "3D"): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + + elif (globalflags.DataSource=='data'): + from RecExConfig.AutoConfiguration import GetRunNumber + runNum = GetRunNumber() + if (runNum<222222): + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + rodIDForSingleLink40=1300000 + else: + useCablingConditions = True + rodIDForSingleLink40=1300000 + # Even though we are reading from COOL, set the correct fallback map. + if (runNum >= 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" + elif (runNum >= 314940 and runNum < 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_314940.dat" + elif (runNum >= 289350 and runNum < 314940): # 2016 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + elif (runNum >= 222222 and runNum < 289350): # 2015 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadMap=True, - ReadDeadMapKey="/PIXEL/PixMapOverlay", - UseCalibConditions=True) + UseDeadmapConditions=(not athenaCommonFlags.isOnline()), + UseDCSStateConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), + UseDCSStatusConditions=(globalflags.DataSource=='data') and InDetFlags.usePixelDCS(), + UseTDAQConditions=athenaCommonFlags.isOnline(), + ReadDeadMapKey="/PIXEL/PixMapOverlay", + UseCalibConditions=True, + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) if useNewConditionsFormat: if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): @@ -71,15 +122,68 @@ if DetFlags.haveRIO.pixel_on(): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + if not athenaCommonFlags.isOnline(): + if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"): + conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") + if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): + conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS", className="CondAttrListCollection") + + if not hasattr(condSeq, "PixelDCSCondStateAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg + condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") + + if not hasattr(condSeq, "PixelDCSCondStatusAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg + condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg") + + if athenaCommonFlags.isOnline(): + if not conddb.folderRequested("/TDAQ/Resources/ATLAS/PIXEL/Modules"): + conddb.addFolder("TDAQ_ONL", "/TDAQ/Resources/ATLAS/PIXEL/Modules", className="CondAttrListCollection") + + if not hasattr(condSeq, "PixelTDAQCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg + condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg") + ##################### # Calibration Setup # ##################### if not conddb.folderRequested("/PIXEL/PixCalib"): conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixCalib", "/PIXEL/PixCalib", className="CondAttrListCollection") + if not hasattr(condSeq, 'PixelChargeCalibCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") + ##################### + # Cabling map Setup # + ##################### + if (conddb.dbdata=="CONDBR2" or (conddb.dbmc=="OFLP200" and geoFlags.isIBL()==True)) and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): + conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelHitDiscCnfgAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg + condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg") + + if not conddb.folderRequested("/PIXEL/ReadoutSpeed"): + if not (globalflags.DataSource() == 'geant4'): + conddb.addFolder("PIXEL", "/PIXEL/ReadoutSpeed", className="AthenaAttributeList") + else: + conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelReadoutSpeedAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg + condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg") + + if (globalflags.DataSource=='data'): + if not conddb.folderRequested("/PIXEL/CablingMap"): + conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelCablingCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg + condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", + MappingFile=IdMappingDat, + RodIDForSingleLink40=rodIDForSingleLink40) + if not athenaCommonFlags.isOnline(): if not conddb.folderRequested('/PIXEL/PixdEdx'): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixdEdx", className="AthenaAttributeList") @@ -98,10 +202,6 @@ if DetFlags.haveRIO.pixel_on(): else : PixelOfflineCalibCondAlg.InputSource = 2 - if not hasattr(condSeq, 'PixelConfigCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg") - if not hasattr(ToolSvc, "PixelLorentzAngleTool"): from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py index ca92fb59b89..994d159b9b2 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py @@ -309,10 +309,6 @@ if InDetFlags.loadSummaryTool(): InDetPixelConditionsSummaryTool = TrackingCommon.getInDetPixelConditionsSummaryTool() - if InDetFlags.usePixelDCS(): - InDetPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] - InDetPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] - if (InDetFlags.doPrintConfigurables()): print InDetPixelConditionsSummaryTool diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py index 76c15bf2cad..6fe58421893 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Rec.py @@ -40,6 +40,7 @@ if rec.doWriteESD() or rec.doWriteAOD() or ('doWriteESD' in dir() and doWriteESD # --- turn off cluster calibration from DB, does not exist for IBL from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg PixelConfigCondAlg.UseCalibConditions = False + PixelConfigCondAlg.UseDeadmapConditions = False # --- switch alignment for IBL geometry off (gives WARNING) from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py index 0bf290e7a40..f1346ea9857 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py @@ -55,14 +55,100 @@ class PixelConditionsServicesSetup: def createTool(self): from AthenaCommon.AppMgr import ToolSvc - ######################## - # DCS Conditions Setup # - ######################## + ############################# + # Setup Pixel Configuration # + ############################# from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") from IOVDbSvc.CondDB import conddb + from AthenaCommon.GlobalFlags import globalflags + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags + from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags + + useNewConditionsFormat = False + + if not useNewConditionsFormat: + if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): + conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay","/PIXEL/PixMapOverlay", className='CondAttrListCollection') + + if not hasattr(condSeq, 'PixelConfigCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + rodIDForSingleLink40=0 + if (globalflags.DataSource()=='geant4'): + # ITk: + if geoFlags.isSLHC(): + IdMappingDat = "ITk_Atlas_IdMapping.dat" + if "BrlIncl4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat" + elif "IBrlExt4.0ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat" + elif "BrlExt4.0_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" + elif "BrlExt3.2_ref" == commonGeoFlags.GeoType(): + IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" + elif (geoFlags.isIBL() == False): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" + else: + # Planar IBL + if (geoFlags.IBLLayout() == "planar"): + if (geoFlags.isDBM() == True): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" + # Hybrid IBL plus DBM + elif (geoFlags.IBLLayout() == "3D"): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + + elif (globalflags.DataSource=='data'): + from RecExConfig.AutoConfiguration import GetRunNumber + runNum = GetRunNumber() + if (runNum<222222): + useCablingConditions = False + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + rodIDForSingleLink40=1300000 + else: + useCablingConditions = True + rodIDForSingleLink40=1300000 + # Even though we are reading from COOL, set the correct fallback map. + if (runNum >= 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_344494.dat" + elif (runNum >= 314940 and runNum < 344494): + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_314940.dat" + elif (runNum >= 289350 and runNum < 314940): # 2016 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" + elif (runNum >= 222222 and runNum < 289350): # 2015 + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat" + else: + IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_May08.dat" + + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", + UseDeadmapConditions=self.usePixMap, + UseDCSStateConditions=self.useDCS, + UseDCSStatusConditions=self.useDCS, + UseTDAQConditions=self.useTDAQ, # should be false. This is only valid in RUN-1. + ReadDeadMapKey="/PIXEL/PixMapOverlay", + UseCalibConditions=True, + UseCablingConditions=useCablingConditions, + CablingMapFileName=IdMappingDat) + + + ######################### + # Deadmap Setup (RUN-3) # + ######################### + if useNewConditionsFormat: + if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelModuleFeMask", className="CondAttrListCollection") + if not hasattr(condSeq, "PixelDeadMapCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg + condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg") + ######################## + # DCS Conditions Setup # + ######################## PixelHVFolder = "/PIXEL/DCS/HV" PixelTempFolder = "/PIXEL/DCS/TEMPERATURE" PixelDBInstance = "DCS_OFL" @@ -83,57 +169,46 @@ class PixelConditionsServicesSetup: conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE", className="CondAttrListCollection") if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS", className="CondAttrListCollection") + + if not hasattr(condSeq, 'PixelDCSCondStateAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg") + if not hasattr(condSeq, 'PixelDCSCondStatusAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg + condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg") + if not hasattr(condSeq, 'PixelDCSCondHVAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey=PixelHVFolder) if not hasattr(condSeq, 'PixelDCSCondTempAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg - condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=PixelTempFolder, UseConditions=True) + condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=PixelTempFolder) ######################### # TDAQ Conditions Setup # ######################### TrigPixelTDAQConditionsTool = None + PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules" if self.useTDAQ: - PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules" PixelTDAQInstance = "TDAQ_ONL" - if not conddb.folderRequested(PixelTDAQFolder): conddb.addFolder(PixelTDAQInstance, PixelTDAQFolder, className="CondAttrListCollection") - if not hasattr(condSeq, "PixelTDAQCondAlg"): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg - condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey=PixelTDAQFolder) - - ############################ - # DeadMap Conditions Setup # - ############################ - PixelDeadMapFolder = "/PIXEL/PixMapOverlay" - if self.usePixMap: - if not (conddb.folderRequested(PixelDeadMapFolder) or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): - conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay",PixelDeadMapFolder, className='CondAttrListCollection') + if not hasattr(condSeq, "PixelTDAQCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg + condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey=PixelTDAQFolder) ############################ # Conditions Summary Setup # ############################ # This is future replacement of the PixelConditionsSummaryTool... - if not hasattr(condSeq, 'PixelConfigCondAlg'): - from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg - condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", - UseDeadMap=self.usePixMap, - ReadDeadMapKey=PixelDeadMapFolder, - UseCalibConditions=True) from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool TrigPixelConditionsSummaryTool = PixelConditionsSummaryTool(name=self.instanceName('PixelConditionsSummaryTool'), - UseDCSState=self.useDCS, - UseByteStream=self.useBS, - UseTDAQ=self.useTDAQ, - UseDeadMap=self.usePixMap) + UseByteStream=self.useBS) + if self.useDCS and not self.onlineMode: TrigPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON' ] TrigPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING' ] @@ -152,6 +227,39 @@ class PixelConditionsServicesSetup: from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") + ##################### + # Cabling map Setup # + ##################### + if (conddb.dbdata=="CONDBR2" or (conddb.dbmc=="OFLP200" and geoFlags.isIBL()==True)) and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): + conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelHitDiscCnfgAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg + condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg") + + if not conddb.folderRequested("/PIXEL/ReadoutSpeed"): + if not (globalflags.DataSource() == 'geant4'): + conddb.addFolder("PIXEL", "/PIXEL/ReadoutSpeed", className="AthenaAttributeList") + else: + conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelReadoutSpeedAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg + condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg") + + if (globalflags.DataSource=='data'): + if not conddb.folderRequested("/PIXEL/CablingMap"): + conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList") + + if not hasattr(condSeq, 'PixelCablingCondAlg'): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg + condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", + MappingFile=IdMappingDat, + RodIDForSingleLink40=rodIDForSingleLink40) + + ############################# + # Offline calibration Setup # + ############################# if not conddb.folderRequested("/PIXEL/PixReco"): conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixReco","/PIXEL/PixReco",className="DetCondCFloat") diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py index 761f0fb28eb..92e0dc55e7b 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py @@ -16,6 +16,16 @@ def TrackSummaryToolWorkaround(flags): ############################## TO RUN TRACKSUMMARYTOOL ##################### # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py + from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg + result.merge(PixelConfigCondAlgCfg(flags, + UseCalibConditions=True, + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False)) + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3_Alg.py index 41e44d47fff..a08e1593183 100644 --- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3_Alg.py +++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3_Alg.py @@ -90,6 +90,16 @@ def TRTMonitoringRun3_AlgConfig(inputFlags): ############################ TO RUN TRACKSUMMARYTOOL ####################### # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py + from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg + result.merge(PixelConfigCondAlgCfg(inputFlags, + UseCalibConditions=True, + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False)) + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(inputFlags)) diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py index 32e5ca38c30..e07db31e219 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py @@ -30,17 +30,9 @@ ToolSvc += InDet__InDetTrackHoleSearchTool( \ useSCT = DetFlags.haveRIO.SCT_on(), CountDeadModulesAfterLastHit = True) -from InDetRecExample.InDetJobProperties import InDetFlags -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup -pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() -pixelConditionsSummaryToolSetup.setUseConditions(True) -pixelConditionsSummaryToolSetup.setUseDCSState((globalflags.DataSource=='data') and InDetFlags.usePixelDCS()) -pixelConditionsSummaryToolSetup.setUseByteStream((globalflags.DataSource=='data')) -pixelConditionsSummaryToolSetup.setUseTDAQ(athenaCommonFlags.isOnline()) -pixelConditionsSummaryToolSetup.setUseDeadMap((not athenaCommonFlags.isOnline())) -pixelConditionsSummaryToolSetup.setup() -InDetPixelConditionsSummaryTool = pixelConditionsSummaryToolSetup.getTool() +import InDetRecExample.TrackingCommon as TrackingCommon +InDetPixelConditionsSummaryTool = TrackingCommon.getInDetPixelConditionsSummaryTool() + if muonCombinedRecFlags.useDetailedPixelHoleSearch(): # now get the InDet tools as used for InDet tracks diff --git a/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.cxx b/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.cxx index d3083ca366b..16a2b0c6b86 100644 --- a/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.cxx +++ b/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.cxx @@ -29,9 +29,6 @@ StatusCode TestPixelModuleDisablingSvc::queryInterface(const InterfaceID& riid, if(interfaceID() == riid){ *ppvIf = dynamic_cast< TestPixelModuleDisablingSvc* > (this); } - else if(IPixelTDAQSvc::interfaceID() == riid){ - *ppvIf = dynamic_cast< IPixelTDAQSvc* > (this); - } else if(IIncidentListener::interfaceID() == riid){ *ppvIf = dynamic_cast< IIncidentListener* > (this); } diff --git a/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.h b/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.h index 921d389a0e9..dd39504983b 100644 --- a/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.h +++ b/Trigger/TrigTools/TrigIDUtils/src/TestPixelModuleDisablingSvc.h @@ -16,8 +16,8 @@ #include "AthenaBaseComps/AthService.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/IIncidentListener.h" - -#include "PixelConditionsTools/IPixelTDAQSvc.h" +#include "Identifier/Identifier.h" +#include "Identifier/IdentifierHash.h" #include <set> #include <map> @@ -30,7 +30,6 @@ class CondAttrListCollection; class TestPixelModuleDisablingSvc: public AthService, - virtual public IPixelTDAQSvc, virtual public IIncidentListener { diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetConfig.py index f88b8ce4cf6..3e2f4cdd0b2 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetConfig.py @@ -117,81 +117,63 @@ def TrigInDetCondConfig( flags ): acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/ToTCalib","/TRT/Calib/ToTCalib",className="CondAttrListCollection")) acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/HTCalib","/TRT/Calib/HTCalib",className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/ReadoutSpeed", "PIXEL", className="AthenaAttributeList")) - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) - acc.merge(addFolders(flags, "/PIXEL/HitDiscCnfg", "PIXEL", className="AthenaAttributeList")) - PixelAlignCondAlg=CompFactory.PixelAlignCondAlg - acc.addCondAlgo(PixelAlignCondAlg(UseDynamicAlignFolders = True)) + ############### + # Pixel setup # + ############### + from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelConfigCondAlgCfg, PixelChargeCalibCondAlgCfg, PixelDCSCondHVAlgCfg, + PixelDCSCondTempAlgCfg, PixelAlignCondAlgCfg, PixelDetectorElementCondAlgCfg, + PixelHitDiscCnfgAlgCfg, PixelReadoutSpeedAlgCfg, PixelCablingCondAlgCfg, + PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, PixelTDAQCondAlgCfg, + PixelDistortionAlgCfg, PixelOfflineCalibCondAlgCfg +# NEW FOR RUN3 PixelDeadMapCondAlgCfg + ) + + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg + from SiPropertiesTool.PixelSiPropertiesConfig import PixelSiPropertiesCfg + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg + from PixelCabling.PixelCablingConfigNew import PixelCablingSvcCfg + + # module parameters + acc.merge(PixelConfigCondAlgCfg(flags, + UseCalibConditions=False, + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False)) + # charge calibration + acc.merge(PixelChargeCalibCondAlgCfg(flags)) + # DCS setup + acc.merge(PixelDCSCondHVAlgCfg(flags)) + acc.merge(PixelDCSCondTempAlgCfg(flags)) + # alignment setup + acc.merge(PixelAlignCondAlgCfg(flags, UseDynamicAlignFolders=True)) + acc.merge(PixelDetectorElementCondAlgCfg(flags)) + # cabling setup + acc.merge(PixelHitDiscCnfgAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + # deadmap + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) +# NEW FOR RUN3 acc.merge(PixelDeadMapCondAlgCfg(flags)) + acc.merge(PixelTDAQCondAlgCfg(flags)) + # offline calibration + acc.merge(PixelDistortionAlgCfg(flags)) + acc.merge(PixelOfflineCalibCondAlgCfg(flags)) + + acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) + acc.popToolsAndMerge(PixelSiPropertiesCfg(flags)) + acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) + acc.merge(PixelCablingSvcCfg(flags)) - PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg - acc.addCondAlgo(PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")) - - PixelReadoutSpeedAlg=CompFactory.PixelReadoutSpeedAlg - acc.addCondAlgo(PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")) - - PixelCablingCondAlg=CompFactory.PixelCablingCondAlg - acc.addCondAlgo(PixelCablingCondAlg(name="PixelCablingCondAlg")) - - PixelHitDiscCnfgAlg=CompFactory.PixelHitDiscCnfgAlg - acc.addCondAlgo(PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")) - - from AthenaCommon.CfgGetter import getService - PixelCablingSvc = getService("PixelCablingSvc") - acc.addService(PixelCablingSvc) - - PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules" - PixelTDAQInstance = "TDAQ_ONL" - acc.merge(addFolders(flags, PixelTDAQFolder, PixelTDAQInstance, className="CondAttrListCollection")) - - acc.merge(addFolders(flags, "/PIXEL/DCS/HV", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/DCS/TEMPERATURE", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/PixCalib", "PIXEL_OFL", className="CondAttrListCollection")) - - PixelDCSCondHVAlg=CompFactory.PixelDCSCondHVAlg - acc.addCondAlgo(PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey="/PIXEL/DCS/HV")) - - PixelDCSCondTempAlg=CompFactory.PixelDCSCondTempAlg - acc.addCondAlgo(PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey="/PIXEL/DCS/TEMPERATURE")) - - PixelChargeCalibCondAlg=CompFactory.PixelChargeCalibCondAlg - acc.addCondAlgo(PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib")) - - PixelTDAQCondAlg=CompFactory.PixelTDAQCondAlg - acc.addCondAlgo(PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey=PixelTDAQFolder)) - - PixelDeadMapFolder = "/PIXEL/PixMapOverlay" - PixelDeadMapInstance = "PIXEL_OFL" - - acc.merge(addFolders(flags, "/PIXEL/DCS/TEMPERATURE", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, PixelDeadMapFolder, PixelDeadMapInstance, className="CondAttrListCollection")) - - PixelConfigCondAlg=CompFactory.PixelConfigCondAlg - acc.addCondAlgo(PixelConfigCondAlg(name="PixelConfigCondAlg", UseDeadMap=False, ReadDeadMapKey=PixelDeadMapFolder, UseCalibConditions=False)) - - PixelSiPropertiesCondAlg=CompFactory.PixelSiPropertiesCondAlg - acc.addCondAlgo(PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")) - - SiPropertiesTool=CompFactory.SiPropertiesTool - TrigSiPropertiesTool = SiPropertiesTool(name="PixelSiPropertiesTool", DetectorName="Pixel", ReadKey="PixelSiliconPropertiesVector") - - acc.addPublicTool(TrigSiPropertiesTool) - - PixelSiLorentzAngleCondAlg=CompFactory.PixelSiLorentzAngleCondAlg - acc.addCondAlgo(PixelSiLorentzAngleCondAlg(name="PixelSiLorentzAngleCondAlg", - SiPropertiesTool=TrigSiPropertiesTool, - UseMagFieldSvc = True, - UseMagFieldDcs = False)) - - SiLorentzAngleTool=CompFactory.SiLorentzAngleTool - TrigPixelLorentzAngleTool = SiLorentzAngleTool(name = "PixelLorentzAngleTool", DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData") - - acc.addPublicTool(TrigPixelLorentzAngleTool) BeamSpotCondAlg=CompFactory.BeamSpotCondAlg acc.addCondAlgo(BeamSpotCondAlg( "BeamSpotCondAlg" )) - from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg mfsc = MagneticFieldSvcCfg(flags) acc.merge( mfsc ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py index e633bb831b8..75d8e3bb286 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py @@ -119,79 +119,59 @@ def TrigInDetCondConfig( flags ): acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/ToTCalib","/TRT/Calib/ToTCalib",className="CondAttrListCollection")) acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Calib/HTCalib","/TRT/Calib/HTCalib",className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/ReadoutSpeed", "PIXEL", className="AthenaAttributeList")) - acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) - acc.merge(addFolders(flags, "/PIXEL/HitDiscCnfg", "PIXEL", className="AthenaAttributeList")) - PixelAlignCondAlg=CompFactory.PixelAlignCondAlg - acc.addCondAlgo(PixelAlignCondAlg(UseDynamicAlignFolders = True)) + ############### + # Pixel setup # + ############### + from PixelConditionsAlgorithms.PixelConditionsConfig import ( + PixelConfigCondAlgCfg, PixelChargeCalibCondAlgCfg, PixelDCSCondHVAlgCfg, + PixelDCSCondTempAlgCfg, PixelAlignCondAlgCfg, PixelDetectorElementCondAlgCfg, + PixelHitDiscCnfgAlgCfg, PixelReadoutSpeedAlgCfg, PixelCablingCondAlgCfg, + PixelDCSCondStateAlgCfg, PixelDCSCondStatusAlgCfg, PixelTDAQCondAlgCfg, + PixelDistortionAlgCfg, PixelOfflineCalibCondAlgCfg +# NEW FOR RUN3 PixelDeadMapCondAlgCfg + ) + + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg + from SiPropertiesTool.PixelSiPropertiesConfig import PixelSiPropertiesCfg + from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg + from PixelCabling.PixelCablingConfigNew import PixelCablingSvcCfg + + # module parameters + acc.merge(PixelConfigCondAlgCfg(flags, + UseCalibConditions=False, + UseDeadmapConditions=True, + UseDCSStateConditions=False, + UseDCSStatusConditions=False, + UseDCSHVConditions=True, + UseDCSTemperatureConditions=True, + UseTDAQConditions=False)) + # charge calibration + acc.merge(PixelChargeCalibCondAlgCfg(flags)) + # DCS setup + acc.merge(PixelDCSCondHVAlgCfg(flags)) + acc.merge(PixelDCSCondTempAlgCfg(flags)) + # alignment setup + acc.merge(PixelAlignCondAlgCfg(flags, UseDynamicAlignFolders=True)) + acc.merge(PixelDetectorElementCondAlgCfg(flags)) + # cabling setup + acc.merge(PixelHitDiscCnfgAlgCfg(flags)) + acc.merge(PixelReadoutSpeedAlgCfg(flags)) + acc.merge(PixelCablingCondAlgCfg(flags)) + # deadmap + acc.merge(PixelDCSCondStateAlgCfg(flags)) + acc.merge(PixelDCSCondStatusAlgCfg(flags)) +# NEW FOR RUN3 acc.merge(PixelDeadMapCondAlgCfg(flags)) + acc.merge(PixelTDAQCondAlgCfg(flags)) + # offline calibration + acc.merge(PixelDistortionAlgCfg(flags)) + acc.merge(PixelOfflineCalibCondAlgCfg(flags)) + + acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) + acc.popToolsAndMerge(PixelSiPropertiesCfg(flags)) + acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) + acc.merge(PixelCablingSvcCfg(flags)) - PixelDetectorElementCondAlg=CompFactory.PixelDetectorElementCondAlg - acc.addCondAlgo(PixelDetectorElementCondAlg(name = "PixelDetectorElementCondAlg")) - - PixelReadoutSpeedAlg=CompFactory.PixelReadoutSpeedAlg - acc.addCondAlgo(PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")) - - PixelCablingCondAlg=CompFactory.PixelCablingCondAlg - acc.addCondAlgo(PixelCablingCondAlg(name="PixelCablingCondAlg")) - - PixelHitDiscCnfgAlg=CompFactory.PixelHitDiscCnfgAlg - acc.addCondAlgo(PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")) - - PixelDistortionAlg=CompFactory.PixelDistortionAlg - acc.addCondAlgo(PixelDistortionAlg(name="PixelDistortionAlg", ReadKey="/Indet/Onl/PixelDist")) - - from AthenaCommon.CfgGetter import getService - PixelCablingSvc = getService("PixelCablingSvc") - acc.addService(PixelCablingSvc) - - PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules" - PixelTDAQInstance = "TDAQ_ONL" - acc.merge(addFolders(flags, PixelTDAQFolder, PixelTDAQInstance, className="CondAttrListCollection")) - - acc.merge(addFolders(flags, "/PIXEL/DCS/HV", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/DCS/TEMPERATURE", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, "/PIXEL/PixCalib", "PIXEL_OFL", className="CondAttrListCollection")) - - PixelDCSCondHVAlg=CompFactory.PixelDCSCondHVAlg - acc.addCondAlgo(PixelDCSCondHVAlg(name="PixelDCSCondHVAlg", ReadKey="/PIXEL/DCS/HV")) - - PixelDCSCondTempAlg=CompFactory.PixelDCSCondTempAlg - acc.addCondAlgo(PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey="/PIXEL/DCS/TEMPERATURE")) - - PixelChargeCalibCondAlg=CompFactory.PixelChargeCalibCondAlg - acc.addCondAlgo(PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib")) - - PixelTDAQCondAlg=CompFactory.PixelTDAQCondAlg - acc.addCondAlgo(PixelTDAQCondAlg(name="PixelTDAQCondAlg", ReadKey=PixelTDAQFolder)) - - PixelDeadMapFolder = "/PIXEL/PixMapOverlay" - PixelDeadMapInstance = "PIXEL_OFL" - - acc.merge(addFolders(flags, "/PIXEL/DCS/TEMPERATURE", "DCS_OFL", className="CondAttrListCollection")) - acc.merge(addFolders(flags, PixelDeadMapFolder, PixelDeadMapInstance, className="CondAttrListCollection")) - - PixelConfigCondAlg=CompFactory.PixelConfigCondAlg - acc.addCondAlgo(PixelConfigCondAlg(name="PixelConfigCondAlg", UseDeadMap=False, ReadDeadMapKey=PixelDeadMapFolder, UseCalibConditions=False)) - - PixelSiPropertiesCondAlg=CompFactory.PixelSiPropertiesCondAlg - acc.addCondAlgo(PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")) - - SiPropertiesTool=CompFactory.SiPropertiesTool - TrigSiPropertiesTool = SiPropertiesTool(name="PixelSiPropertiesTool", DetectorName="Pixel", ReadKey="PixelSiliconPropertiesVector") - - acc.addPublicTool(TrigSiPropertiesTool) - - PixelSiLorentzAngleCondAlg=CompFactory.PixelSiLorentzAngleCondAlg - acc.addCondAlgo(PixelSiLorentzAngleCondAlg(name="PixelSiLorentzAngleCondAlg", - SiPropertiesTool=TrigSiPropertiesTool, - UseMagFieldSvc = True, - UseMagFieldDcs = False)) - - SiLorentzAngleTool=CompFactory.SiLorentzAngleTool - TrigPixelLorentzAngleTool = SiLorentzAngleTool(name = "PixelLorentzAngleTool", DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData") - - acc.addPublicTool(TrigPixelLorentzAngleTool) BeamSpotCondAlg=CompFactory.BeamSpotCondAlg acc.addCondAlgo(BeamSpotCondAlg( "BeamSpotCondAlg" )) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref index 7d375486d57..0d7d03e6925 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref @@ -3,7 +3,7 @@ TrigSignatureMoniMT INFO HLT_2e17_etcut_L12EM15V TrigSignatureMoniMT INFO HLT_2e17_lhvloose_L12EM3 20 20 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_2e17_lhvloose_L12EM3 decisions 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_2e3_etcut_L12EM3 20 20 13 13 13 0 0 13 -TrigSignatureMoniMT INFO HLT_2e3_etcut_L12EM3 decisions 46 233 85 0 0 +TrigSignatureMoniMT INFO HLT_2e3_etcut_L12EM3 decisions 46 256 85 0 0 TrigSignatureMoniMT INFO HLT_2g20_tight_L12EM20VH 20 20 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_2g20_tight_L12EM20VH decisions 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_2g35_etcut_L12EM20VH 20 20 0 0 0 0 0 0 @@ -55,19 +55,19 @@ TrigSignatureMoniMT INFO HLT_e300_etcut_L1EM24VH TrigSignatureMoniMT INFO HLT_e3_etcut1step_mu6fast_L1EM8I_MU1020 20 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_e3_etcut1step_mu6fast_L1EM8I_MU10 decisions 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_e3_etcut_L1EM3 20 20 15 13 13 0 0 13 -TrigSignatureMoniMT INFO HLT_e3_etcut_L1EM3 decisions 48 233 85 0 0 +TrigSignatureMoniMT INFO HLT_e3_etcut_L1EM3 decisions 48 256 85 0 0 TrigSignatureMoniMT INFO HLT_e5_etcut_L1EM3 20 20 13 12 12 0 0 12 -TrigSignatureMoniMT INFO HLT_e5_etcut_L1EM3 decisions 41 217 47 0 0 +TrigSignatureMoniMT INFO HLT_e5_etcut_L1EM3 decisions 41 236 47 0 0 TrigSignatureMoniMT INFO HLT_e5_lhloose_L1EM3 20 20 10 9 9 0 0 0 -TrigSignatureMoniMT INFO HLT_e5_lhloose_L1EM3 decisions 15 71 28 0 0 +TrigSignatureMoniMT INFO HLT_e5_lhloose_L1EM3 decisions 15 77 28 0 0 TrigSignatureMoniMT INFO HLT_e5_lhmedium_L1EM3 20 20 9 8 8 0 0 0 -TrigSignatureMoniMT INFO HLT_e5_lhmedium_L1EM3 decisions 13 68 27 0 0 +TrigSignatureMoniMT INFO HLT_e5_lhmedium_L1EM3 decisions 13 75 27 0 0 TrigSignatureMoniMT INFO HLT_e5_lhtight_L1EM3 20 20 9 8 8 0 0 0 -TrigSignatureMoniMT INFO HLT_e5_lhtight_L1EM3 decisions 13 68 27 0 0 +TrigSignatureMoniMT INFO HLT_e5_lhtight_L1EM3 decisions 13 75 27 0 0 TrigSignatureMoniMT INFO HLT_e60_lhmedium_L1EM24VHI 20 20 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_e60_lhmedium_L1EM24VHI decisions 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_e7_etcut_L1EM3 20 20 13 12 11 0 0 11 -TrigSignatureMoniMT INFO HLT_e7_etcut_L1EM3 decisions 26 153 21 0 0 +TrigSignatureMoniMT INFO HLT_e7_etcut_L1EM3 decisions 26 167 21 0 0 TrigSignatureMoniMT INFO HLT_g140_etcut_L1EM24VHI 20 20 0 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_g140_etcut_L1EM24VHI decisions 0 0 0 0 0 TrigSignatureMoniMT INFO HLT_g140_loose_L1EM24VHI 20 20 0 0 0 0 0 0 -- GitLab