From 1e754066a714e5eb7699d8257768f082e43ef996 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Tue, 11 Apr 2017 15:16:04 +0200
Subject: [PATCH] Fix bug causing LargeD0 job options to ignore efficiency
 histograms

LargeD0 job options were missing the efficiency histograms, this commit fixes that.
In addition, several  (but not all) requests to delete instead of comment out lines
were commented by the L1 MR shifter and have been incorporated in this update.
I have also attempted to delete the cmt folder...
---
 .../InDetPhysValMonitoring/cmt/requirements   | 81 -------------------
 .../src/AthTruthSelectionTool.cxx             |  2 +-
 .../src/InDetDummyPlots.cxx                   |  3 -
 .../src/InDetPhysValLargeD0Tool.cxx           |  7 ++
 4 files changed, 8 insertions(+), 85 deletions(-)
 delete mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements b/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements
deleted file mode 100644
index ad23a8b1429..00000000000
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements
+++ /dev/null
@@ -1,81 +0,0 @@
-package InDetPhysValMonitoring
-author  sroe
-
-## for athena policies: this has to be the first use statement
-use AtlasPolicy 	AtlasPolicy-*
-
-## for gaudi tools, services and objects
-use GaudiInterface 	GaudiInterface-* 	External
-
-## put here your package dependencies...
-
-#use AsgTools            AsgTools-*              Control/AthToolSupport
-
-public
-use xAODTruth           xAODTruth-*             Event/xAOD
-use AthenaMonitoring    AthenaMonitoring-*      Control
-use TrkValHistUtils     TrkValHistUtils-*       Tracking/TrkValidation
-use xAODTracking        xAODTracking-*          Event/xAOD
-use AtlasROOT           AtlasROOT-*             External
-use PATCore             PATCore-*               PhysicsAnalysis/AnalysisCommon
-use InDetTrackSelectionTool InDetTrackSelectionTool-*  InnerDetector/InDetRecTools   
-use AthenaBaseComps     AthenaBaseComps-*       Control
-use AtlasDetDescr               AtlasDetDescr-*         DetectorDescription
-use InDetIdentifier             InDetIdentifier-*       InnerDetector/InDetDetDescr
-use InDetReadoutGeometry  InDetReadoutGeometry-* InnerDetector/InDetDetDescr
-use xAODBase            xAODBase-*             Event/xAOD
-
-
-private
-use AtlasXercesC        AtlasXercesC-*        	External
-use AtlasBoost          AtlasBoost-*                    External
-use TrkExInterfaces		TrkExInterfaces-*		Tracking/TrkExtrapolation
-use TrkToolInterfaces           TrkToolInterfaces-*     Tracking/TrkTools
-use AtlasROOT           AtlasROOT-*             External
-#use GeneratorUtils      GeneratorUtils-*        Generators
-use TrkParameters       TrkParameters-*         Tracking/TrkEvent
-use TrkSurfaces		TrkSurfaces-*		Tracking/TrkDetDescr
-use InDetRIO_OnTrack            InDetRIO_OnTrack-*      InnerDetector/InDetRecEvent
-use TrkEventPrimitives          TrkEventPrimitives-*    Tracking/TrkEvent
-use TrkTrack                    TrkTrack-*              Tracking/TrkEvent
-use GeoPrimitives               GeoPrimitives-*         DetectorDescription
-use EventPrimitives     EventPrimitives-*       Event
-use xAODEventInfo	      xAODEventInfo-*		Event/xAOD
-use  MCTruthClassifier          MCTruthClassifier-*             PhysicsAnalysis 
-use InDetBeamSpotService InDetBeamSpotService-* InnerDetector/InDetConditions
-use xAODJet             xAODJet-*               Event/xAOD
-use AsgTools            AsgTools-*              Control/AthToolSupport
-use PathResolver         PathResolver-*         Tools
-
-use InDetPrepRawData            InDetPrepRawData-*      InnerDetector/InDetRecEvent
-use AthenaKernel     AthenaKernel-*       Control
-use TrkTrack         TrkTrack-*           Tracking/TrkEvent
-# for the DummyTrackSlimmingTool
-use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools/
-
-branches src src/components doc
-
-# I would like to generate a dictionary, but this crashes in compilation:
-#use AtlasReflex   AtlasReflex-*   External
-#apply_pattern lcgdict dict=InDetPhysValMonitoring selectionfile=selection.xml\
-#headerfiles="../InDetPhysValMonitoring/InDetPhysValMonitoringDict.h"
-
-apply_pattern declare_runtime files="*.hdef *.xml *.xsl"
-
-apply_pattern declare_joboptions files="*.py"
-
-
-## default is to make component library
-library InDetPhysValMonitoring *.cxx components/*.cxx
-apply_tag ROOTEGLibs
-
-#macro_append cppflags ' -std=c++11 '
-#macro_append use_linkopts ' -std=c++11 ' 
-apply_pattern declare_python_modules files="*.py"
-apply_pattern component_library
-end_private
-
-# RTT requirement lines
-macro InDetPhysValMonitoring_TestConfiguration "../test/InDetPhysValMonitoring_TestConfiguration.xml"
-apply_pattern declare_runtime files="*.dat" extras="../test/InDetPhysValMonitoring_TestConfiguration.xml ../scripts/make*.C ../scripts/IDPerf*.py ../scripts/IDRTT_*.sh ../ExtraFiles/ALL*.html"
-
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx
index 7096e63a1cb..dbb13bfb00d 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx
@@ -257,7 +257,7 @@ std::string
 AthTruthSelectionTool::str() const {
   return m_cutFlow.report();
 }
-
+//Following is from Simone Pagan-Griso, to be re-incorporated for specific studies
 /*
 bool AthTruthSelectionTool::acceptExtrapolatedTPToSurface(const xAOD::TruthParticle& p) const
 {
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx
index f366b8800f9..e8d621ea318 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx
@@ -250,10 +250,7 @@ InDetDummyPlots::minDR(float min_dR, float prod_rad, float bestmatch, double BID
     fillHisto(m_minimum_delta_R_not_found_overall, min_dR);
   }
 
-  //fillHisto(m_charge_vs_truth_match_rate, truth_pt, cvst);
   fillHisto(m_min_dR_vs_delta_inverse_pt, BIDPt, min_dR);
-  //fillHisto(m_charge_truth_agreement, prod_rad, cvst);
-  //fillHisto(m_truth_vs_charge_product, charge_product, bestmatch);
 }
 
 void
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx
index 30209bb6a61..5cb33e174c3 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx
@@ -365,6 +365,13 @@ InDetPhysValLargeD0Tool::bookHistograms() {
   for (auto hist : hists) {
     ATH_CHECK(regHist(hist.first, hist.second, all)); // ??
   }
+  // do the same for Efficiencies, but there's a twist:
+  std::vector<EfficiencyData> effs = m_LargeD0Plots->retrieveBookedEfficiencies();
+  for (auto& eff : effs) {
+    // reg**** in the monitoring baseclass doesnt have a TEff version, but TGraph *
+    // pointers just get passed through, so we use that method after an ugly cast
+    ATH_CHECK(regGraph(reinterpret_cast<TGraph*>(eff.first), eff.second, all)); // ??
+  }
   return StatusCode::SUCCESS;
 }
 
-- 
GitLab