Skip to content
Snippets Groups Projects

New PID Substitution DaVinci Tool

Merged Jiahui Zhuo requested to merge jzhuo_SubsPID into master
2 files
+ 8
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -22,7 +22,7 @@ class SubstitutePID:
SubstitutePID is an DaVinci python tool which can configure easily the PID substitution
for DaVinci and create functors to access the necesary information.
The substitution syntax is the following:
' Old_Particle{{New_Particle}} '
' Old_PID{{New_PID}} '
Args:
Input (DataHandle): the Input data handle (TES).
@@ -128,7 +128,9 @@ class SubstitutePID:
def _GetSubsitutionMap(self, Subsitutions: list):
if self.OutputLevel <= VERBOSE:
print("SubstitutePID: Start extending the substitution rule to substitution map...")
print("==============================")
print("SubstitutePID will extend the substitution rules to the following substitution map:")
print("{")
# Compile the regex
find_subs = re.compile(r'{{(.*?)}}')
@@ -171,9 +173,10 @@ class SubstitutePID:
if self.OutputLevel <= VERBOSE:
for key, value in SubstitutionMap.items():
print(f"\t '{key}' : '{value}'")
print(f"\t '{key}' : '{value}',")
if self.OutputLevel <= VERBOSE:
print("SubstitutePID: Done")
print("}")
print("==============================")
return SubstitutionMap
Loading