5 import SerialSubstitution
6 from SerialSubstitution
import AddProcessor, RunSubstitutor
10 if __name__ ==
"__main__":
18 Subst.AddFileType(
"fcl")
20 Subst.AddSimplePattern(
"LArProperties:",
"LArPropertiesService:")
21 Subst.AddSimplePattern(
".LArProperties.",
".LArPropertiesService.")
22 Subst.AddSimplePattern(
"DetectorProperties:",
"DetectorPropertiesService:")
23 Subst.AddSimplePattern(
".DetectorProperties.",
".DetectorPropertiesService.")
24 Subst.AddSimplePattern(
"TimeService:",
"DetectorClocksService:")
25 Subst.AddSimplePattern(
".TimeService.",
".DetectorClocksService.")
26 Subst.AddSimplePattern(
"timeservice",
"detectorclocks")
27 Subst.AddSimplePattern(
".LArPropertiesService.Efield:",
".DetectorPropertiesService.Efield:")
28 Subst.AddSimplePattern(
".LArPropertiesService.Electronlifetime:",
".DetectorPropertiesService.Electronlifetime:")
29 Subst.AddSimplePattern(
".LArPropertiesService.Temperature:",
".DetectorPropertiesService.Temperature:")
31 Subst.AddSimplePattern(
"IChannelStatusService:",
"ChannelStatusService:")
32 Subst.AddSimplePattern(
".IChannelStatusService.",
".ChannelStatusService.")
34 Subst.AddSimplePattern(
"IDetPedestalService:",
"DetPedestalService:")
35 Subst.AddSimplePattern(
".IDetPedestalService.",
".DetPedestalService.")
42 Subst.AddFileNamePattern(
"CMakeLists.txt")
44 Subst.AddRegExRemoveLine(
r"^\s*(LArProperties|DetectorProperties|DetectorClocks|TimeService)_service\s*(#.*)?$")
58 Subst.AddFileNamePattern(
".*_module\.cc")
61 Subst.AddWord (
"Utilities/LArProperties.h",
"DetectorInfoServices/LArPropertiesService.h")
62 Subst.AddWord (
"Utilities/DetectorProperties.h",
"DetectorInfoServices/DetectorPropertiesService.h")
63 Subst.AddWord (
"Utilities/DetectorClocks.h",
"DetectorInfoServices/DetectorClocksService.h")
64 Subst.AddWord (
"Utilities/RunHistory.h",
"DetectorInfoServices/RunHistoryService.h")
65 Subst.AddWord (
"Utilities/TimeService.h",
"DetectorInfoServices/DetectorClocksService.h")
72 Subst.AddFileType(
"h",
"cc",
"cpp",
"cxx")
75 Subst.AddWord (
"DataProviders/",
"DetectorInfo/")
78 Subst.AddWord (
"Utilities/LArProperties.h",
"DetectorInfo/LArProperties.h")
79 Subst.AddWord (
"Utilities/DetectorProperties.h",
"DetectorInfo/DetectorProperties.h")
80 Subst.AddWord (
"Utilities/DetectorClocks.h",
"DetectorInfo/DetectorClocks.h")
81 Subst.AddWord (
"Utilities/RunHistory.h",
"DetectorInfo/RunHistory.h")
82 Subst.AddWord (
"Utilities/ElecClock.h",
"DetectorInfo/ElecClock.h")
83 Subst.AddWord (
"Utilities/DetectorClocksExceptions.h",
"DetectorInfo/DetectorClocksExceptions.h")
84 Subst.AddWord (
"Utilities/ClockConstants.h",
"DetectorInfo/ClockConstants.h")
87 Subst.AddWord (
"Utilities/LArPropertiesService.h",
"DetectorInfoServices/LArPropertiesService.h")
88 Subst.AddWord (
"Utilities/DetectorPropertiesService.h",
"DetectorInfoServices/DetectorPropertiesService.h")
89 Subst.AddWord (
"Utilities/DetectorClocksService.h",
"DetectorInfoServices/DetectorClocksService.h")
90 Subst.AddWord (
"Utilities/TimeService.h",
"DetectorInfoServices/DetectorClocksService.h")
91 Subst.AddWord (
"Utilities/RunHistoryService.h",
"DetectorInfoServices/RunHistoryService.h")
92 Subst.AddWord (
"Utilities/LArPropertiesServiceStandard.h",
"DetectorInfoServices/LArPropertiesServiceStandard.h")
93 Subst.AddWord (
"Utilities/DetectorPropertiesServiceStandard.h",
"DetectorInfoServices/DetectorPropertiesServiceStandard.h")
94 Subst.AddWord (
"Utilities/DetectorClocksServiceStandard.h",
"DetectorInfoServices/DetectorClocksServiceStandard.h")
95 Subst.AddWord (
"Utilities/RunHistoryServiceStandard.h",
"DetectorInfoServices/RunHistoryServiceStandard.h")
98 Subst.AddWord (
"util::LArProperties",
"detinfo::LArPropertiesService")
99 Subst.AddWord (
"util::DetectorProperties",
"detinfo::DetectorPropertiesService")
100 Subst.AddWord (
"util::DetectorClocks",
"detinfo::DetectorClocksService")
101 Subst.AddWord (
"util::TimeService",
"detinfo::DetectorClocksService")
104 Subst.AddWord (
"dataprov",
"detinfo")
107 Subst.AddWord (
"util::ElecClock",
"detinfo::ElecClock")
108 Subst.AddWord (
"util::DetectorClocksException",
"detinfo::DetectorClocksException")
109 Subst.AddWord (
"util::kTIME_MAX",
"detinfo::kTIME_MAX")
110 Subst.AddRegExPattern(
r"util::kDEFAULT_(FREQUENCY|FRAME_PERIOD|FREQUENCY_OPTICAL|FREQUENCY_TPC|FREQUENCY_TRIGGER|FREQUENCY_EXTERNAL|MC_CLOCK_T0|TRIG_OFFSET_TPC)",
114 Subst.AddWord (
"util::LArPropertiesService",
"detinfo::LArPropertiesService")
115 Subst.AddWord (
"util::DetectorPropertiesService",
"detinfo::DetectorPropertiesService")
116 Subst.AddWord (
"util::DetectorClocksService",
"detinfo::DetectorClocksService")
117 Subst.AddWord (
"util::RunHistoryService",
"detinfo::RunHistoryService")
118 Subst.AddWord (
"util::LArPropertiesServiceStandard",
"detinfo::LArPropertiesServiceStandard")
119 Subst.AddWord (
"util::DetectorPropertiesServiceStandard",
"detinfo::DetectorPropertiesServiceStandard")
120 Subst.AddWord (
"util::DetectorClocksServiceStandard",
"detinfo::DetectorClocksServiceStandard")
121 Subst.AddWord (
"util::RunHistoryServiceStandard",
"detinfo::RunHistoryServiceStandard")
122 Subst.AddWord (
"util::DetectorClocks",
"detinfo::DetectorClocksService")
125 Subst.AddRegExPattern(
r"art::ServiceHandle\s*<\s*detinfo::(LArProperties|DetectorProperties|DetectorClocks)Service\s*>\s*(\w*)\s*;",
126 r"auto const* \2 = lar::providerFrom<detinfo::\1Service>();");
130 Subst.AddWord (
"IChannelStatusService",
"ChannelStatusService")
133 Subst.AddWord (
"IChannelStatusProvider",
"ChannelStatusProvider")
136 Subst.AddWord (
"IDetPedestalService",
"DetPedestalService")
139 Subst.AddWord (
"IDetPedestalProvider",
"DetPedestalProvider")
145 self.
pattern =
r"(\w*)(\.|->)(Efield|ElectronLifetime|DriftVelocity|BirksCorrection|ModBoxCorrection|Temperature|Density|Eloss|ElossVar)\s*\("
148 match = self.regex.search(s)
149 if not match:
return None
150 varname = match.group(1).lower()
151 if 'detp' in varname:
158 r"Note: LArProperties::\3() has moved to DetectorProperties/DetectorPropertiesService")