From e67bdede5642d4dca2a34507fc3430f216444dc0 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Fri, 30 Aug 2019 08:47:38 +0100
Subject: [PATCH] Add temporary analyses in a futile attempt to add some ID
 monitoring for MT

Because some fool changed all the ID Track collection names without
actually consulting anyone, and didn;t really know what they were doing,
the monitoring broke. In addition the idperf chains upon which we rely
have not been implemented.

This attempts to add some monitoring for standard chains, using the new
track cllections. The new collections may not work, it may be that code
changes are needed to use the new TDT. If the monitoring does not work
because of the actual names themselves, then this won't be fixed since
we are in any case moving to a new naming convention, so will be fixed
during the Great Renaming.
---
 .../python/TrigIDPhysValMonitoringConfig.py   | 28 +++++++++
 .../python/TrigIDtrkMonitoringConfig.py       | 60 ++++++++++++++++++-
 2 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
index 2977518f305..40aa8a4b214 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
@@ -77,6 +77,15 @@ def TrigIDPhysValMonitoringTool():
     ]
     outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
 
+
+    name = "ElectronDuff"
+    pdgid = 11
+    useHighestPT = True
+    chainnames = [
+      "HLT_e.*:xAODTracks_Electron"
+    ]
+    outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
+
     name = "Electron_offline"
     pdgid = 11
     useHighestPT = True
@@ -98,6 +107,15 @@ def TrigIDPhysValMonitoringTool():
     ]
     outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
 
+    name = "MuonDuff"
+    pdgid = 13
+    useHighestPT = True
+    chainnames = [
+      "HLT_mu.*:xAODTracks_Muon"
+    ]
+    outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
+
+
     ############### Muons ###############
     name = "Muon_offline"
     pdgid = 13
@@ -122,6 +140,16 @@ def TrigIDPhysValMonitoringTool():
     ]
     outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
 
+    name = "TauDuff"
+    pdgid = 15
+    useHighestPT = True
+    chainnames = [
+      "HLT_tau.*:key=xAODTracks_TauCore",
+      "HLT_tau.*:key=xAODTracks_TauIso",
+      "HLT_tau.*:key=xAODTracks_Tau"
+    ]
+    outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT )]
+
     ############### Taus ###############
     name = "Tau_offline"
     pdgid = 15
diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
index bb0711694b2..bc55621030e 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
@@ -50,7 +50,7 @@ def TrigIDtrkMonitoringTool():
 			"HLT_id_cosmic.*:InDetTrigTrackingxAODCnv_CosmicsN_EFID",
 			"HLT_id_cosmic.*:InDetTrigTrackingxAODCnvIOTRT_CosmicsN_EFID"
 			]
-		#ToolSvc += tidacosshift;
+		# ToolSvc += tidacosshift;
 		list += [ tidacosshift ]
 
 
@@ -72,8 +72,9 @@ def TrigIDtrkMonitoringTool():
                         "HLT_e.*idperf.*:InDetTrigTrackingxAODCnv_Electron_FTF",
                         "HLT_e.*_gsf_idperf:GSFTrigTrackParticles"
                         ]
-                ToolSvc += tidaegamma
-                list += [ "TrigTestBase/IDEgammaTool" ]
+	        #  ToolSvc += tidaegamma
+                # list += [ "TrigTestBase/IDEgammaTool" ]
+		list += [ tidaegamma ]
 
 
 
@@ -105,6 +106,26 @@ def TrigIDtrkMonitoringTool():
 		list += [ tidaegammashift ]
 
 
+
+		# Expert instances 
+		tidaegammaduff = TrigTestBase(name = "IDEgammaDuffTool",
+					  histoPathBase = "/Trigger/HLT")
+		tidaegammaduff.AnalysisConfig = "Tier0"
+		tidaegammaduff.SliceTag = "HLT/TRIDT/EgammaDuff/Expert"
+		# tidabase.OutputLevel = DEBUG
+		tidaegammaduff.UseHighestPT = True
+		tidaegammaduff.ntupleChainNames += [
+                        "Offline",
+                        "HLT_e.*:xAODTracks_Electron",
+                        "HLT_e.*_gsf_idperf:GSFTrigTrackParticles"
+                        ]
+                list += [ tidaegammaduff ]
+
+
+
+
+
+
 		# Shifter purity instances 
 		tidaegammapurity = TrigTestBase(name = "IDEgammaPurityTool",
 					       histoPathBase = "/Trigger/HLT")
@@ -154,6 +175,9 @@ def TrigIDtrkMonitoringTool():
 		list += [ tidamuon ]
 
 
+
+
+
 		# Shifter instances 
 		tidamuonshift = TrigTestBase(name = "IDMuonShifterTool",
 					histoPathBase = "/Trigger/HLT")
@@ -200,6 +224,19 @@ def TrigIDtrkMonitoringTool():
 		list += [ tidamuonpurity ]
 
 
+		# Expert instances 
+		tidamuonduff = TrigTestBase(name = "IDMuonDuffTool",
+					histoPathBase = "/Trigger/HLT")
+		tidamuonduff.AnalysisConfig = "Tier0"
+		tidamuonduff.SliceTag = "HLT/TRIDT/MuonDuff/Expert"
+		tidamuonduff.UseHighestPT = True
+		# tidabase.OutputLevel = DEBUG
+		tidamuonduff.ntupleChainNames += [
+			"Offline",
+			"HLT_mu.*:xAODTracks_Muon",
+			]
+		# ToolSvc += tidamuon;
+		list += [ tidamuonduff ]
 
 
 
@@ -263,6 +300,23 @@ def TrigIDtrkMonitoringTool():
 		#ToolSvc += tidataupurity;
 		list += [ tidataupurity ]
 		
+
+		# Expert Duff instances 
+		tidatauduff = TrigTestBase(name = "IDTauTool",
+				       histoPathBase = "/Trigger/HLT")
+		tidatauduff.AnalysisConfig = "Tier0"
+		tidatauduff.SliceTag = "HLT/TRIDT/Tau/Expert"
+		tidatauduff.UseHighestPT = True
+		tidatauduff.ntupleChainNames += [
+			"Offline",
+			"HLT_tau.*tracktwo.*:key=xAODTracks_TauCore",
+			"HLT_tau.*tracktwo.*:key=xAODTracks_TauIso",
+			"HLT_tau.*tracktwo.*:key=xAODTracks_TauTau"
+			]
+		#ToolSvc += tidatau;
+		list += [ tidatauduff ]
+
+		
                 
                 ##############################################################
                 # Bjet instances - check track collection names
-- 
GitLab