From f898e9dba60745254e337b48f78714b67d1dfbdd Mon Sep 17 00:00:00 2001
From: Fabrizio Trovato <fabrizio.trovato@cern.ch>
Date: Thu, 20 Aug 2020 10:28:58 +0200
Subject: [PATCH] Centralising configuration of time monitoring

---
 .../TrigInDetValidation/python/TrigInDetArtSteps.py         | 6 +++++-
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py  | 4 +---
 .../TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py  | 4 +---
 .../test/test_trigID_all_ttbar_pu80_mt.py                   | 5 +----
 .../test/test_trigID_all_ttbar_pu80_mt2.py                  | 5 +----
 .../test/test_trigID_bjet_olddata_pu40.py                   | 5 +----
 .../TrigInDetValidation/test/test_trigID_bjet_pu40.py       | 5 +----
 .../TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py  | 6 ++----
 .../TrigInDetValidation/test/test_trigID_el_singlee_7-80.py | 6 ++----
 .../test/test_trigID_el_singlee_7-80_larged0.py             | 6 ++----
 .../test/test_trigID_el_singlee_7-80_larged0_pu.py          | 6 ++----
 .../test/test_trigID_el_singlee_7-80_pu40.py                | 6 ++----
 .../TrigInDetValidation/test/test_trigID_el_zee_pu40.py     | 6 ++----
 .../TrigInDetValidation/test/test_trigID_mu_bphys.py        | 6 ++----
 .../test/test_trigID_mu_singlemu_larged0.py                 | 6 ++----
 .../test/test_trigID_mu_singlemu_larged0_pu.py              | 6 ++----
 .../TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py   | 6 ++----
 .../test/test_trigID_mu_zmumu_pu40_build.py                 | 5 +----
 .../test/test_trigID_tau_ztautau_pu46.py                    | 6 ++----
 19 files changed, 34 insertions(+), 71 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 96e385c08ba..5f4b9012bea 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -200,7 +200,7 @@ class TrigInDetCpuCostStep(RefComparisonStep):
     '''
     Execute TIDAcpucost for expert-monitoring.root files.
     '''
-    def __init__(self, name='TrigInDetCpuCost'):
+    def __init__(self, name='TrigInDetCpuCost', ftf_times=True):
         super(TrigInDetCpuCostStep, self).__init__(name)
         self.input_file = 'expert-monitoring.root'
 ##        self.ref_file = 'expert-monitoring.root'   #### need to add reference file here 
@@ -209,6 +209,10 @@ class TrigInDetCpuCostStep(RefComparisonStep):
         self.auto_report_result = True
         self.required = True
         self.executable = 'TIDAcpucost'
+
+        if ftf_times:
+            self.args += ' -d TrigFastTrackFinder_'
+            self.output_dir = 'times-FTF'
     
     def configure(self, test):
         #self.args += self.input_file+' '+self.ref_file+' '+' -o '+self.output_dir
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
index b50f16ebca3..18ac10bd76f 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu40.py
@@ -125,12 +125,10 @@ comp9.test='ttbar'
 test.check_steps.append(comp9)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
index 1e681c56d10..5b1a2c7fcd2 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py
@@ -125,12 +125,10 @@ comp9.test='ttbar'
 test.check_steps.append(comp9)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
index fb63e129a14..a80b3ee89ca 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py
@@ -125,14 +125,11 @@ comp9.test='ttbar'
 test.check_steps.append(comp9)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
-
 import sys
 sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
index c7a3332193e..88b45da85e3 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt2.py
@@ -125,14 +125,11 @@ comp9.test='ttbar'
 test.check_steps.append(comp9)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
-
 import sys
 sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py
index 836728c553d..54e6890a8d4 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_olddata_pu40.py
@@ -95,14 +95,11 @@ test.check_steps.append(comp2)
 
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
-
 import sys
 sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
index b5db71c7748..9d8f6ee811d 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py
@@ -88,14 +88,11 @@ test.check_steps.append(comp2)
 
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
-
 import sys
 sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py
index 30139a1d361..d99fe66de79 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_jpsiee_pu40.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
index 433e2a6938f..ecdc64439e8 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += ' -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
index 8526344197b..8781ebf562d 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py
index 3a133ef7b13..a683d28e504 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_larged0_pu.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
index 37ff4ce403e..1f3f2170673 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_singlee_7-80_pu40.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
index 07e6aa2ca83..b2672c06049 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFele'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
index 1df228546ed..140121ab15c 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_bphys.py
@@ -84,12 +84,10 @@ comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
index d733f1d48d8..3ee5c8fff60 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
index 1c7e381f633..23f6716ea8e 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_singlemu_larged0_pu.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
index aa41998c354..3a51f6db8c7 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py
@@ -91,12 +91,10 @@ comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
index 65160fcad99..0a054bb18b4 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py
@@ -60,14 +60,11 @@ comp2.flag = 'EFmuon'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
 
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
-
 import sys
 sys.exit(test.run())
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
index 1552c73203a..b551354a4c6 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_tau_ztautau_pu46.py
@@ -85,12 +85,10 @@ comp2.flag = 'EFtau'
 test.check_steps.append(comp2)
 
 # CPU cost steps
-cpucost=TrigInDetCpuCostStep('CpuCostStep1')
+cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False)
 test.check_steps.append(cpucost)
- 
+
 cpucost2=TrigInDetCpuCostStep('CpuCostStep2')
-cpucost2.args += '  -d TrigFastTrackFinder_'
-cpucost2.output_dir = 'times-FTF' 
 test.check_steps.append(cpucost2)
 
 import sys
-- 
GitLab