From 8f263a483be448d4a5a75dca4fa444ccce2685a2 Mon Sep 17 00:00:00 2001
From: Jovan Mitrevski <Jovan.Mitrevski@cern.ch>
Date: Thu, 25 Jan 2018 10:53:25 +0100
Subject: [PATCH] Updated the vector<vector<int>> parser and IsoGetter.py

---
 .../RecoAlgs/IsolationAlgs/python/IsoGetter.py   | 13 ++++++-------
 .../IsolationAlgs/src/IsolationBuilder.h         | 16 ++++++++--------
 .../IsolationAlgs/src/VectorVectorIntParser.cxx  |  8 ++++----
 .../IsolationAlgs/src/VectorVectorIntParser.h    |  6 +++++-
 4 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
index 3b009d73860..9fb6a26aa8c 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
@@ -161,8 +161,7 @@ CaloIsolationTool = ToolFactory(xAOD__CaloIsolationTool,name = "CaloIsolationToo
                                 IsoLeakCorrectionTool           = IsoCorrectionTool,
                                 EMCaloNums                      = [SUBCALO.LAREM],
                                 HadCaloNums                     = [SUBCALO.LARHEC, SUBCALO.TILE],
-                                UseEMScale                      = True,
-                                OutputLevel                     = 3)
+                                UseEMScale                      = True)
 
 TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool, name = 'TrackIsolationTool')
 from AthenaCommon import CfgMgr
@@ -229,12 +228,12 @@ isoBuilder = AlgFactory(IsolationBuilder,
                         TrackIsolationTool    = TrackIsolationTool, 
                         FeIsoTypes            = [[]] if not rec.doEgamma() else IsoTypesFe,
                         FeCorTypes            = IsoCorFe,
-			EgIsoTypes            = [[]] if not rec.doEgamma() else IsoTypes,
-                        EgCorTypes            = IsoCorEg,
+			ElIsoTypes            = [[]] if not rec.doEgamma() else IsoTypes,
+                        ElCorTypes            = IsoCorEg,
+			PhIsoTypes            = [[]] if not rec.doEgamma() else IsoTypes,
+                        PhCorTypes            = IsoCorEg,
 			MuIsoTypes            = IsoTypes if rec.doMuon() and muonRecFlags.doMuonIso() else [[]],
-                        MuCorTypes            = IsoCorMu,
-                        LeakageTool           = None,
-                        OutputLevel           = 3)
+                        MuCorTypes            = IsoCorMu)
 
 from RecExConfig.Configured import Configured
 class isoGetter ( Configured ) :
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.h b/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.h
index ccb6c5c3f52..de89ad30dd5 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.h
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.h
@@ -124,35 +124,35 @@ class IsolationBuilder
   /** @brief Isolation types (for the alg. properties, only vector<vector<double>> available */
   Gaudi::Property<std::vector<std::vector<int> > > m_elisoInts {this,
       "ElIsoTypes", {}, 
-      "The isolation types to do for electrons: vector of vector of enum type Iso::IsolationType, stored as float"};
+      "The isolation types to do for electrons: vector of vector of enum type Iso::IsolationType"};
 
   Gaudi::Property<std::vector<std::vector<int> > > m_elcorInts {this,
       "ElCorTypes", {}, 
-      "The correction types to do for electron iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection, stored as float"};
+      "The correction types to do for electron iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection"};
 
   /** @brief Isolation types (for the alg. properties, only vector<vector<double>> available */
   Gaudi::Property<std::vector<std::vector<int> > > m_phisoInts {this,
       "PhIsoTypes", {}, 
-      "The isolation types to do for photons: vector of vector of enum type Iso::IsolationType, stored as float"};
+      "The isolation types to do for photons: vector of vector of enum type Iso::IsolationType"};
 
   Gaudi::Property<std::vector<std::vector<int> > > m_phcorInts {this,
       "PhCorTypes", {}, 
-      "The correction types to do for photons iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection, stored as float"};
+      "The correction types to do for photons iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection"};
 
   Gaudi::Property<std::vector<std::vector<int> > > m_muisoInts {this,
       "MuIsoTypes", {}, 
-      "The isolation types to do for Muons : vector of vector of enum type Iso::IsolationType, stored as float"};
+      "The isolation types to do for Muons : vector of vector of enum type Iso::IsolationType"};
 
   Gaudi::Property<std::vector<std::vector<int> > > m_mucorInts {this,
       "MuCorTypes", {}, 
-      "The correction types to do for Muon iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection, stored as float"};
+      "The correction types to do for Muon iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection"};
   Gaudi::Property<std::vector<std::vector<int> > > m_fecorInts {this,
       "FeCorTypes", {}, 
-      "The correction types to do for forward electron iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection, stored as float"};
+      "The correction types to do for forward electron iso: vector of vector of enum type Iso::IsolationCalo/TrackCorrection"};
 
   Gaudi::Property<std::vector<std::vector<int> > > m_feisoInts {this,
       "FeIsoTypes", {},
-      "The isolation types to do for forward electron: vector of vector of enum type Iso::IsolationType, stored as float"};
+      "The isolation types to do for forward electron: vector of vector of enum type Iso::IsolationType"};
 
   Gaudi::Property<bool> m_addCoreCorr{this, "AddCoreCorr", true, 
       "Add core correction for muon calo isolation"};
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.cxx b/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.cxx
index 0cd1d38cb76..e5634bd37be 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.cxx
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.cxx
@@ -10,8 +10,8 @@
 // Includes needed for the custom type
 #include <vector>
 #include <string>
-// A typedef may save a lot of mistakes
-typedef std::vector<std::vector<int> > MyCustomType;
+
+#include "VectorVectorIntParser.h"
 
 // Define the parser
 #include "GaudiKernel/ParsersFactory.h"
@@ -22,7 +22,7 @@ namespace Gaudi
   {
 
     // Parse function... nothing special, but it must be done explicitely.
-    StatusCode parse( MyCustomType& result, const std::string& input ) { return parse_( result, input ); }
+    StatusCode parse( VecVecInt_t& result, const std::string& input ) { return parse_( result, input ); }
   }
 }
 
@@ -32,7 +32,7 @@ namespace Gaudi
 namespace std
 {
   // This is an example valid for any mapping type.
-  ostream& operator<<( ostream& s, const MyCustomType& vecvec )
+  ostream& operator<<( ostream& s, const Gaudi::Parsers::VecVecInt_t& vecvec )
   {
     s << '{';
     for ( const auto& vec : vecvec ) {
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.h b/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.h
index bf542133c8b..4286dc7f57b 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.h
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/src/VectorVectorIntParser.h
@@ -14,14 +14,18 @@
 #include <string>
 #include <vector>
 
+
 #include "GaudiKernel/StatusCode.h"
 namespace Gaudi
 {
   namespace Parsers
   {
 
+    // A typedef may save a lot of mistakes
+    typedef std::vector<std::vector<int> > VecVecInt_t;
+
     // Parse function... nothing special, but it must be done explicitely.
-    StatusCode parse( std::vector<std::vector<int> > & result, const std::string& input );
+    StatusCode parse( VecVecInt_t & result, const std::string& input );
   }
 }
 
-- 
GitLab