From 3851344db6cd71b95fa6128c1da26aa37dc9bb0f Mon Sep 17 00:00:00 2001
From: Dan Guest <dguest@cern.ch>
Date: Tue, 28 Apr 2020 17:27:25 +0200
Subject: [PATCH] Update formatting

This reverts commit 4614e125b5b916d8b5b6b1e2ff288e109f2a09e2.
---
 .../FlavorTagDiscriminants/customGetter.h     | 28 +++++++++++++++----
 .../Root/customGetter.cxx                     |  9 +++---
 2 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/customGetter.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/customGetter.h
index 0724a003693..273828f10ae 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/customGetter.h
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/customGetter.h
@@ -19,11 +19,29 @@
 
 namespace FlavorTagDiscriminants {
 
-  using VectorTP = std::vector<const xAOD::TrackParticle*>;
-  using VectorD = std::vector<double>;
-  std::function<VectorD(const xAOD::Jet&,const VectorTP&)> customSeqGetter(
-    const std::string& name);
-
+  // Factory function to produce TrackParticle -> vector<double> functions
+  //
+  // DL2 configures the its inputs when the algorithm is initalized,
+  // meaning that the list of track and jet properties that are used
+  // as inputs won't be known at compile time. Instead we build an
+  // array of "getter" functions, each of which returns one input for
+  // the tagger. The function here returns those getter functions.
+  //
+  // Many of the getter functions are trivial: they will, for example,
+  // read one double of auxdata off of the BTagging object. The
+  // sequence input getters tend to be more complicated. Since we'd
+  // like to avoid reimplementing the logic in these functions in
+  // multiple places, they are exposed here.
+  //
+  // This function will return a getter based on a string key. See the
+  // implementation for the definitions.
+  //
+  std::function<std::vector<double>(
+    const xAOD::Jet&,
+    const std::vector<const xAOD::TrackParticle*>&)>
+  customSequenceGetter(const std::string& name);
+
+  // internal functions
   namespace internal {
     std::function<std::pair<std::string, double>(const xAOD::Jet&)>
     customGetterAndName(const std::string&);
diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
index 3d7c594adc9..800a1d54da7 100644
--- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
+++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/customGetter.cxx
@@ -95,7 +95,7 @@ namespace FlavorTagDiscriminants {
       const xAOD::Jet&,
       const std::vector<const xAOD::TrackParticle*>&)>
     customNamedSeqGetter(const std::string& name) {
-      auto getter = customSeqGetter(name);
+      auto getter = customSequenceGetter(name);
       return [name, getter](const xAOD::Jet& j,
                             const std::vector<const xAOD::TrackParticle*>& t) {
                return std::make_pair(name, getter(j, t));
@@ -108,9 +108,10 @@ namespace FlavorTagDiscriminants {
   // These functions are wrapped by the customNamedSeqGetter function
   // below to become the ones that are actually used in DL2.
   //
-  std::function<VectorD(const xAOD::Jet&,const VectorTP&)> customSeqGetter(
-    const std::string& name)
-  {
+  std::function<std::vector<double>(
+    const xAOD::Jet&,
+    const std::vector<const xAOD::TrackParticle*>&)>
+  customSequenceGetter(const std::string& name) {
     typedef std::vector<const xAOD::TrackParticle*> Tracks;
     if (name == "IP3D_signed_d0_significance") {
       return SignedD0SequenceGetter();
-- 
GitLab