diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlg.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlg.h
deleted file mode 100644
index 2454584cb4cc5de6987bb13a9c3e6c65686c3021..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlg.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef DVFILTERALG_H
-#define DVFILTERALG_H
-
-/** 
- Class definition for DV filter algorithm
-author: Nick Barlow
- **/
-
-#include <string>
-#include <vector>
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-namespace Reco {
-  class ITrackToVertex;
-}
-
-
-class DVFilterAlg : public AthFilterAlgorithm {
-public: // Constructor and Destructor
-
-   DVFilterAlg(const std::string& name, ISvcLocator* pSvcLocator);
-   /// Destructor
-   virtual ~DVFilterAlg();
-
-public:
-   /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
-private:
-
-   int m_nProcessed;
-   int m_nPassMuonCut;
-
-   ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
-   bool m_passAll;
-   std::string m_primVtxName;
-   std::string m_muonCollName;
-   float m_muonPtCut;
-   float m_muonEtaCut;
-   float m_muonD0Cut;
-
-};
-
-
-#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgDiElectron.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgDiElectron.h
deleted file mode 100644
index 4435c64c9d9c1e1b23a72e7c3ab47d8db756ecb0..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgDiElectron.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef DVFILTERALGDIELECTRON_H
-#define DVFILTERALGDIELECTRON_H
-
-/** 
- Class definition for DV filter algorithm
- **/
-
-#include <string>
-#include <vector>
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-namespace Reco {
-  class ITrackToVertex;
-}
-
-
-class DVFilterAlgDiElectron : public AthFilterAlgorithm {
-public: // Constructor and Destructor
-
-   DVFilterAlgDiElectron(const std::string& name, ISvcLocator* pSvcLocator);
-   /// Destructor
-   virtual ~DVFilterAlgDiElectron();
-
-public:
-   /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
-private:
-
-   int m_nProcessed;
-   int m_nPassElectronCut;
-   int m_diElectronCounter;
-
-   ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
-   bool m_passAll;
-   std::string m_primVtxName;
-   std::string m_electronCollName;
-   float m_dielectronPtCut;
-   float m_dielectronEtaCut;
-   float m_dielectronD0Cut;
-
-
-};
-
-
-#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgEgamma.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgEgamma.h
deleted file mode 100644
index 71569227c1a31c0a13eb5ba99a3be7fd4e2c7ae5..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVFilterAlgEgamma.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef DVFILTERALGEGAMMA_H
-#define DVFILTERALGEGAMMA_H
-
-/** 
- Class definition for DV filter algorithm
- **/
-
-#include <string>
-#include <vector>
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-namespace Reco {
-  class ITrackToVertex;
-}
-
-
-class DVFilterAlgEgamma : public AthFilterAlgorithm {
-public: // Constructor and Destructor
-
-   DVFilterAlgEgamma(const std::string& name, ISvcLocator* pSvcLocator);
-   /// Destructor
-   virtual ~DVFilterAlgEgamma();
-
-public:
-   /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
-private:
-
-   int m_nProcessed;
-   int m_nPassElectronCut;
-
-   ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
-   bool m_passAll;
-   std::string m_primVtxName;
-   std::string m_electronCollName;
-   float m_electronPtCut;
-   float m_electronEtaCut;
-   float m_electronD0Cut;
-
-};
-
-
-#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMeffFilterTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMeffFilterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a46b7fdccc37216cde580b83208dc437c95696d
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMeffFilterTool.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// SkimmingToolExample.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_DVMEFFFILTERTOOL_H
+#define DERIVATIONFRAMEWORK_DVMEFFFILTERTOOL_H 
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
+
+namespace DerivationFramework {
+
+  /** @class DVMeffFilterTool
+  
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author James Catmore -at- cern.ch
+     */
+  class DVMeffFilterTool : public AthAlgTool, public ISkimmingTool {
+    
+  public: 
+    /** Constructor with parameters */
+    DVMeffFilterTool( const std::string& t, const std::string& n, const IInterface* p );
+    
+    /** Destructor */
+    ~DVMeffFilterTool();
+    
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+    
+    /** Check that the current event passes this filter */
+    virtual bool eventPassesFilter() const;
+    
+  private:
+    mutable unsigned int m_ntot;
+    mutable unsigned int m_npass;
+    std::string m_metSGKey;
+    std::string m_jetSGKey; 
+    double m_MeffCut;
+    double m_METoverMeffCut;
+    double m_jetPtCut;
+    double m_jetEtaCut;
+    double m_METCut;
+
+  }; 
+  
+}
+
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMissingETFilterTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMissingETFilterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..811f32ccf2998390cede3984b3ca967c406da146
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVMissingETFilterTool.h
@@ -0,0 +1,60 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// SkimmingToolExample.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_DVMISSINGETFILTERTOOL_H
+#define DERIVATIONFRAMEWORK_DVMISSINGETFILTERTOOL_H 
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
+
+namespace DerivationFramework {
+
+  /** @class DVMissingETFilterTool
+  
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author James Catmore -at- cern.ch
+     */
+  class DVMissingETFilterTool : public AthAlgTool, public ISkimmingTool {
+    
+  public: 
+    /** Constructor with parameters */
+    DVMissingETFilterTool( const std::string& t, const std::string& n, const IInterface* p );
+    
+    /** Destructor */
+    ~DVMissingETFilterTool();
+    
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+    
+    /** Check that the current event passes this filter */
+    virtual bool eventPassesFilter() const;
+    
+  private:
+    mutable unsigned int m_ntot;
+    mutable unsigned int m_npass;
+    std::string m_metSGKey;
+
+    double m_metCut;
+    bool m_applyDeltaPhiCut;
+    double m_deltaPhiCut;
+    std::string m_jetSGKey; // only needed if we want to cut on dphi(jet,MET)
+
+  }; 
+  
+}
+
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a83353ad0ab25ab118fe63caf406a3e8d844b9b
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// Trackless jets
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_DVTRACKLESSJETFILTERTOOL_H
+#define DERIVATIONFRAMEWORK_DVTRACKLESSJETFILTERTOOL_H 
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
+
+namespace DerivationFramework {
+
+  /** @class DVTracklessJetFilterTool
+  
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author James Catmore -at- cern.ch
+     */
+  class DVTracklessJetFilterTool : public AthAlgTool, public ISkimmingTool {
+    
+  public: 
+    /** Constructor with parameters */
+    DVTracklessJetFilterTool( const std::string& t, const std::string& n, const IInterface* p );
+    
+    /** Destructor */
+    ~DVTracklessJetFilterTool();
+    
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+    
+    /** Check that the current event passes this filter */
+    virtual bool eventPassesFilter() const;
+    
+  private:
+    mutable unsigned int m_ntot;
+    mutable unsigned int m_npass;
+    std::string m_jetSGKey;
+    
+
+    double m_ptCut;
+    double m_etaCut;
+    double m_sumPtTrkCut;
+    int m_nJetsRequired;
+    
+  }; 
+  
+}
+
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HIPsFilterAlg.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HIPsFilterAlg.h
deleted file mode 100644
index 2e9b06f1057b065f9547ee4ab56b8abd97465f3d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HIPsFilterAlg.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef HIPSFILTERALG_H
-#define HIPSFILTERALG_H
-
-/** 
- *  @brief This file contains the class definition for the HIPsFilterAlg class  (originated from MuonFilterAlg). 
- *  @author Sergey Burdin <burdin(at)cern.ch>
- **/
-
-#include <string>
-#include <vector>
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-#include "InDetIdentifier/TRT_ID.h"
-
-class HIPsFilterAlg : public AthFilterAlgorithm {
- public: // Constructor and Destructor
-   /// Standard Service Constructor
-   HIPsFilterAlg(const std::string& name, ISvcLocator* pSvcLocator);
-   /// Destructor
-   virtual ~HIPsFilterAlg();
-
- public:
-   /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
- private:
-   const TRT_ID *m_trtID;
-   // double deltaPhi(double phi1, double phi2);  
-   int m_nProcessed;
-   int m_nEventsPassE;
-   int m_nEventsPassHTTRTnumber;
-   int m_nEventsPassHTTRTfraction;
-   int m_nEventsPassAll;
-   
-   double              m_cutMinE;
-   double              m_cutEtaMax;
-   double              m_cutMaxDeltaPhi;
-   int                 m_cutMinTRTHTHits;
-   double              m_cutMinTRTHTFraction;
-   std::string         m_caloCluster;
-   bool                m_passAll;
-
-};
-
-#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HnlSkimmingTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HnlSkimmingTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..51ecff18e88c5f58b752fb18727853bb0911285b
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/HnlSkimmingTool.h
@@ -0,0 +1,60 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////
+// HnlSkimmingTool.h  (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_HNLSKIMMINGTOOL_H
+#define DERIVATIONFRAMEWORK_HNLSKIMMINGTOOL_H 1
+
+#include<string>
+#include<vector>
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigDecisionTool/TrigDecisionTool.h"
+#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
+#include "xAODMuon/MuonContainer.h"
+
+namespace DerivationFramework {
+
+  class HnlSkimmingTool : public AthAlgTool, public ISkimmingTool {
+   
+  public: 
+    /** Constructor with parameters */
+    HnlSkimmingTool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~HnlSkimmingTool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual bool eventPassesFilter() const;
+
+  private:
+    ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool;
+    std::vector< std::string > m_triggers;
+    std::string m_muonSGKey;
+    float m_mu1PtMin;
+    float m_mu1AbsEtaMax;
+    std::vector< int > m_mu1Types;
+    int m_mu1IsoType; //http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODPrimitives/xAODPrimitives/IsolationType.h
+    int m_mu1IsoCutIsRel; //is the isolation cut relative or absolute
+    float m_mu1IsoCut; //cut value
+    float m_mu2PtMin;
+    float m_mu2AbsEtaMax;
+    std::vector< int > m_mu2Types;
+    int m_mu2IsoType;
+    int m_mu2IsoCutIsRel;
+    float m_mu2IsoCut;
+    float m_mu2d0Min;
+
+  }; 
+ 
+}
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkSingleJetMetFilterTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkSingleJetMetFilterTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..7809e2b012b08928b5fc2db0dd54baab0c5af684
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkSingleJetMetFilterTool.h
@@ -0,0 +1,65 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// KinkTrkSingleJetFilterTool.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_KINKTRKSINGLEJETMETFILTERTOOL_H
+#define DERIVATIONFRAMEWORK_KINKTRKSINGLEJETMETFILTERTOOL_H 1
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
+
+#include "MuonSelectorTools/IMuonSelectionTool.h"
+
+namespace DerivationFramework {
+  class KinkTrkSingleJetMetFilterTool : public AthAlgTool, public ISkimmingTool {
+
+  public: 
+    /** Constructor with parameters */
+    KinkTrkSingleJetMetFilterTool( const std::string& t, const std::string& n, const IInterface* p );
+    
+    /** Destructor */
+    ~KinkTrkSingleJetMetFilterTool();
+    
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+    
+    /** Check that the current event passes this filter */
+    virtual bool eventPassesFilter() const;
+    
+  private:
+    mutable unsigned int m_ntot;
+    mutable unsigned int m_npass;
+    bool m_passAll;
+    bool m_LeptonVeto;
+    std::string m_jetSGKey;
+    std::string m_metSGKey;
+    std::string m_metTerm;
+    ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
+    std::string m_muonSGKey;
+    std::string m_muonIDKey;
+    std::string m_electronSGKey;
+    std::string m_electronIDKey;
+    float m_metCut;
+    std::vector<float> m_jetPtCuts;
+    float m_jetEtaMax;
+    float m_jetMetDphiMin;
+    float m_leptonPtCut;
+    float m_leptonEtaMax;
+
+  }; 
+  
+}
+
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZeeTagTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZeeTagTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..a9e9b071f2272ec549d23354c706e8c62f2c55f7
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZeeTagTool.h
@@ -0,0 +1,80 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// KinkTrkZeeTagTool.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_KINKTRKZEETAGTOOL_H
+#define DERIVATIONFRAMEWORK_KINKTRKZEETAGTOOL_H 1
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigObjectMatching/TrigMatchTool.h"
+#include "TrigDecisionTool/TrigDecisionTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+#include "xAODEgamma/ElectronContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+
+#include<string>
+#include<vector>
+
+namespace DerivationFramework {
+
+  /** @class KinkTrkZeeTagTool
+      @author shimpei.yamamoto@cern.ch
+     */
+  class KinkTrkZeeTagTool : public AthAlgTool, public IAugmentationTool {
+   
+  public: 
+    /** Constructor with parameters */
+    KinkTrkZeeTagTool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~KinkTrkZeeTagTool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    bool passTrigger(const std::vector<std::string>& triggers) const;
+    bool checkTagElectron(const xAOD::Electron *ele) const;
+    bool checkCluster(const xAOD::CaloCluster *clu) const;
+    bool checkEleClusPair(const xAOD::Electron *ele, const xAOD::CaloCluster *clu) const;
+    bool passElectronQuality(const xAOD::Electron *ele) const;
+    bool passClusterQuality(const xAOD::CaloCluster *clu) const;
+    bool passElectronTrigMatch(const xAOD::Electron *ele, const std::vector<std::string>& triggers) const;
+
+    ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
+    ToolHandle<TrigMatchTool> m_trigMatchTool;
+    std::vector<std::string> m_trigNames;
+    float m_trigMatchDeltaR;
+    bool m_doTrigMatch;
+
+    std::string m_electronSGKey;
+    std::vector<std::string> m_electronIDKeys;
+    float m_electronPtCut;
+    float m_electronEtaMax;
+
+    std::string m_clusterSGKey;
+    float m_clusterEtCut;
+    float m_clusterEtaMax;
+
+    float m_diEleMassLow;
+    float m_diEleMassHigh;
+    float m_dPhiMax;
+
+    std::string m_sgKeyPrefix;
+
+  }; 
+ 
+}
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZmumuTagTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZmumuTagTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..c891261094a1a3c98cc8df24cf2bbd0c092d8ecb
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/KinkTrkZmumuTagTool.h
@@ -0,0 +1,83 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// KinkTrkZmumuTagTool.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_KINKTRKZMUMUTAGTOOL_H
+#define DERIVATIONFRAMEWORK_KINKTRKZMUMUTAGTOOL_H 1
+
+#include<string>
+#include<vector>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "TrigObjectMatching/TrigMatchTool.h"
+#include "TrigDecisionTool/TrigDecisionTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+#include "xAODMuon/MuonContainer.h"
+#include "xAODTracking/TrackParticle.h"
+#include "MuonSelectorTools/IMuonSelectionTool.h"
+
+namespace DerivationFramework {
+
+  /** @class KinkTrkZmumuTagTool
+      @author shimpei.yamamoto@cern.ch
+     */
+  class KinkTrkZmumuTagTool : public AthAlgTool, public IAugmentationTool {
+   
+  public: 
+    /** Constructor with parameters */
+    KinkTrkZmumuTagTool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~KinkTrkZmumuTagTool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    bool passTrigger(const std::vector<std::string>& triggers) const;
+    bool checkTagMuon(const xAOD::Muon *muon) const;
+    bool checkMSTrack(const xAOD::TrackParticle *track) const;
+    bool checkMuonTrackPair(const xAOD::Muon *muon, const xAOD::TrackParticle *track) const;
+    bool passMuonQuality(const xAOD::Muon *muon) const;
+    bool passMSTrackQuality(const xAOD::TrackParticle *track) const;
+    bool passMuonTrigMatch(const xAOD::Muon *muon, const std::vector<std::string>& triggers) const;
+
+    ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
+    ToolHandle<TrigMatchTool> m_trigMatchTool;
+    std::vector<std::string> m_trigNames;
+    float m_trigMatchDeltaR;
+    bool m_doTrigMatch;
+
+    ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
+    std::string m_muonSGKey;
+    std::vector<std::string> m_muonIDKeys;
+    float m_muonPtCut;
+    float m_muonEtaMax;
+
+    std::string m_trackSGKey;
+    float m_trackPtCut;
+    float m_trackEtaMax;
+
+    float m_diMuonMassLow;
+    float m_diMuonMassHigh;
+    float m_dPhiMax;
+    bool m_doOppositeSignReq;
+
+    std::string m_sgKeyPrefix;
+
+  }; 
+ 
+}
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvEgammaIDTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvEgammaIDTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..5d69ce2c99663e899ebb0ef09047cee32b433368
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvEgammaIDTool.h
@@ -0,0 +1,56 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////
+// RpvEgammaIDTool.h  (c) ATLAS Detector software
+// Straight copy of DerivationFrameworkEGamma/EGammaPassSelectionWrapper.h
+// because DerivationFrameworkEGamma is not in AtlasProduction
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_EGAMMAPASSSELECTONWRAPPER_H
+#define DERIVATIONFRAMEWORK_EGAMMAPASSSELECTONWRAPPER_H 1
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+namespace DerivationFramework {
+
+  /** @class RpvEgammaIDTool
+ 
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author James Catmore -at- cern.ch
+     */
+  class RpvEgammaIDTool : public AthAlgTool, public IAugmentationTool {
+   
+  public:
+    /** Constructor with parameters */
+    RpvEgammaIDTool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~RpvEgammaIDTool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    std::vector<std::string> m_qualFlags;
+    std::string m_collName;
+    std::string m_sgPrefix;
+
+  };
+ 
+}
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvElectronD0Tool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvElectronD0Tool.h
new file mode 100644
index 0000000000000000000000000000000000000000..c9706099ca91661dccb25d4a0c2c2ad833eb8bc2
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvElectronD0Tool.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////
+// RpvElectronD0Tool.h  (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_RPVELECTROND0TOOL_H
+#define DERIVATIONFRAMEWORK_RPVELECTROND0TOOL_H 1
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+namespace DerivationFramework {
+
+  /** @class RpvElectronD0Tool
+ 
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author Michael Flowerdew -at- cern.ch
+     */
+  class RpvElectronD0Tool : public AthAlgTool, public IAugmentationTool {
+   
+  public: 
+    /** Constructor with parameters */
+    RpvElectronD0Tool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~RpvElectronD0Tool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    std::string m_collName;
+    std::string m_sgPrefix;
+
+  }; 
+ 
+}
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonD0Tool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonD0Tool.h
new file mode 100644
index 0000000000000000000000000000000000000000..acd092f8e57a7624c943e6ddb5ec710518d5d340
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonD0Tool.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////
+// RpvMuonD0Tool.h  (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_RPVMUOND0TOOL_H
+#define DERIVATIONFRAMEWORK_RPVMUOND0TOOL_H 1
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+namespace DerivationFramework {
+
+  /** @class RpvMuonD0Tool
+ 
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author Michael Flowerdew -at- cern.ch
+     */
+  class RpvMuonD0Tool : public AthAlgTool, public IAugmentationTool {
+   
+  public: 
+    /** Constructor with parameters */
+    RpvMuonD0Tool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~RpvMuonD0Tool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    std::string m_collName;
+    std::string m_sgPrefix;
+
+  }; 
+ 
+}
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonMSTool.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonMSTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c54469ba16a609b28388b5e3dd2d9fb414fd68f
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/RpvMuonMSTool.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////
+// RpvMuonMSTool.h  (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef DERIVATIONFRAMEWORK_RPVMUONMSTOOL_H
+#define DERIVATIONFRAMEWORK_RPVMUONMSTOOL_H 1
+
+#include<string>
+
+// Gaudi & Athena basics
+#include "AthenaBaseComps/AthAlgTool.h"
+
+// DerivationFramework includes
+#include "DerivationFrameworkInterfaces/IAugmentationTool.h"
+
+namespace DerivationFramework {
+
+  /** @class RpvMuonMSTool
+
+      the code used in this implementation is kindly stolen from:
+      atlasoff:: ISF/ISF_Core/ISF_Tools
+
+      @author Michael Flowerdew -at- cern.ch
+     */
+  class RpvMuonMSTool : public AthAlgTool, public IAugmentationTool {
+   
+  public:
+    /** Constructor with parameters */
+    RpvMuonMSTool( const std::string& t, const std::string& n, const IInterface* p );
+   
+    /** Destructor */
+    ~RpvMuonMSTool();
+   
+    // Athena algtool's Hooks
+    StatusCode  initialize();
+    StatusCode  finalize();
+ 
+    /** Check that the current event passes this filter */
+    virtual StatusCode addBranches() const;
+
+  private:
+    std::string m_collName;
+    std::string m_sgPrefix;
+
+  };
+
+}
+
+#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/StealthFilterAlg.h b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/StealthFilterAlg.h
deleted file mode 100644
index 73c4e9a53462a3045762a8a47ffea2e250b0023f..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/LongLivedParticleDPDMaker/StealthFilterAlg.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef STEALTHFILTERALG_H
-#define STEALTHFILTERALG_H
-
-/** 
- *  @brief This file contains the class definition for the StealthFilterAlg class  (originated from MuonFilterAlg). 
- *  @author Heather Russell <hrussell(at)cern.ch>
- **/
-
-#include <string>
-#include <vector>
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-
-
-class StealthFilterAlg : public AthFilterAlgorithm {
- public: // Constructor and Destructor
-   /// Standard Service Constructor
-   StealthFilterAlg(const std::string& name, ISvcLocator* pSvcLocator);
-   /// Destructor
-   virtual ~StealthFilterAlg();
-
- public:
-   /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode execute();
-   StatusCode finalize();
-
- private:
-
-   int m_nProcessed;
-   int m_nEventsPassAll;
-
-   double              m_cutMinTrackSd0;
-   int                 m_cutMinNTracks;
-   float               m_cutMinTrackpT;
-   float               m_cutMinTrackEta;
-   bool                m_passAll;
-
-   std::string         m_trackParticleContainerName;
-   
-};
-
-#endif
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/requirements b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/requirements
index 34d1b60c24595e4cf9c30cda15b8216cb4c2a217..bc4bf4dacac26fa31cabdd7be7525e30106d66e7 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/requirements
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/requirements
@@ -11,26 +11,36 @@ use GaudiInterface              GaudiInterface-*                External
 use AthenaBaseComps             AthenaBaseComps-*               Control
 use AtlasROOT                   AtlasROOT-*                     External
 use AtlasAnalysisRunTime        AtlasAnalysisRunTime-*
-use InDetIdentifier             InDetIdentifier-*               InnerDetector/InDetDetDescr
+##use InDetIdentifier             InDetIdentifier-*               InnerDetector/InDetDetDescr
+use DerivationFrameworkInterfaces   DerivationFrameworkInterfaces-*    PhysicsAnalysis/DerivationFramework
+use TrigDecisionTool            TrigDecisionTool-*              Trigger/TrigAnalysis
+use TrigObjectMatching          TrigObjectMatching-*            Trigger/TrigAnalysis
+use MuonSelectorTools           MuonSelectorTools-*             PhysicsAnalysis/MuonID
+use xAODMuon                    xAODMuon-*                      Event/xAOD
+use xAODTracking                xAODTracking-*                 	Event/xAOD
+use xAODEgamma	                xAODEgamma-*                 	Event/xAOD
+use xAODCaloEvent               xAODCaloEvent-*                	Event/xAOD
 
 private
+use AthenaKernel                AthenaKernel-*                  Control
+use AtlasCLHEP                  AtlasCLHEP-*                    External
+use xAODEventInfo               xAODEventInfo-*			Event/xAOD
+use xAODJet                     xAODJet-*                       Event/xAOD
+use xAODMissingET      		xAODMissingET-*			Event/xAOD
 
-use  Particle                   Particle-*                      Reconstruction
 
-use egammaEvent                 egammaEvent-*                   Reconstruction/egamma
-use muonEvent					muonEvent-*	  			      	Reconstruction/MuonIdentification
-use CaloEvent                   CaloEvent-*                     Calorimeter
 use EventBookkeeperMetaData     EventBookkeeperMetaData-*       Event
 use EventInfo                   EventInfo-*                     Event
+use FourMomUtils                FourMomUtils-*                  Event
 
-use InDetPrepRawData            InDetPrepRawData-*              InnerDetector/InDetRecEvent
-use InDetReadoutGeometry        InDetReadoutGeometry-*          InnerDetector/InDetDetDescr
+##use InDetPrepRawData            InDetPrepRawData-*              InnerDetector/InDetRecEvent
+##use InDetReadoutGeometry        InDetReadoutGeometry-*          InnerDetector/InDetDetDescr
 
-use TRT_DriftFunctionTool       TRT_DriftFunctionTool-*         InnerDetector/InDetRecTools
-use Identifier                  Identifier-*                    DetectorDescription
-use VxVertex            		VxVertex-*              		Tracking/TrkEvent
-use ITrackToVertex              ITrackToVertex-*                Reconstruction/RecoTools
-use EventPrimitives		EventPrimitives-* 		Event
+##use TRT_DriftFunctionTool       TRT_DriftFunctionTool-*         InnerDetector/InDetRecTools
+##use Identifier                  Identifier-*                    DetectorDescription
+
+##use ITrackToVertex              ITrackToVertex-*                Reconstruction/RecoTools
+##use EventPrimitives		EventPrimitives-* 		Event
 
 
 ## declare the directories CMT should know about
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/version.cmt b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/version.cmt
index 9666d60b7cfe5a2bd4610c7eb32a0b0ae5df320d..e378ad973527d1d2dce7ad8c0d9ae5926df897dc 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/version.cmt
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/cmt/version.cmt
@@ -1 +1 @@
-LongLivedParticleDPDMaker-r577085
+LongLivedParticleDPDMaker-r683363
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DVFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DVFlags.py
index 58179d2fa2d07a52c29cfbd00adef57562a0a056..2e04c72477de3317ca4802082bddfabd921c0850 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DVFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DVFlags.py
@@ -7,77 +7,81 @@ import AthenaCommon.SystemOfUnits as Units
 
 primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
 
-class DV_triggerFilterFlags(JobProperty):
+class DV_containerFlags(JobProperty):
     statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    TriggerNames = [] # only put trigger names in this list if you want to override the below stream-specific ones
-    EgammaTriggerNames = [
-		# "EF_g40_loose",
-		# "EF_g60_loose",
-		# "EF_e60_loose",
-		# "EF_g80_loose",
-		# "EF_g100_loose",
-        "EF_g120_loose",
-        "EF_2g40_loose"
-	]
-    JetTauEtmissTriggerNames = ["EF_xe80_tclcw",
-                                "EF_j80_a4tchad_xe100_tclcw_loose",
-                                "EF_4j80_a4tchad_L2FS",
-                                "EF_5j55_a4tchad_L2FS",
-                                "EF_6j45_a4tchad_L2FS_5L2j15"]
-    MuonsTriggerNames = [
-#        "EF_mu40_MSonly",
-#        "EF_mu40_MSonly_barrel",
-#        "EF_mu40_MSonly_barrel_medium",
-#        "EF_mu40_MSonly_barrel_tight",        
-        "EF_mu50_MSonly_barrel_tight"
-    ]
+    photonCollectionName='Photons'
+    electronCollectionName='Electrons'
+    muonCollectionName='Muons'
+    jetCollectionName="AntiKt4EMTopoJets"
+    METCollectionName="MET_LocHadTopo"
     pass
-primRPVLLDESDM.add_JobProperty(DV_triggerFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_containerFlags)
+
+class DV_MultiJetTriggerFlags(JobProperty):
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+    triggers = ["HLT_4j100","HLT_5j85","HLT_5j85_lcw","HLT_5j75_0eta250","EF_6j70","HLT_6j45_0eta240","HLT_7j45"]
+    pass
+primRPVLLDESDM.add_JobProperty(DV_MultiJetTriggerFlags)
 
 ### multi-jet filter just to verify trigger - 4j80 OR 5j55 OR 6j45
-class DV_multiJetFilterFlags(JobProperty):
+
+class DV_4JetFilterFlags(JobProperty):
     statusOn=True
     allowedTypes=['bool']
     StoredValue=True
-    jetCollectionName = "AntiKt6TopoEMJets"
-    jetPtCut=[80.0*Units.GeV, 55.0*Units.GeV, 45.0*Units.GeV]
-    nJetPassed=[4,5,6]
+    cutEtMin=100.0*Units.GeV
+    nPassed=4
     pass
-primRPVLLDESDM.add_JobProperty(DV_multiJetFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_4JetFilterFlags)
 
-class DV_looseFancyJetFilterFlags(JobProperty):
+class DV_5JetFilterFlags(JobProperty):
     statusOn=True
     allowedTypes=['bool']
     StoredValue=True
-    jetPtCut=45.0*Units.GeV
-    nJetPassed=1
-    MaxSumPtTrk=5.0*Units.GeV
+    cutEtMin=75.0*Units.GeV
+    nPassed=5
     pass
-primRPVLLDESDM.add_JobProperty(DV_looseFancyJetFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_5JetFilterFlags)
 
+class DV_6JetFilterFlags(JobProperty):
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+    cutEtMin=50.0*Units.GeV
+    nPassed=6
+    pass
+primRPVLLDESDM.add_JobProperty(DV_6JetFilterFlags)
 
-class DV_fancyJetFilterFlags(JobProperty):
+class DV_7JetFilterFlags(JobProperty):
     statusOn=True
     allowedTypes=['bool']
     StoredValue=True
-    jetPtCut=50.0*Units.GeV
-    nJetPassed=2
-    MaxSumPtTrk=5.0*Units.GeV
+    cutEtMin=45.0*Units.GeV
+    nPassed=7
     pass
-primRPVLLDESDM.add_JobProperty(DV_fancyJetFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_7JetFilterFlags)
 
-class DV_ISRFilterFlags(JobProperty):
+class DV_MuonFilterFlags(JobProperty):
     statusOn=True
     allowedTypes=["bool"]
     StoredValue=True
-    jetCollectionName = "AntiKt6TopoEMJets"    
-    jetPtCut=110.0*Units.GeV
-    deltaPhiCut=2.0
-    cutMetMin=100.0*Units.GeV
+    cutEtMin=60.0*Units.GeV
+    triggers=["HLT_mu60_0eta105_msonly"]
+    nPassed=1
+    pass
+primRPVLLDESDM.add_JobProperty(DV_MuonFilterFlags)
+
+class DV_PhotonFilterFlags(JobProperty):
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue= True
+    cutEtMin=140.0*Units.GeV
+    triggers=["HLT_g140_loose"]
+    nPassed=1
     pass
-primRPVLLDESDM.add_JobProperty(DV_ISRFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_PhotonFilterFlags)
 
 
 class DV_METFilterFlags(JobProperty):
@@ -86,95 +90,46 @@ class DV_METFilterFlags(JobProperty):
     StoredValue=True
     cutMetMin=100.0*Units.GeV
     deltaPhiCut=0.1
+    triggers=["HLT_xe100","HLT_xe100_tc_lcw","HLT_xe100_tc_lcw_wEFMu","HLT_xe100_wEFMu"]
     pass
 primRPVLLDESDM.add_JobProperty(DV_METFilterFlags)
 
-class DV_muonFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    cutEtMin = 50*Units.GeV
-    cutEtaMax = 1.1
-    cutContainerMu='all'
-    usingAOD=False
-    pass
-primRPVLLDESDM.add_JobProperty(DV_muonFilterFlags)
-
-class DV_d0FilterFlagsMuon(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    muD0Cut = 1.5
-    muPtCut=50.0*Units.GeV
-    muEtaCut=1.1
-    pass
-primRPVLLDESDM.add_JobProperty(DV_d0FilterFlagsMuon)
-
-class DV_d0FilterFlagsEgamma(JobProperty):
+class DV_SingleTracklessJetFilterFlags(JobProperty):
     statusOn=True
-    allowedTypes=['bool']
+    allowedTypes=["bool"]
     StoredValue=True
-    electronD0Cut=1.5
-    electronPtCut=110.0*Units.GeV
-    electronEtaCut=5.0
+    cutEtMin=50.0*Units.GeV
+    cutEtaMax=2.5
+    cutSumPtTrkMax=5.0*Units.GeV
     pass
-primRPVLLDESDM.add_JobProperty(DV_d0FilterFlagsEgamma)
+primRPVLLDESDM.add_JobProperty(DV_SingleTracklessJetFilterFlags)
 
-class DV_d0FilterFlagsDiElectron(JobProperty):
+class DV_DoubleTracklessJetFilterFlags(JobProperty):
     statusOn=True
-    allowedTypes=['bool']
+    allowedTypes=["bool"]
     StoredValue=True
-    dielectronD0Cut=1.5
-    dielectronPtCut=40.0*Units.GeV
-    dielectronEtaCut=5.0
+    cutEtMin=50.0*Units.GeV
+    cutEtaMax=2.5
+    cutSumPtTrkMax=5.0*Units.GeV
     pass
-primRPVLLDESDM.add_JobProperty(DV_d0FilterFlagsDiElectron)
+primRPVLLDESDM.add_JobProperty(DV_DoubleTracklessJetFilterFlags)
 
-class DV_photonFilterFlags(JobProperty):
+class DV_MeffFilterFlags(JobProperty):
     statusOn=True
     allowedTypes=['bool']
-    StoredValue= True
-    photonPtCut=110.0*Units.GeV
-    minPhotonPassed=1
-    pass
-primRPVLLDESDM.add_JobProperty(DV_photonFilterFlags)
-
-class DV_photonFilterFlags2(JobProperty):
-    statusOn=True
-    allowedTypes=['bool']
-    StoredValue= True
-    photonPtCut=40.0*Units.GeV
-    minPhotonPassed=2
-    pass
-primRPVLLDESDM.add_JobProperty(DV_photonFilterFlags2)
-
-class DV_jetFilterFlagsMuon(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    jetPtCut=50.0*Units.GeV
-    nJetPassed=2   
+    StoredValue=True
+    cutMeffMin=1.0*Units.TeV ##
+    cutMEToverMeffMin=0.3   ## note that these two cuts are ORed in the code!
+    cutJetPtMin=40.0*Units.GeV
+    cutJetEtaMax=2.5
+    cutMETMin=80.0*Units.GeV
     pass
-primRPVLLDESDM.add_JobProperty(DV_jetFilterFlagsMuon)
+primRPVLLDESDM.add_JobProperty(DV_MeffFilterFlags)
 
-class DV_jetFilterFlagsEgamma(JobProperty):
+class DV_PrescalerFlags(JobProperty):
     statusOn=True
     allowedTypes=['bool']
     StoredValue=True
-    jetCollectionName = "AntiKt4TopoEMJets"
-    jetPtCut=40.0*Units.GeV
-    MaxSumPtTrk=5.0*Units.GeV
-    nJetPassed=2
-    pass
-primRPVLLDESDM.add_JobProperty(DV_jetFilterFlagsEgamma)
-
-class DV_stealthFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    cutMinTrackSd0 = 15.0
-    cutMinTrackpT = 2000.0
-    cutMinTrackEta = 2.5
-    cutMinNTracks = 30
+    prescale=10
     pass
-primRPVLLDESDM.add_JobProperty(DV_stealthFilterFlags)
+primRPVLLDESDM.add_JobProperty(DV_PrescalerFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DiLepFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DiLepFlags.py
index adcafb26d76f92c275ccf75f81ed461297327433..e7cd6cbc814f5cadb8673afe0e6f7e97fa2c5071 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DiLepFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/DiLepFlags.py
@@ -5,240 +5,154 @@ from AthenaCommon.JobProperties import jobproperties
 
 import AthenaCommon.SystemOfUnits as Units
 
-primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
-
-class DiLep_triggerFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    TriggerNames = [] # only put trigger names in this list if you want to override the below stream-specific ones
-    EgammaTriggerNames = [
-        #"EF_g80_loose",
-	"EF_g120_loose",
-        "EF_g40_loose_L2EFxe60",
-        "EF_2g40_loose",
-        "EF_g35_loose_g25_loose",
-        ]
-    JetTauEtmissTriggerNames = []
-    MuonsTriggerNames = []
+primRPVLLDESDM = jobproperties.PrimaryDPDFlags_RPVLLStream
 
+class DiLep_containerFlags(JobProperty):
+    statusOn               = True
+    photonCollectionName   = 'Photons'
+    electronCollectionName = 'Electrons'
+    muonCollectionName     = 'Muons'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_triggerFilterFlags)
-
+primRPVLLDESDM.add_JobProperty(DiLep_containerFlags)
 
-class DiLep_photonFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singlePhotonFilterFlags(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 130*Units.GeV
-    cutEtaMax = 2.5
-    cutAuthor = 'Photon'
-    cutIsEM = 'Loose'#what isEm is this?? tight?? loose??
-    photonCollectionName='PhotonCollection'
+    cutEtMin     = 150*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = 'HLT_g140_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_photonFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singlePhotonFilterFlags)
 
-class DiLep_electronFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singlePhotonFilterFlags_addph(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 150*Units.GeV
-    cutEtaMax = 2.5
-    cutAuthor = 'Electron'
-    cutIsEM = 'Medium'#what isEm is this?? tight?? loose??
-    electronCollectionName='ElectronCollection'
+    cutEtMin     = 10*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = None
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_electronFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singlePhotonFilterFlags_addph)
 
-class DiLep_mediumphotonFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singlePhotonFilterFlags_addel(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 48*Units.GeV
-    cutEtaMax = 2.5
-    cutAuthor = 'Photon'
-    cutIsEM = 'Loose'#what isEm is this?? tight?? loose??
-    photonCollectionName='PhotonCollection'
+    cutEtMin     = 10*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = 2.0*Units.mm
+    cutIsEM      = None
+    trigger      = None
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_mediumphotonFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singlePhotonFilterFlags_addel)
 
-class DiLep_mediumelectronFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singlePhotonFilterFlags_addmu(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 48*Units.GeV
-    cutEtaMax = 2.5
-    cutIsEM = 'Loose'#what isEm is this?? tight?? loose??
-    cutAuthor = 'Electron'
-    electronCollectionName='ElectronCollection'
+    cutEtMin     = 10*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = 1.5*Units.mm
+    trigger      = None
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_mediumelectronFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singlePhotonFilterFlags_addmu)
 
-class DiLep_softphotonFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singleElectronFilterFlags(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 39*Units.GeV
-    cutEtaMax = 2.5
-    cutIsEM = 'Loose'#what isEm is this?? tight?? loose??
-    cutAuthor = 'Photon'
-    photonCollectionName='PhotonCollection'
+    cutEtMin     = 140*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = 2.0*Units.mm
+    cutIsEM      = None
+    trigger      = 'HLT_g140_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_softphotonFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singleElectronFilterFlags)
 
-class DiLep_softelectronFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_singleMuonFilterFlags(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutEtMin = 39*Units.GeV
-    cutEtaMax = 2.5
-    cutAuthor = 'Electron'
-    cutIsEM = 'Loose'#what isEm is this?? tight?? loose??
-    electronCollectionName='ElectronCollection'
+    cutEtMin     = 60*Units.GeV
+    cutEtaMax    = 1.07
+    cutd0Min     = 1.5*Units.mm
+    trigger      = 'HLT_mu60_0eta105_msonly'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_softelectronFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_singleMuonFilterFlags)
 
-class DiLep_muonFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_diPhotonFilterFlags(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
-    StoredValue  = True
-    cutEtMin = 15*Units.GeV
-    cutEtaMax = 2.5
-    cutContainerMu='all'
-    usingAOD=False
+    StoredValue  = False    
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = 'HLT_2g50_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_muonFilterFlags)
-class DiLep_diphotonFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-    cutEtMin1    = 48.0*Units.GeV
-    cutEtMin2    = 48.0*Units.GeV
-    cutIsEM1     = 'Loose'    # Possible values: 'None', 'Photon'
-    cutIsEM2     = 'Loose'    # Possible values: 'None', 'Photon'
-    cutAuthor1   = 'either'  # Possible values: 'Photon'
-    cutAuthor2   = 'either'  # Possible values: 'Photon'
-    cutEtaMax      = 2.5
-    removeEtaCrack = False
-    crackEtaMin    = 1.37
-    crackEtaMax    = 1.52
+primRPVLLDESDM.add_JobProperty(DiLep_diPhotonFilterFlags)
 
+class DiLep_diElectronFilterFlags(JobProperty):
+    statusOn     = True
+    allowedTypes = ['bool']
+    StoredValue  = False    
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = 2.0*Units.mm
+    cutIsEM      = None
+    trigger      = 'HLT_2g50_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_diphotonFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_diElectronFilterFlags)
 
-class DiLep_dielectronFilterFlags(JobProperty):
-    statusOn = True
+class DiLep_diEgammaFilterFlags_electron(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
-    StoredValue  = False
-    cutEtMin1    = 49.0*Units.GeV
-    cutEtMin2    = 49.0*Units.GeV
-    cutIsEM1     = 'Loose'    # Possible values: 'None', 'Photon'
-    cutIsEM2     = 'Medium'    # Possible values: 'None', 'Photon'
-    cutAuthor1   = 'Electron'  # Possible values: 'Photon'
-    cutAuthor2   = 'Electron'  # Possible values: 'Photon'
-    cutEtaMax      = 2.5
-    removeEtaCrack = False
-    crackEtaMin    = 1.37
-    crackEtaMax    = 1.52
-
-    pass
-primRPVLLDESDM.add_JobProperty(DiLep_dielectronFilterFlags)
-
-class DiLep_softd0FilterFlagsEgamma(JobProperty):
-    statusOn=True
-    allowedTypes=['bool']
-    StoredValue=True
-    electronD0Cut=2.0
-    electronPtCut=38.0*Units.GeV
-    electronEtaCut=2.5
-    pass
-primRPVLLDESDM.add_JobProperty(DiLep_softd0FilterFlagsEgamma)
-
-class DiLep_d0FilterFlagsEgamma(JobProperty):
-    statusOn=True
-    allowedTypes=['bool']
-    StoredValue=True
-    electronD0Cut=2.0
-    electronPtCut=120.0*Units.GeV
-    electronEtaCut=2.5
+    StoredValue  = False    
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = 2.0*Units.mm
+    cutIsEM      = None
+    trigger      = 'HLT_2g50_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_d0FilterFlagsEgamma)
-
+primRPVLLDESDM.add_JobProperty(DiLep_diEgammaFilterFlags_electron)
 
-
-class DiLep_d0FilterFlagsDiElectron(JobProperty):
-    statusOn=True
-    allowedTypes=['bool']
-    StoredValue=True
-    dielectronD0Cut=2.5
-    dielectronPtCut=43.0*Units.GeV
-    dielectronEtaCut=2.5
+class DiLep_diEgammaFilterFlags_photon(JobProperty):
+    statusOn     = True
+    allowedTypes = ['bool']
+    StoredValue  = False    
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = None
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_d0FilterFlagsDiElectron)
-
+primRPVLLDESDM.add_JobProperty(DiLep_diEgammaFilterFlags_photon)
 
-class DiLep_d0FilterFlagsMuon(JobProperty):
-    statusOn = True
+class DiLep_diLooseEgammaFilterFlags_electron(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
-    StoredValue  = True
-    muD0Cut = 1.5
-    muPtCut=15.0*Units.GeV
-    muEtaCut=2.5
+    StoredValue  = False    
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = 'HLT_2g50_loose'
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_d0FilterFlagsMuon)
-
-#class DiLep_diemclusterFilterFlags(JobProperty):
-#    statusOn = False
-#    allowedTypes = ['bool']
-#    StoredValue  = False    
-#    cutEtMinEMCl1    = 49.0*Units.GeV
-#    cutEtMinEMCl2    = 49.0*Units.GeV
-#    cutEtaMax      = 2.5
-#    removeEtaCrack = False
-#    crackEtaMin    = 1.37
-#    crackEtaMax    = 1.52
-#    pass
-#primRPVLLDESDM.add_JobProperty(DiLep_diemclusterFilterFlags)
-#
-#class DiLep_diemcluster2FilterFlags(JobProperty):
-#    statusOn = False
-#    allowedTypes = ['bool']
-#    StoredValue  = False    
-#    cutEtMinEMCl1    = 140.0*Units.GeV
-#    cutEtMinEMCl2    = 25.0*Units.GeV
-#    cutEtaMax      = 2.5
-#    removeEtaCrack = False
-#    crackEtaMin    = 1.37
-#    crackEtaMax    = 1.52
-#    pass
-#primRPVLLDESDM.add_JobProperty(DiLep_diemcluster2FilterFlags)
-#
-class DiLep_missingetFilterFlags(JobProperty):
-    statusOn = True
+primRPVLLDESDM.add_JobProperty(DiLep_diLooseEgammaFilterFlags_electron)
+
+class DiLep_diLooseEgammaFilterFlags_photon(JobProperty):
+    statusOn     = True
     allowedTypes = ['bool']
     StoredValue  = False    
-    cutMetMin = 85.0*Units.GeV
-    jetContainerTypeList = []
-    jetContainerNameList = []
-    useUncalibratedJets = True
-    useLeadingJet= False
-    minDeltaPhi = 0.0
-    requireMet = True
+    cutEtMin     = 50*Units.GeV
+    cutEtaMax    = 2.5
+    cutd0Min     = None
+    cutIsEM      = 'Loose'
+    trigger      = None
     pass
-primRPVLLDESDM.add_JobProperty(DiLep_missingetFilterFlags)
-
-#class DiLep_jetFilterFlags(JobProperty):
-#    statusOn = True
-#    allowedTypes = ['bool']
-#    StoredValue  = False
-#    jetCollectionName= "AntiKt4TopoEMJets"
-#    cutEtMin = 150*Units.TeV
-#    cutEtMax = 14*Units.TeV
-#    cutEtaMax= 2.5
-#    removeOverlap= False
-#    deltaR= 0.2
-#    leptonContainerTypeList= []
-#    leptonContainerNameList= []
-#    minNumberPassed= 1
-#    pass
-#primRPVLLDESDM.add_JobProperty(DiLep_jetFilterFlags)
+primRPVLLDESDM.add_JobProperty(DiLep_diLooseEgammaFilterFlags_photon)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/FancyJetFilter.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/FancyJetFilter.py
index 910aa90dd3ef4ede3ac3e0a532b953c78f18cf1a..74710a3a3eef32c228cb3a05d13ae647597e3c1b 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/FancyJetFilter.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/FancyJetFilter.py
@@ -29,7 +29,7 @@ from PrimaryDPDMaker import PrimaryDPDHelpers
 
 import PyUtils.RootUtils as ru
 ROOT = ru.import_root()
-from ROOT import JetCollectionHelper
+
 
 ## Import the module that allows to use named units, e.g. GeV
 import AthenaCommon.SystemOfUnits as Units
@@ -40,11 +40,11 @@ class FancyJetFilter( PyAthena.AthFilterAlgorithm ):
     jet which fulfills a certain set of criteria.  All energies below
     are uncalibrated (EM scale).  The possible criteria are (with
     default values):
-    jetCollectionType       = "JetCollection"
-    jetCollectionName       = "AntiKt4TowerJets"
+    jetCollectionType       = "xAOD::JetCollection"
+    jetCollectionName       = "AntiKt4LCTopoJets"
     useUncalibratedJets     = True
     cutEtMin                = 0.0*Units.GeV
-    cutEtMax                = 14.0*Units.GeV
+    cutEtMax                = 14.0*Units.TeV
     cutEtaMin               = 0
     cutEtaMax               = 2.5
     cutSumPtTrkMax          = -1.0
@@ -67,11 +67,11 @@ class FancyJetFilter( PyAthena.AthFilterAlgorithm ):
         super(FancyJetFilter, self).__init__(**kw)
 
         ## Define the cuts
-        self.jetCollectionType       = kw.get('jetCollectionType', "JetCollection")
-        self.jetCollectionName       = kw.get('jetCollectionName', "AntiKt4TowerJets")
+        self.jetCollectionType       = kw.get('jetCollectionType', "xAOD::JetContainer")
+        self.jetCollectionName       = kw.get('jetCollectionName', "AntiKt4LCTopoJets")
         self.useUncalibratedJets     = kw.get('useUncalibratedJets', True)
         self.cutEtMin                = kw.get('cutEtMin', 0.0*Units.GeV)
-        self.cutEtMax                = kw.get('cutEtMax', 14.0*Units.GeV)
+        self.cutEtMax                = kw.get('cutEtMax', 14.0*Units.TeV)
         self.cutEtaMin               = kw.get('cutEtaMin', 0.0)
         self.cutEtaMax               = kw.get('cutEtaMax', 2.5)
         self.cutSumPtTrkMax          = kw.get('cutSumPtTrkMax', -1.0)
@@ -171,34 +171,7 @@ class FancyJetFilter( PyAthena.AthFilterAlgorithm ):
             self.msg.warning( 'Collection %s not found' % self.jetCollectionName )           
             self.setFilterPassed(True)
             return StatusCode.Success   
-        
-        
-        # Load the lepton collections from the input file
-        self.msg.debug( 'Going to load the leptons of type %s and key %s.' % (self.leptonContainerTypeList, self.leptonContainerNameList) )
-        leptonList = []
-        if self.leptonContainerTypeList.__len__() == self.leptonContainerNameList.__len__() :
-            for i in range( self.leptonContainerTypeList.__len__() ) :
-                try:
-                    lepColl = self.storeGateSvc.retrieve( self.leptonContainerTypeList[i],
-                                                          self.leptonContainerNameList[i] )
-                    self.msg.debug( 'Loading the lepton collection %s from the input file.'
-                                    % self.leptonContainerNameList[i] )
-                    for lep in lepColl :
-                        leptonList.append(lep)
-                        pass
-                    pass
-                except LookupError:
-                    self.msg.warning( 'Collection %s not found' % self.leptonContainerNameList[i] )           
-                    self.setFilterPassed(True)
-                    return StatusCode.Success   
-                pass
-            pass
-        else :
-            self.msg.error( 'List of leptons type %s and key %s has different lenght!'
-                            % (self.leptonContainerTypeList, self.leptonContainerNameList) )
-            pass
-
-
+   
         ## Turn all jets into uncalibrated state
         if self.useUncalibratedJets :
             self.jss.setSignalState( PyAthena.P4SignalState.UNCALIBRATED)
@@ -285,13 +258,6 @@ class FancyJetFilter( PyAthena.AthFilterAlgorithm ):
         releaseObject()
 
 
-        ## Record the good jets into StoreGate so that they can be retrieved by other algorithms
-        if self.recordGoodJets :
-            if JetCollectionHelper.record_jets( self.storeGateSvc, goodJets, self.goodJetCollectionName ).isFailure() :
-                self.msg.error( 'Could not record the goodJets into StoreGate with the key = %s' % self.goodJetCollectionName )
-                pass
-            pass
-
         ## Check if the event is accepted
         if  goodJets.__len__() >= self.minNumberPassed and leadEt <= self.cutEtMax :
             self.msg.debug( 'The %d leading jets are within [%f , %f] GeV', jet_pass, self.cutEtMin/Units.GeV, self.cutEtMax/Units.GeV)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/HVFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/HVFlags.py
index 50b98c5f66cd2b42d1e51e27b25ca64833423225..4b96cfd166e19dddb9d137e95e6ab2948e1c023d 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/HVFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/HVFlags.py
@@ -11,47 +11,21 @@ class HV_triggerFilterFlags(JobProperty):
     statusOn = True
     allowedTypes = ['bool']
     StoredValue  = True
-    TriggerNames = [] # only put trigger names in this list if you want to override the below stream-specific ones
-    EgammaTriggerNames = [
-        #"EF_2mu6_MSonly_g10_loose"
+    TriggerNames = [
+        "HLT_j30_muvtx",
+	"HLT_j30_muvtx_noiso",
+	"HLT_j30_jes_PS_llp_L1TAU30",
+	"HLT_j30_jes_PS_llp_L1TAU40",
+	"HLT_j30_jes_PS_llp_L1TAU60",
+	"HLT_j30_jes_PS_llp_L1LLP-NOMATCH",
+	"HLT_j30_jes_PS_llp_noiso_L1TAU60",
+	"HLT_j30_jes_PS_llp_noiso_L1LLP-NOMATCH",
+	"HLT_j100_xe80",
+	"HLT_j30_jes_PS_llp_L1TAU8_EMPTY",
+	"HLT_j30_jes_PS_llp_L1TAU8_UNPAIRED_ISO",
+	"HLT_j30_muvtx_L1MU4_EMPTY",
+	"HLT_j30_muvtx_L1MU4_UNPAIRED_ISO"
     ]
-    JetTauEtmissTriggerNames = [
-        #"EF_j35_a4tc_EFFS_L1TAU_HVtrk",
-        #"EF_j35_a4tc_EFFS_L1TAU_HV",
-        #"EF_j35_L1TAU_HV",
-        #"EF_l2j30_Trackless_HV",
-        #"EF_l2j30_Trackless_HV_L1MU10",
-        #"EF_j35_a4tc_EFFS_L1TAU_HVtrk_LOF",
-        "EF_l2j25_a4tcem_Trackless_HV",
-        "EF_j35_a4tcem_L1TAU_LOF_HV",
-        "EF_l2j30_a4tcem_2L1MU6_HV",
-        "EF_l2j30_a4tcem_2L1MU10_ExtendedEta_HV",
-        "EF_l2j30_a4tcem_2L1MU10_HV",
-        "EF_j35_a4tcem_L1TAU_LOF_HV_EMPTY",
-        "EF_j35_a4tcem_L1TAU_LOF_HV_UNPAIRED_ISO",
-        "EF_l2j25_a4tcem_Trackless_HV_EMPTY",
-        "EF_l2j25_a4tcem_Trackless_HV_UNPAIRED_ISO",
-        "EF_l2j30_a4tcem_2L1MU6_HV_EMPTY",
-        "EF_l2j30_a4tcem_2L1MU4_HV_EMPTY",
-        "EF_l2j30_a4tcem_2L1MU6_HV_UNPAIRED_ISO"
-    ]
-    MuonsTriggerNames = [
-        #"EF_2MUL1_l2j30_HV",
-        #"EF_2mu6_MSonly_g10_loose",
-        #"EF_3mu6_MSonly"
-        #"EF_l2j30_a4tcem_2L1MU6_HV"
 
-    ]
     pass
 primRPVLLDESDM.add_JobProperty(HV_triggerFilterFlags)
-
-
-class HV_muonFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    cutEtMin = 25*Units.GeV
-    cutContainerMu='all'
-    usingAOD=False
-    pass
-primRPVLLDESDM.add_JobProperty(HV_muonFilterFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/KinkedTrackFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/KinkedTrackFlags.py
index f72ebe7099d83ecd2b708dbd92b9200572411522..dd3b42a3c18ca68cb6bed5f54f2fd250bb34b698 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/KinkedTrackFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/KinkedTrackFlags.py
@@ -21,98 +21,98 @@ import AthenaCommon.SystemOfUnits as Units
 
 primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
 
-class KinkedTrack_do2010Skim(JobProperty):
+class KinkedTrack_containerFlags(JobProperty):
     statusOn = True
-    allowedTypes = ['bool']
-    StoredValue = False
-    pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_do2010Skim)
-
-class KinkedTrack_do2011Skim(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue = True
+    jetCollectionName = "AntiKt4LCTopoJets"
+    electronCollectionName = "Electrons"
+    muonCollectionName = "Muons"
+    METCollectionName = "MET_Reference_AntiKt4LCTopo"
+    METTermName = "FinalTrk" # or "FinalClus" ??
+    egClusterCollectionName = "egammaClusters"
+    msTrackCollectionName = "MuonSpectrometerTrackParticles"
     pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_do2011Skim)
+primRPVLLDESDM.add_JobProperty(KinkedTrack_containerFlags)
 
-class KinkedTrack_triggerFilterFlags2010(JobProperty):
+class KinkedTrack_singleJetMetFilterFlags(JobProperty):
     statusOn = True
     allowedTypes = ['bool']
     StoredValue  = True
-    TriggerNames = []
-    EgammaTriggerNames = []
-    JetTauEtmissTriggerNames = [
-        "EF_j75_jetNoEF_EFxe25_noMu",
-        "EF_xe55_noMu"
-    ]
-    MuonsTriggerNames = []
+    triggerNames = [
+        "HLT_j80_xe80_dphi10_L1J40_DPHI-J20s2XE50",
+        "HLT_j80_xe80_dphi10_L1J40_DPHI-J20XE50",
+        "HLT_j100_xe80_dphi10_L1J40_DPHI-J20s2XE50",
+        "HLT_j100_xe80_dphi10_L1J40_DPHI-J20XE50",
+        "HLT_j80_xe80",
+        "HLT_j100_xe80"
+        ]
+    cutsEtMin = [120.0*Units.GeV, 60.0*Units.GeV]
+    cutEtaMax = 3.2
+    doLeptonVeto = True
+    electronIDKey = "Tight"
+    muonIDKey = "Medium"
+    leptonPtMax = 20.0*Units.GeV
+    leptonEtaMax = 2.5
+    cutMetMin = -1  # no cut
+    jetMetDphiMin = 1.0
     pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_triggerFilterFlags2010)
+primRPVLLDESDM.add_JobProperty(KinkedTrack_singleJetMetFilterFlags)
 
-class KinkedTrack_triggerFilterFlags2011(JobProperty):
+class KinkedTrack_ZeeFilterFlags(JobProperty):
     statusOn = True
     allowedTypes = ['bool']
     StoredValue  = True
-    TriggerNames = []
-    EgammaTriggerNames = []
-    JetTauEtmissTriggerNames = [
-        #"EF_j75_a4_EFFS_xe45_loose_noMu",
-        #"EF_j75_a4_EFFS_xe55_loose_noMu",
-        #"EF_j75_a4tc_EFFS_xe45_loose_noMu",
-        #"EF_j75_a4tc_EFFS_xe55_loose_noMu",
-        #"EF_j75_a4tc_EFFS_xe55_noMu",
-        #"EF_j55_a4tc_EFFS_xe55_medium_noMu_dphi2j30xe10",
-        #"EF_j65_a4tc_EFFS_xe65_medium_noMu_dphi2j30xe10",
-        #"EF_j70_a4tc_EFFS_xe70_medium_noMu_dphi2j30xe10",
-        #"EF_j80_a4tc_EFFS_xe60_noMu",
-        "EF_j80_a4tchad_xe100_tclcw",
-        "EF_j80_a4tchad_xe100_tclcw_loose",
-        "EF_j80_a4tchad_xe100_tclcw_veryloose",
-        "EF_j80_a4tchad_xe80_tclcw",
-        "EF_j110_a4tchad_xe90_tclcw_loose",
-        "EF_j110_a4tchad_xe90_tclcw_veryloose",
-        "EF_j110_a4tchad_xe100_tclcw",
-        "EF_j110_a4tchad_xe100_tclcw_veryloose",
-        "EF_j110_a4tchad_xe75_tclcw",    
-        "EF_j170_a4tchad_EFxe70_tclcw",
-        "EF_j170_a4tchad_EFxe80_tclcw",
-        "EF_j80_a4tchad_xe70_tclcw_dphi2j45xe10",
-        "EF_j80_a4tchad_xe85_tclcw_dphi2j45xe10"
+    triggerNames = [
+        #"HLT_e24_medium_iloose",
+        #"HLT_e24_tight_iloose",
+        #"HLT_e26_tight_iloose",
+        #"HLT_e28_tight_iloose",
+        "HLT_e24_medium_iloose_L1EM18VH",
+        "HLT_e24_lhmedium_iloose_L1EM18VH",
+        "HLT_e24_medium_iloose_L1EM20VH",
+        "HLT_e24_lhmedium_iloose_L1EM20VH",
+        "HLT_e24_tight_iloose_L1EM20VH",
+        "HLT_e24_lhtight_iloose_L1EM20VH",
+        "HLT_e26_tight_iloose",
+        "HLT_e26_lhtight_iloose"
         ]
-    MuonsTriggerNames = []
+    doTriggerMatch = False
+    electronPtMin = 40*Units.GeV
+    electronEtaMax = 2.5
+    electronIDKeys = ["Tight"]
+    clusterEtMin = 15*Units.GeV
+    clusterEtaMax = 2.5
+    diElectronMassLow = (91.1876-40)*Units.GeV
+    diElectronMassHigh = (91.1876+40)*Units.GeV
+    deltaPhiMax = 1.5
+    preScaleClusterEtMax = 60.0*Units.GeV
+    preScale = 5
     pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_triggerFilterFlags2011)
-
+primRPVLLDESDM.add_JobProperty(KinkedTrack_ZeeFilterFlags)
 
-class KinkedTrack_singleJetMetFilterFlags(JobProperty):
+class KinkedTrack_ZmumuFilterFlags(JobProperty):
     statusOn = True
     allowedTypes = ['bool']
     StoredValue  = True
-    jetCollectionName = "AntiKt4LCTopoJets"
-    cutEt1Min = 85.0*Units.GeV
-    cutEta1Max = 3.2
-    cutEt2Min = 50.0*Units.GeV
-    cutEta2Max = 3.2
-    doSecondJetVeto = False
-    requireMet = True
-    metCollectionNames = ["MET_LocHadTopo","MET_RefFinal","MET_RefFinal_em"]
-    cutMetMin = 85.0*Units.GeV
+    triggerNames = [
+        "HLT_mu20_iloose",
+        "HLT_mu20_iloose_L1MU15",
+        "HLT_mu24_iloose",
+        "HLT_mu24_iloose_L1MU15",
+        "HLT_mu24_imedium",
+        "HLT_mu26_imedium"
+        ]
+    doTriggerMatch = False
+    muonPtMin = 40*Units.GeV
+    muonEtaMax = 2.5
+    muonIDKeys = ["Medium"]
+    trackPtMin = 15*Units.GeV
+    trackEtaMax = 2.5
+    diMuonMassLow = (91.1876-40)*Units.GeV
+    diMuonMassHigh = (91.1876+40)*Units.GeV
+    deltaPhiMax = 1.5
+    preScaleTrackPtMax = 60.0*Units.GeV
+    preScale = 5
     pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_singleJetMetFilterFlags)
+primRPVLLDESDM.add_JobProperty(KinkedTrack_ZmumuFilterFlags)
 
 
-class KinkedTrack_multiJetMetFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    jetCollectionType = "JetCollection"
-    jetCollectionName = "AntiKt4LCTopoJets"
-    cutsEtMin = [ 100.0*Units.GeV, 50.0*Units.GeV, 50.0*Units.GeV ]
-    cutEtaMax = 3.2
-    doSecondJetVeto = False
-    requireMet = True
-    metCollectionType = "MissingET"
-    metCollectionNames = ["MET_LocHadTopo","MET_RefFinal","MET_RefFinal_em"]
-    cutMetMin = 100.0*Units.GeV
-    pass
-primRPVLLDESDM.add_JobProperty(KinkedTrack_multiJetMetFilterFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/LongLivedDPDFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/LongLivedDPDFlags.py
index cbe2bbfa44df33aa50a5017192c175a60f267755..95c927c323139cbf86d0e0149ec788719f673b57 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/LongLivedDPDFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/LongLivedDPDFlags.py
@@ -12,10 +12,7 @@
 ##=============================================================================
 
 __doc__ = """job flags for LongLivedDPDMaker."""
-__version__ = "0.0.1"
-
-## Import the module that allows to use named units, e.g. GeV
-import AthenaCommon.SystemOfUnits as Units
+__version__ = "0.0.2"
 
 from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
 from AthenaCommon.JobProperties import jobproperties
@@ -25,9 +22,6 @@ class LongLivedDPDFlags(JobPropertyContainer):
 
 jobproperties.add_Container(LongLivedDPDFlags)
 
-from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLLStream import primRPVLLDESDM
-from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLL_CosmicCaloStream import primRPVLLCosmicCaloDESDM
-
 from PrimaryDPDMaker.PrimaryDPDFlags import listESDtoDPD
 from PrimaryDPDMaker.PrimaryDPDFlags import listAllKnownDPD
 
@@ -52,19 +46,6 @@ class WriteRPVLLStream(JobProperty):
 primDPD.add_JobProperty(WriteRPVLLStream)
 listESDtoDPD.append(WriteRPVLLStream.StreamName)
 
-class WriteRPVLL_CosmicCaloStream(JobProperty):
-    """Produce empty BC RPV/LL DESD """
-    statusOn = True
-    allowedTypes = ["bool"]
-    StoredValue = False
-    StreamName = "StreamDESDM_RPVLLCC"
-    FileName = ""
-    TriggerNames = []
-    DPDMakerScript = "PrimaryDPDMaker/esdtodpd.py"    
-    pass
-primDPD.add_JobProperty(WriteRPVLL_CosmicCaloStream)
-listESDtoDPD.append(WriteRPVLL_CosmicCaloStream.StreamName)
-
 
 from RecExConfig.RecoFunctions import AddValidItemToList
 AddValidItemToList(listESDtoDPD,listAllKnownDPD)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/NonPointingFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/NonPointingFlags.py
deleted file mode 100644
index 9df6f18947e84f1b25f5897b5ccfce86eac7f95e..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/NonPointingFlags.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties
-
-import AthenaCommon.SystemOfUnits as Units
-
-primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
-
-class NonPointing_triggerFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    TriggerNames = [] # only put trigger names in this list if you want to override the below stream-specific ones
-    EgammaTriggerNames = [
-#        "EF_g40_loose_EFxe40_noMu",
-        "EF_g40_loose_xe45_medium_noMu",
-        "EF_g40_loose_xe55_medium_noMu",
-        "EF_g40_loose_EFxe40_noMu",
-#        "EF_g100_etcut_g50_etcut",
-#        "EF_g40_loose",
-#        "EF_2g20_loose",
-#        "EF_g20_etcut_xe30_nuMu",
-#        "EF_g60_loose",
-        "EF_g80_loose",
-#        "EF_g150_etcut"
-        "EF_g40_loose_L2xe60",
-        "EF_2g40_loose",
-    ]
-    JetTauEtmissTriggerNames = []
-    MuonsTriggerNames = []
-
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_triggerFilterFlags)
-
-
-class NonPointing_photonFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False    
-    cutEtMin = 60*Units.TeV
-    cutEtaMax = 1.81
-#    cutIsEM = 'None'#what isEm is this?? tight?? loose??
-    cutIsEM = 'PhotonTightAR'#what isEm is this?? tight?? loose??
-    photonCollectionName='PhotonCollection'
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_photonFilterFlags)
-
-class NonPointing_diphotonFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-    cutEtMin1    = 20.0*Units.TeV
-    cutEtMin2    = 20.0*Units.TeV
-    cutIsEM1     = 'PhotonLooseAR'    # Possible values: 'None', 'Photon'
-    cutIsEM2     = 'None'    # Possible values: 'None', 'Photon'
-    cutAuthor1   = 'either'  # Possible values: 'Photon'
-    cutAuthor2   = 'either'  # Possible values: 'Photon'
-    cutEtaMax      = 2.5
-    removeEtaCrack = False
-    crackEtaMin    = 1.37
-    crackEtaMax    = 1.52
-
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_diphotonFilterFlags)
-
-class NonPointing_diemclusterFilterFlags(JobProperty):
-    statusOn = False
-    allowedTypes = ['bool']
-    StoredValue  = False    
-    cutEtMinEMCl1    = 60.0*Units.TeV
-    cutEtMinEMCl2    = 40.0*Units.TeV
-    cutEtaMax      = 2.5
-    removeEtaCrack = False
-    crackEtaMin    = 1.37
-    crackEtaMax    = 1.52
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_diemclusterFilterFlags)
-
-class NonPointing_missingetFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False    
-    cutMetMin = 60.0*Units.GeV
-    jetContainerTypeList = []
-    jetContainerNameList = []
-    useUncalibratedJets = True
-    useLeadingJet= False
-    minDeltaPhi = 0.0
-    requireMet = True
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_missingetFilterFlags)
-
-class NonPointing_jetFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-    jetCollectionName= "AntiKt4TopoEMJets"
-    cutEtMin = 150*Units.TeV
-    cutEtMax = 14*Units.TeV
-    cutEtaMax= 2.5
-    removeOverlap= False
-    deltaR= 0.2
-    leptonContainerTypeList= []
-    leptonContainerNameList= []
-    minNumberPassed= 1
-    pass
-primRPVLLDESDM.add_JobProperty(NonPointing_jetFilterFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLLStream.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLLStream.py
index 876ca6525ba6791252fc56a6392e346077b03f47..a28a56953c3c98e710f1ac4b7ce83b0467d96328 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLLStream.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLLStream.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
+
 ##=============================================================================
 ## Name:        PrimaryDPDFlags_RPVLL_Stream
 ## Authors:     Nick Barlow (Cambridge), C. Ohm (Stockholm)
@@ -31,143 +32,97 @@ jobproperties.add_Container(PrimaryDPDFlags_RPVLLStream)
 
 primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
 
-import SmpCaloIdFlags
+import DiLepFlags
 import DVFlags
-import VH_DVFlags
-import SmpMsFlags
-import HipsFlags
-import NonPointingFlags
 import KinkedTrackFlags
 import StoppedFlags
-import HVFlags
+import VH_DVFlags
 import QuirksFlags
-import DiLepFlags
-import StealthFlags
+import HipsFlags
+import HVFlags
+import SmpCaloIdFlags
+import SmpMsFlags
 
 #===============================================================
 # Set specific properties for each of the analysis selections
 #===============================================================
 
-class doStealth(JobProperty):
-    statusOn = True
-    allowedTypes = ["bool"]
-    StoredValue = True 
-    ForceToRun = False 
-    TriggerStreams = ["JetTauEtmiss"]    
-    pass
-primRPVLLDESDM.add_JobProperty(doStealth)
-
 class doDiLep(JobProperty):
     statusOn=True
     allowedTypes = ["bool"]
     StoredValue=True
-    ForceToRun=False
-    TriggerStreams=["Egamma"]
     pass
 primRPVLLDESDM.add_JobProperty(doDiLep)
     
-class doQuirks(JobProperty):
-    statusOn=True
-    allowedTypes = ["bool"]
-    StoredValue=True
-    ForceToRun=False
-    TriggerStreams=["JetTauEtmiss"]
-    pass
-primRPVLLDESDM.add_JobProperty(doQuirks)
-
-class doSmpCaloId(JobProperty):
-    statusOn = True
-    allowedTypes = ["bool"]
-    StoredValue = True
-    ForceToRun = False
-    TriggerStreams = ["JetTauEtmiss", "Muons"]
-    pass
-primRPVLLDESDM.add_JobProperty(doSmpCaloId)
-
 class doDV(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
     StoredValue = True
-    ForceToRunMuonsSel=False
-    ForceToRunEgammaSel=False
-    ForceToRunJetTauEtmissSel=False    
-    TriggerStreams = ["Egamma","JetTauEtmiss"] #### NB for late 2013 reprocessing don't rerun on Muons
     pass
 primRPVLLDESDM.add_JobProperty(doDV)
 
-class doVH_DV(JobProperty):
+class doKinkedTrack(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
     StoredValue = True
-    ForceToRun = False
-    TriggerStreams = ["Muons", "Egamma"]
     pass
-primRPVLLDESDM.add_JobProperty(doVH_DV)
+primRPVLLDESDM.add_JobProperty(doKinkedTrack)
 
-class doSmpMs(JobProperty):
+class doStopped(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this
-    ForceToRun = False
-    TriggerStreams = ["Muons"]
+    StoredValue = False
     pass
-primRPVLLDESDM.add_JobProperty(doSmpMs)
+primRPVLLDESDM.add_JobProperty(doStopped)
 
-class doNonPointing(JobProperty):
+class doVH_DV(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this
-    ForceToRun = False
-    TriggerStreams = ["Egamma"]
+    StoredValue = False
     pass
-primRPVLLDESDM.add_JobProperty(doNonPointing)
+primRPVLLDESDM.add_JobProperty(doVH_DV)
 
-class doKinkedTrack(JobProperty):
-    statusOn = True
+class doQuirks(JobProperty):
+    statusOn=True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this
-    ForceToRun = False
-    TriggerStreams = ["JetTauEtmiss"]
+    StoredValue=False
     pass
-primRPVLLDESDM.add_JobProperty(doKinkedTrack)
+primRPVLLDESDM.add_JobProperty(doQuirks)
 
 class doHips(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this
-    ForceToRun = False
-    TriggerStreams = ["Egamma"]
+    StoredValue = True
     pass
 primRPVLLDESDM.add_JobProperty(doHips)
 
-class doStopped(JobProperty):
+class doHnl(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this
-    ForceToRun = False
-    TriggerStreams = ["JetTauEtmiss"]
+    StoredValue = True
     pass
-primRPVLLDESDM.add_JobProperty(doStopped)
+primRPVLLDESDM.add_JobProperty(doHnl)
 
 class doHV(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
-    StoredValue = False #### NB for late 2013 reprocessing don't rerun this 
-    ForceToRun = False
-#    TriggerStreams = ["JetTauEtmiss", "Muons", "Egamma"]
-#    TriggerStreams = ["JetTauEtmiss", "Muons"]    
-    TriggerStreams = ["JetTauEtmiss"]    
+    StoredValue = True
     pass
 primRPVLLDESDM.add_JobProperty(doHV)
 
-# other switches (old - remove some?)
+class doSmpCaloId(JobProperty):
+    statusOn = True
+    allowedTypes = ["bool"]
+    StoredValue = False
+    pass
+primRPVLLDESDM.add_JobProperty(doSmpCaloId)
 
-class UseAODTruth(JobProperty):
+class doSmpMs(JobProperty):
     statusOn = True
     allowedTypes = ["bool"]
     StoredValue = False
     pass
-primRPVLLDESDM.add_JobProperty(UseAODTruth)
+primRPVLLDESDM.add_JobProperty(doSmpMs)
 
 class prescaleFlags(JobProperty):
     statusOn = True
@@ -177,10 +132,3 @@ class prescaleFlags(JobProperty):
     prescaleFactor=1.0
 primRPVLLDESDM.add_JobProperty(prescaleFlags)
 
-class doCaloCellThinning(JobProperty):
-    statusOn = True
-    allowedTypes = ["bool"]
-    StoredValue = False
-    pass
-primRPVLLDESDM.add_JobProperty(doCaloCellThinning)
-
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLL_CosmicCaloStream.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLL_CosmicCaloStream.py
deleted file mode 100644
index 547971c05b5542b423a94857c95b60c4a6241a3d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/PrimaryDPDFlags_RPVLL_CosmicCaloStream.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-##=============================================================================
-## Name:        PrimaryDPDFlags_RPVLL_CosmicCalo
-## Authors:     Paul Jackson (SLAC) Nick Barlow (Cambridge), C. Ohm (Stockholm)
-## Created:     Februaury 2010
-##
-## Based on:    PrimaryDPDFlags_PhotonJetStream by Karsten Koeneke (DESY)
-##
-## Description: Here, all necessary job flags for the RPV/LL ESD-based DPD
-##              are defined.
-##
-##=============================================================================
-
-__doc__ = """Here, all necessary job flags for the RPV/LL SUSY jet DPD are defined."""
-
-__version__ = "0.0.1"
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties
-
-import AthenaCommon.SystemOfUnits as Units
-
-#=====================================================================
-# First define container for the flags  
-#=====================================================================
-class PrimaryDPDFlags_RPVLL_CosmicCaloStream(JobPropertyContainer):
-    """ The Primary RPV/LL CosmicCalo DESDM flag/job property  container."""
-jobproperties.add_Container(PrimaryDPDFlags_RPVLL_CosmicCaloStream)
-
-primRPVLLCosmicCaloDESDM=jobproperties.PrimaryDPDFlags_RPVLL_CosmicCaloStream
-
-#===============================================================
-# Set specific properties
-#==============================================================
-
-class triggerFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-    TriggerNames = ["L1_J10_EMPTY","L1_TAU5_EMPTY"]
-    ##TriggerNames = ["L1_J10","L1_TAU5"]    
-    pass
-primRPVLLCosmicCaloDESDM.add_JobProperty(triggerFilterFlags)
-
-class jetFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = False    
-    cutEtMin = 20*Units.GeV
-    cutEtMax = 1000*Units.GeV
-    cutEtaMax=2.0
-    nJetCut  = 1
-    jetCollectionName = "AntiKt4TowerJets"
-    goodJetCollectionName="RPVLL_CosmicCaloStream_AntiKt4TowerJets10Empty"
-    pass
-primRPVLLCosmicCaloDESDM.add_JobProperty(jetFilterFlags)
-
-class muonSegmentFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ["bool"]
-    StoredValue = False
-    cutNsegMin = 0
-    cutNsegMax = 0
-    addPrescaledLooseFilter = False
-    cutNsegMinLoose = 0
-    cutNsegMaxLoose = 20
-    prescaleFactorForLooseFilter = 10
-    muonSegmentCollectionName = "MooreSegments"
-    pass
-primRPVLLCosmicCaloDESDM.add_JobProperty(muonSegmentFilterFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/SmpCaloIdFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/SmpCaloIdFlags.py
index 67bb3f363524affb8ea9690ceba84d8253dc76f3..0610ca1f435196dca45c40b3f4d8ccd2abb22bb7 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/SmpCaloIdFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/SmpCaloIdFlags.py
@@ -95,7 +95,7 @@ class SmpCaloId_trackParticleFilterFlags(JobProperty):
     cutPixelHitsMin         = 3
     cutSCTHitsMin           = 6
     cutSiliconHitsMin       = 0
-    cutInputCollection      = 'TrackParticleCandidate'
+    cutInputCollection      = 'InDetTrackParticles'
     cutOutputLinkCollection = 'SmpId_TrackParticleLinkCollection'
     usingAOD = False
     pass
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StealthFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StealthFlags.py
deleted file mode 100644
index 5a7595ffb7c32a9a8f14e9c869b1d71f48b5f26a..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StealthFlags.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties
-
-import AthenaCommon.SystemOfUnits as Units
-
-primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
-
-class Stealth_triggerFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    TriggerNames = [] # only put trigger names in this list if you want to override the below stream-specific ones
-    EgammaTriggerNames = []
-    JetTauEtmissTriggerNames = [
-	        "EF_4j80_a4tchad_L2FS"
-	]
-    MuonsTriggerNames = []
-    pass
-primRPVLLDESDM.add_JobProperty(Stealth_triggerFilterFlags)
-
-class Stealth_stealthFilterFlags(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-    cutMinTrackSd0 = 15.0
-    cutMinTrackpT = 2000.0
-    cutMinTrackEta = 2.5
-    cutMinNTracks = 30
-    pass
-primRPVLLDESDM.add_JobProperty(Stealth_stealthFilterFlags)
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StoppedFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StoppedFlags.py
index e97439de4ffa73d379f25483dc427c666574c4e5..28802bb3857c6cfdd3709fb74581b5c1150526fa 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StoppedFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/StoppedFlags.py
@@ -44,8 +44,7 @@ class Stopped_jetFilterFlags(JobProperty):
     cutEtaMin = 0
     cutEtaMax = 1.3
     cutPSFracMax = 0.95
-    #jetCollectionName='AntiKt4TopoJets'
-    jetCollectionName='AntiKt4TopoEMJets'
+    jetCollectionName='AntiKt4EMTopoJets'
     pass
 primRPVLLDESDM.add_JobProperty(Stopped_jetFilterFlags)
 
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/VH_DVFlags.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/VH_DVFlags.py
index cb14f34e5c26a77933dc73a8914e03686179ce27..07cbe219b345bbba08c87416c644b854e296352d 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/VH_DVFlags.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/python/VH_DVFlags.py
@@ -37,7 +37,7 @@ class VH_DV_electronFilterFlags(JobProperty):
     cutEtaMax = 2.5
     cutAuthor = 'Electron'
     cutIsEM = 'Medium'
-    electronCollectionName='ElectronCollection'
+    electronCollectionName='Electrons'
     pass
 primRPVLLDESDM.add_JobProperty(VH_DV_electronFilterFlags)
 
@@ -49,7 +49,7 @@ class VH_DV_DielectronFilterFlags(JobProperty):
     cutEtaMax = 2.5
     cutAuthor = 'Electron'
     cutIsEM = 'Medium'
-    electronCollectionName='ElectronCollection'
+    electronCollectionName='Electrons'
     pass
 primRPVLLDESDM.add_JobProperty(VH_DV_DielectronFilterFlags)
 
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedDPD_topOptions.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedDPD_topOptions.py
index a65f01ad0f67462a235e12584daae171c0b60d3d..4b7a00d25a46048bf2ad5d272bcd9b05f0328fdb 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedDPD_topOptions.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedDPD_topOptions.py
@@ -18,11 +18,9 @@ rec.AutoConfiguration=['everything']
 from LongLivedParticleDPDMaker.LongLivedDPDFlags import *
 ## Include the job property flags for the physics DPDs in this package 
 from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLLStream import primRPVLLDESDM
-from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLL_CosmicCaloStream import primRPVLLCosmicCaloDESDM
 
 # Switch on the writing of the physics DPDs
 primDPD.WriteRPVLLStream = True
-primDPD.WriteRPVLL_CosmicCaloStream = False
 
 
 primDPD.OutputDirectoryName=""
@@ -38,7 +36,6 @@ primRPVLLDESDM.doDV=True
 primRPVLLDESDM.doSmpCaloId=True
 primRPVLLDESDM.doSmpMs=True
 primRPVLLDESDM.doKinkedTrack=True
-primRPVLLDESDM.doNonPointing=True
 primRPVLLDESDM.doHips=True
 primRPVLLDESDM.doStopped=True
 primRPVLLDESDM.doHV=True
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedParticleDPDMaker.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedParticleDPDMaker.py
index 4a74cf1ebaa02050ee22653ca0e75b425a64aafa..3a177744d23734932b951ff824eee1bc667049a3 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedParticleDPDMaker.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/LongLivedParticleDPDMaker.py
@@ -71,13 +71,6 @@ if llDPD.MakePrimaryDPD():
         include("LongLivedParticleDPDMaker/PhysDESDM_RPVLL.py")
         pass
         pass
-    ##=======================================================
-    ## Include the RPVLL CosmicCalo DESDM Output Stream
-    ##=======================================================
-    if llDPD.WriteRPVLL_CosmicCaloStream():
-        include("LongLivedParticleDPDMaker/PhysDESDM_RPVLL_CosmicCalo.py")
-        pass    
-
 
     #========================================================
     # Setting up the trigger decision tool. It will be only
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DV.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DV.py
index 6eb3ec1089f04483308736febf086ec85a47c3e3..a596ce9033ef9b3c106a9571c30d662a6fe61a56 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DV.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DV.py
@@ -1,371 +1,271 @@
-
-### configure trigger filters
-if len(primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma" or primRPVLLDESDM.doDV.ForceToRunEgammaSel :
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DV_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss" or primRPVLLDESDM.doDV.ForceToRunJetTauEtmissSel :
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DV_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons" or primRPVLLDESDM.doDV.ForceToRunMuonsSel :
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DV_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DV_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames += primRPVLLDESDM.DV_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames += primRPVLLDESDM.DV_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames))
-
-triggerFilterNames=[]
-
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.DV_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "DV_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "DV_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.DV_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["DV_CombinedTriggerFilter"]
-
-#################################################################################################
-####### Muons stream selection
-#################################################################################################
-
-if rec.triggerStream() == "Muons" or primRPVLLDESDM.doDV.ForceToRunMuonsSel:
-    
-    offlineMuonFilterNames=[]
-    
-    ## configure muon filters
-    
-    from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
-    
-    muonCollNames=["MuidESDMuonCollection", "MuidMuonCollection", "StacoESDMuonCollection", "StacoMuonCollection"]
-    
-    for mucoll in muonCollNames:
-        muonFilterName = 'DV_MuFilter_'+mucoll
-        muonFilter = D2PDMuonSelector(muonFilterName)
-        offlineMuonFilterNames.append( muonFilterName )
-        muonFilter.ptMin = primRPVLLDESDM.DV_muonFilterFlags.cutEtMin
-        muonFilter.absEtaMax = primRPVLLDESDM.DV_muonFilterFlags.cutEtaMax
-        muonFilter.inputCollection = mucoll
-        muonFilter.minNumberPassed=1
-        topSequence+=muonFilter
-        pass
-    
-##  a real jet filter
-    
-    from PrimaryDPDMaker.JetFilter import JetFilter
-    jetFilterName = "DV_JetFilter_muonChannel"
-    topSequence += JetFilter(jetFilterName)
-    topSequence.DV_JetFilter.cutEtMin=primRPVLLDESDM.DV_jetFilterFlagsMuon.jetPtCut
-    topSequence.DV_JetFilter.cutEtMax=14.0*Units.TeV
-    topSequence.DV_JetFilter.minNumberPassed=primRPVLLDESDM.DV_jetFilterFlagsMuon.nJetPassed
-    filtersToBookkeep+=["DV_JetFilter_muonChannel"]
-    
-    ########## d0 filter
-    from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlg
-    d0FilterName="DV_mud0Filter"
-    d0Filter=DVFilterAlg(d0FilterName)
-    topSequence+=d0Filter
-    topSequence.DV_mud0Filter.MuonD0Cut=primRPVLLDESDM.DV_d0FilterFlags.muD0Cut
-    topSequence.DV_mud0Filter.MuonPtCut=primRPVLLDESDM.DV_d0FilterFlags.muPtCut
-    topSequence.DV_mud0Filter.MuonEtaCut=primRPVLLDESDM.DV_d0FilterFlags.muEtaCut
-    filtersToBookkeep+=["DV_mud0Filter"]
-    
-    jetOrD0FilterName = "DV_JetOrD0Filter_muonChannel"
-    topSequence += LogicalFilterCombiner( jetOrD0FilterName)
-    topSequence.DV_JetOrD0Filter.cmdstring = "DV_JetFilter_muonChannel or DV_mud0Filter"
-    filtersToBookkeep+=["DV_JetOrD0Filter_muonChannel"]
-    
-    ########### combine the offline filters
-    
-    muonFilterName = "DV_MuonFilter"
-    topSequence += LogicalFilterCombiner( muonFilterName )
-    muonFilterCounter = 0
-    cmdstring = ""
-    for muFilterName in offlineMuonFilterNames :
-        if muonFilterCounter > 0 :
-            cmdstring += " or "
+#
+#
+# ##########################################################################################
+# Electron/photon/muon augmentation
+# Use the derivation framework tools directly
+# ##########################################################################################
+
+# Cache the container names (used throughout)
+jetContainer = primRPVLLDESDM.DV_containerFlags.jetCollectionName
+METContainer= primRPVLLDESDM.DV_containerFlags.METCollectionName
+photonContainer = primRPVLLDESDM.DV_containerFlags.photonCollectionName
+muonContainer = primRPVLLDESDM.DV_containerFlags.muonCollectionName
+electronContainer = primRPVLLDESDM.DV_containerFlags.electronCollectionName
+
+
+# ##########################################################################################
+# Selection algorithms setup
+# ##########################################################################################
+
+def DVSelectionString(flags, container):
+    """Construct object selection string based on the flags provided (from DVFlags)
+    """
+
+    cutList = []
+    if flags.cutEtMin:  cutList.append('%s.pt > %s'%(container,flags.cutEtMin))
+
+    cutString = 'count(' + ' && '.join(cutList) + ') > %i'%(flags.nPassed-1)
+
+    return cutString
+
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool as skimtool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel
+
+def DVTriggerSelectionString(flags):
+    cutString=""
+    if flags.triggers.__len__() >=1:
+        cutString+=flags.triggers[0]
+        if flags.triggers.__len__() >1:
+            for trigger in flags.triggers[1:]:
+                cutString+=" || "+trigger
+                pass
             pass
-        cmdstring += muFilterName
-        muonFilterCounter += 1
         pass
-    topSequence.DV_MuonFilter.cmdstring=cmdstring ##+ " and DV_JetFilter2"
-    filtersToBookkeep+=["DV_MuonFilter"]
-    
-    
-    combinedOfflineFilterName = "DV_CombinedOfflineFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-    cmdstring = "DV_MuonFilter and DV_JetOrD0Filter_muonChannel"
-    topSequence.DV_CombinedOfflineFilter.cmdstring=cmdstring 
-    filtersToBookkeep+=["DV_CombinedOfflineFilter"]
+    return cutString
     pass
 
-#################################################################################################
-############### Egamma stream selection
-#################################################################################################
-
-if rec.triggerStream() == "Egamma" or primRPVLLDESDM.doDV.ForceToRunEgammaSel:
-    offlineEgammaFilterNames=[]
-    
-    from D2PDMaker.D2PDMakerConf import D2PDElectronSelector	
-    electronCollNames=["ElectronCollection"]
-    
-    from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlgEgamma
-    d0FilterEgammaName="DV_egammad0Filter"
-    d0FilterEgamma=DVFilterAlgEgamma(d0FilterEgammaName)
-    offlineEgammaFilterNames.append( d0FilterEgammaName )
-    topSequence+=d0FilterEgamma
-    topSequence.DV_egammad0Filter.electronD0Cut=primRPVLLDESDM.DV_d0FilterFlagsEgamma.electronD0Cut
-    topSequence.DV_egammad0Filter.electronPtCut=primRPVLLDESDM.DV_d0FilterFlagsEgamma.electronPtCut
-    topSequence.DV_egammad0Filter.electronEtaCut=primRPVLLDESDM.DV_d0FilterFlagsEgamma.electronEtaCut
-    filtersToBookkeep+=["DV_egammad0Filter"]
-## Di-electron filter
-    from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlgDiElectron
-    d0FilterDiElectronName="DV_diElectrond0Filter"
-    d0FilterEgamma=DVFilterAlgDiElectron(d0FilterDiElectronName)
-    offlineEgammaFilterNames.append( d0FilterDiElectronName )
-    topSequence+=d0FilterEgamma
-    topSequence.DV_diElectrond0Filter.dielectronD0Cut=primRPVLLDESDM.DV_d0FilterFlagsDiElectron.dielectronD0Cut
-    topSequence.DV_diElectrond0Filter.dielectronPtCut=primRPVLLDESDM.DV_d0FilterFlagsDiElectron.dielectronPtCut
-    topSequence.DV_diElectrond0Filter.dielectronEtaCut=primRPVLLDESDM.DV_d0FilterFlagsDiElectron.dielectronEtaCut
-    filtersToBookkeep+=["DV_diElectrond0Filter"]
-    
-    
-    from D2PDMaker.D2PDMakerConf import D2PDPhotonSelector
-    photonCollNames=["PhotonCollection"]
-    for phcoll in photonCollNames:
-        photonFilterName = 'DV_PhFilter'
-        photonFilter = D2PDPhotonSelector(photonFilterName)        
-        photonFilter.ptMin = primRPVLLDESDM.DV_photonFilterFlags.photonPtCut
-        photonFilter.inputCollection = phcoll
-        photonFilter.minNumberPassed=primRPVLLDESDM.DV_photonFilterFlags.minPhotonPassed
-        topSequence+=photonFilter
-        photonFilter2Name = 'DV_PhFilter2'
-        photonFilter2 = D2PDPhotonSelector(photonFilter2Name)
-        photonFilter2.ptMin = primRPVLLDESDM.DV_photonFilterFlags2.photonPtCut        
-        photonFilter2.inputCollection = phcoll
-        photonFilter2.minNumberPassed=primRPVLLDESDM.DV_photonFilterFlags2.minPhotonPassed
-        topSequence+=photonFilter2
-        pass
+############################################################
+## Tools for combining filters
+###########################################################
+ ## needs package PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools-00-00-20 or later..
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__FilterCombinationAND
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__FilterCombinationOR
 
-    from LongLivedParticleDPDMaker.FancyJetFilter import FancyJetFilter
-    jetFilterName = "DV_JetFilter"
-    topSequence += FancyJetFilter(jetFilterName)
-    topSequence.DV_JetFilter.jetCollectionName=primRPVLLDESDM.DV_jetFilterFlagsEgamma.jetCollectionName
-    topSequence.DV_JetFilter.cutEtMin=primRPVLLDESDM.DV_jetFilterFlagsEgamma.jetPtCut
-    topSequence.DV_JetFilter.cutEtMax=14.0*Units.TeV
-    topSequence.DV_JetFilter.minNumberPassed=primRPVLLDESDM.DV_jetFilterFlagsEgamma.nJetPassed
-    topSequence.DV_JetFilter.cutSumPtTrkMax=primRPVLLDESDM.DV_jetFilterFlagsEgamma.MaxSumPtTrk
-    filtersToBookkeep+=["DV_JetFilter"]
-        
-    jetFilterName2 = "DV_JetFilter2"
-    topSequence += FancyJetFilter(jetFilterName2)
-    topSequence.DV_JetFilter2.jetCollectionName=primRPVLLDESDM.DV_jetFilterFlagsEgamma.jetCollectionName
-    topSequence.DV_JetFilter2.cutEtMin=primRPVLLDESDM.DV_jetFilterFlagsEgamma.jetPtCut
-    topSequence.DV_JetFilter2.cutEtMax=14.0*Units.TeV
-    topSequence.DV_JetFilter2.minNumberPassed=primRPVLLDESDM.DV_jetFilterFlagsEgamma.nJetPassed
-    topSequence.DV_JetFilter2.cutSumPtTrkMax=primRPVLLDESDM.DV_jetFilterFlagsEgamma.MaxSumPtTrk
-    filtersToBookkeep+=["DV_JetFilter2"]
-
-    jetAndPhFilterName = "DV_JetAndPhFilter"
-    topSequence += LogicalFilterCombiner( jetAndPhFilterName)
-    topSequence.DV_JetAndPhFilter.cmdstring = "DV_JetFilter and DV_PhFilter"
-    offlineEgammaFilterNames.append( jetAndPhFilterName )
-    filtersToBookkeep+=["DV_JetAndPhFilter"]
-    jetAndPhFilter2Name = "DV_JetAndPhFilter2"
-    topSequence += LogicalFilterCombiner( jetAndPhFilter2Name)
-    topSequence.DV_JetAndPhFilter2.cmdstring = "DV_JetFilter2 and DV_PhFilter2"
-    offlineEgammaFilterNames.append( jetAndPhFilter2Name )
-    filtersToBookkeep+=["DV_JetAndPhFilter2"]
-
-    ########### combine the offline filters
-
-    egammaFilterName = "DV_EgammaFilter"
-    topSequence += LogicalFilterCombiner( egammaFilterName )
-    egammaFilterCounter = 0
-    cmdstring = ""
-    for elFilterName in offlineEgammaFilterNames :
-        if egammaFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += elFilterName
-        egammaFilterCounter += 1
-        pass
-    topSequence.DV_EgammaFilter.cmdstring=cmdstring
-    filtersToBookkeep+=["DV_EgammaFilter"]
-    
-    
-    combinedOfflineFilterName = "DV_CombinedOfflineFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-    cmdstring = "DV_EgammaFilter"
-    topSequence.DV_CombinedOfflineFilter.cmdstring=cmdstring 
-    filtersToBookkeep+=["DV_CombinedOfflineFilter"]
-    pass
 
+############################################################
+## Trackless jet filters
+###########################################################
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__DVTracklessJetFilterTool
+
+DVSingleTracklessJetFilterTool = DerivationFramework__DVTracklessJetFilterTool( name = "DVSingleTracklessJetFilterTool",
+                                                                                JetContainerKey = jetContainer,
+                                                                                JetPtCut= primRPVLLDESDM.DV_SingleTracklessJetFilterFlags.cutEtMin,
+                                                                                JetEtaCut= primRPVLLDESDM.DV_SingleTracklessJetFilterFlags.cutEtaMax,
+                                                                                sumPtTrkCut = primRPVLLDESDM.DV_SingleTracklessJetFilterFlags.cutSumPtTrkMax,
+                                                                                nJetsRequired = 1)
+
+ToolSvc+=DVSingleTracklessJetFilterTool
+
+DVDoubleTracklessJetFilterTool = DerivationFramework__DVTracklessJetFilterTool( name = "DVDoubleTracklessJetFilterTool",
+                                                                                JetContainerKey = jetContainer,
+                                                                                JetPtCut= primRPVLLDESDM.DV_DoubleTracklessJetFilterFlags.cutEtMin,
+                                                                                JetEtaCut= primRPVLLDESDM.DV_DoubleTracklessJetFilterFlags.cutEtaMax,
+                                                                                sumPtTrkCut = primRPVLLDESDM.DV_DoubleTracklessJetFilterFlags.cutSumPtTrkMax,
+                                                                                nJetsRequired = 2)
+
+ToolSvc+=DVDoubleTracklessJetFilterTool
+
+###### add a prescale tool - needs DerivationFrameworkTools-00-00-22 or later
+
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__PrescaleTool
+DVPrescaleTool = DerivationFramework__PrescaleTool(name = "DVPrescaleTool",
+                                                   Prescale = primRPVLLDESDM.DV_PrescalerFlags.prescale
+                                                   )
+ToolSvc+=DVPrescaleTool
+
+DVCombinedTracklessJetFilterTool = DerivationFramework__FilterCombinationOR( name = "DVCombinedTracklessJetFilterTool",
+                                                                             FilterList = [DVSingleTracklessJetFilterTool,
+                                                                                           DVDoubleTracklessJetFilterTool,
+                                                                                           DVPrescaleTool],
+                                                                             OutputLevel=INFO
+                                                                             )
+ToolSvc+=DVCombinedTracklessJetFilterTool
+
+#======================================================================================================================================
+#######################################################################################################################################
+## should have all the pieces now - combine them into actual filters for the DerivationKernel #########################################
+#######################################################################################################################################
+#======================================================================================================================================
+
+
+#############################################################################################
+##  DV+muon filter
+#############################################################################################
+
+
+
+# Muon d0
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__RpvMuonD0Tool
+DVMuonD0 = DerivationFramework__RpvMuonD0Tool( name = "DVMuonD0",
+                                               CollectionName = muonContainer,
+                                               SGPrefix = "DV"+muonContainer,
+                                               )
+ToolSvc += DVMuonD0
 
-#################################################################################################
-### JetTauEtmiss stream selection
-##################################################################################################
-
-
-
-if rec.triggerStream() == "JetTauEtmiss" or primRPVLLDESDM.doDV.ForceToRunJetTauEtmissSel:
-    offlineJetFilterNames=[]
-
-## logic - 3 possible selections:
-## 1) ISR type (high-pt jet back-to-back with MET)
-## 2) multi-jet (either 4,5,6 jets, pT cuts reflecting trigger cuts) AND trackless jet
-## 3) MET AND trackless jet
-
-    
-########   ISR selection first #############################
-## JET+MET filter for ISR
-    from PrimaryDPDMaker.MissingEtFilter import MissingEtFilter
-    ISR_METFilterName = 'DV_ISR_METFilter'
-    topSequence += MissingEtFilter(ISR_METFilterName)
-    topSequence.DV_ISR_METFilter.useLeadingJet=True
-    topSequence.DV_ISR_METFilter.cutMetMin = primRPVLLDESDM.DV_ISRFilterFlags.cutMetMin
-    topSequence.DV_ISR_METFilter.minDeltaPhi=primRPVLLDESDM.DV_ISRFilterFlags.deltaPhiCut
-    topSequence.DV_ISR_METFilter.requireMet = True
-    filtersToBookkeep+=["DV_ISR_METFilter"]
-
-    from PrimaryDPDMaker.JetFilter import JetFilter
-    jetFilterName = "DV_ISR_JetFilter"
-    topSequence += JetFilter(jetFilterName)
-    topSequence.DV_ISR_JetFilter.jetCollectionName=primRPVLLDESDM.DV_ISRFilterFlags.jetCollectionName
-    topSequence.DV_ISR_JetFilter.cutEtMin=primRPVLLDESDM.DV_ISRFilterFlags.jetPtCut
-    topSequence.DV_ISR_JetFilter.cutEtMax=14.0*Units.TeV
-    topSequence.DV_ISR_JetFilter.minNumberPassed=1
-    filtersToBookkeep+=["DV_ISR_JetFilter"]
-## combine the jet and the MET
-    combinedISRFilterName = "DV_ISRFilter"
-    topSequence += LogicalFilterCombiner( combinedISRFilterName )
-    cmdstring = "DV_ISR_METFilter and DV_ISR_JetFilter"
-    topSequence.DV_ISRFilter.cmdstring=cmdstring
-    filtersToBookkeep+=["DV_ISRFilter"]
+# Kernel for the augmentation tools
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
+topSequence += DerivationFramework__DerivationKernel(
+    "RPVLL_DVAugmentationKernel",
+    AugmentationTools = [DVMuonD0],
+    )
 
-############################################################
-##  a not-very-track-y jet filter
-    from LongLivedParticleDPDMaker.FancyJetFilter import FancyJetFilter
-    jetFilterName = "DV_TracklessJetFilter"
-    topSequence += FancyJetFilter(jetFilterName)
-    topSequence.DV_TracklessJetFilter.cutEtMin=primRPVLLDESDM.DV_fancyJetFilterFlags.jetPtCut
-    topSequence.DV_TracklessJetFilter.cutEtMax=14.0*Units.TeV
-    topSequence.DV_TracklessJetFilter.minNumberPassed=primRPVLLDESDM.DV_fancyJetFilterFlags.nJetPassed
-    topSequence.DV_TracklessJetFilter.cutSumPtTrkMax=primRPVLLDESDM.DV_fancyJetFilterFlags.MaxSumPtTrk
-    topSequence.DV_TracklessJetFilter.jetCollectionName = "AntiKt4TopoEMJets"
-    filtersToBookkeep+=["DV_TracklessJetFilter"]
-
-    jetFilterName = "DV_LooseTracklessJetFilter"
-    topSequence += FancyJetFilter(jetFilterName)
-    topSequence.DV_LooseTracklessJetFilter.cutEtMin=primRPVLLDESDM.DV_looseFancyJetFilterFlags.jetPtCut
-    topSequence.DV_LooseTracklessJetFilter.cutEtMax=14.0*Units.TeV
-    topSequence.DV_LooseTracklessJetFilter.minNumberPassed=primRPVLLDESDM.DV_looseFancyJetFilterFlags.nJetPassed
-    topSequence.DV_LooseTracklessJetFilter.cutSumPtTrkMax=primRPVLLDESDM.DV_looseFancyJetFilterFlags.MaxSumPtTrk
-    topSequence.DV_LooseTracklessJetFilter.jetCollectionName = "AntiKt4TopoEMJets"
-    filtersToBookkeep+=["DV_LooseTracklessJetFilter"]    
-
-
-## METfilter
-
-    missingetFilterName = 'DV_MissingEtFilter'
-    topSequence += MissingEtFilter(missingetFilterName)
-    topSequence.DV_MissingEtFilter.cutMetMin = primRPVLLDESDM.DV_METFilterFlags.cutMetMin
-    topSequence.DV_MissingEtFilter.requireMet = True
-    topSequence.DV_MissingEtFilter.useLeadingJet=True
-    topSequence.DV_MissingEtFilter.minDeltaPhi=primRPVLLDESDM.DV_METFilterFlags.deltaPhiCut
-    filtersToBookkeep+=["DV_MissingEtFilter"]
-
-## put them together.. 
-    combinedMETFilterName = "DV_CombinedMETFilter"
-    topSequence += LogicalFilterCombiner( combinedMETFilterName )
-    cmdstring = "DV_TracklessJetFilter and DV_MissingEtFilter"
-    topSequence.DV_CombinedMETFilter.cmdstring=cmdstring
-    filtersToBookkeep+=["DV_CombinedMETFilter"]
-
-
-## Multijet filter
-    cmdstring=""
-    for i in range(3):
-        multiJetFilterName = "DV_multiJetFilter_"+str(i+4)+"trk"
-        multiJetFilter = JetFilter(multiJetFilterName)
-        multiJetFilter.jetCollectionName=primRPVLLDESDM.DV_multiJetFilterFlags.jetCollectionName
-        multiJetFilter.minNumberPassed=primRPVLLDESDM.DV_multiJetFilterFlags.nJetPassed[i]
-        multiJetFilter.cutEtMin=primRPVLLDESDM.DV_multiJetFilterFlags.jetPtCut[i]        
-        multiJetFilter.cutEtMax=14.0*Units.TeV
-        topSequence+=multiJetFilter
-        filtersToBookkeep+=[ multiJetFilterName ]
-        if i>0:
-            cmdstring+=" or "
-            pass
-        cmdstring+=multiJetFilterName
-        pass
-    combinedMultiJetFilterName="DV_MultiJetFilter"
-    topSequence+= LogicalFilterCombiner( combinedMultiJetFilterName )
-    print "NICK cmdstring is ",cmdstring
-    topSequence.DV_MultiJetFilter.cmdstring=cmdstring
-    filtersToBookkeep+=[ combinedMultiJetFilterName ]
-
-## put them together.. 
-    combinedMultiJetFilterName = "DV_CombinedMultiJetFilter"
-    topSequence += LogicalFilterCombiner( combinedMultiJetFilterName )
-    cmdstring = "DV_LooseTracklessJetFilter and DV_MultiJetFilter"
-    topSequence.DV_CombinedMultiJetFilter.cmdstring=cmdstring
-    filtersToBookkeep+=["DV_CombinedMultiJetFilter"]
-##
-    
-## just for fun, configure a track filter
-
-    from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import StealthFilterAlg
-    stealthFilterName = 'DV_StealthFilter'
-    topSequence += StealthFilterAlg(stealthFilterName)
-    offlineObjectFilterNames.append( stealthFilterName )
-
-    topSequence.DV_StealthFilter.cutMinTrackSd0 = primRPVLLDESDM.DV_stealthFilterFlags.cutMinTrackSd0
-    topSequence.DV_StealthFilter.cutMinNTracks = primRPVLLDESDM.DV_stealthFilterFlags.cutMinNTracks
-    topSequence.DV_StealthFilter.cutMinTrackpT = primRPVLLDESDM.DV_stealthFilterFlags.cutMinTrackpT
-    topSequence.DV_StealthFilter.cutMinTrackEta = primRPVLLDESDM.DV_stealthFilterFlags.cutMinTrackEta
-    topSequence.DV_StealthFilter.passAll = False
-    filtersToBookkeep+=["DV_StealthFilter"]
-
-    combinedOfflineFilterName = "DV_CombinedOfflineFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-    cmdstring = "DV_CombinedMETFilter or DV_CombinedMultiJetFilter or DV_ISRFilter"
-    topSequence.DV_CombinedOfflineFilter.cmdstring=cmdstring 
-    filtersToBookkeep+=["DV_CombinedOfflineFilter"]
+DVMuonTriggerFilter = skimtool( name = "DVMuonTriggerFilter",
+                                expression = DVTriggerSelectionString(primRPVLLDESDM.DV_MuonFilterFlags)
+                                )
+ToolSvc+=DVMuonTriggerFilter
+muonFilterExpression = "count("+muonContainer+".pt > "+str(primRPVLLDESDM.DV_MuonFilterFlags.cutEtMin)+" && (DV"+muonContainer+"isCombined==0 || abs(DV"+muonContainer+"D0)>1.5) )>0"
 
-    pass
+DVMuonFilterTool = skimtool( name = "DVMuonFilterTool",
+                             expression = muonFilterExpression)
+ToolSvc+=DVMuonFilterTool
 
-#################################################################################################
-###########  End of stream-specific section.
-########### combine the trigger and offline filters
+DV_MuonFinalFilter = DerivationFramework__FilterCombinationAND( name = "DV_MuonFinalFilter",
+                                                                FilterList=[DVMuonFilterTool,DVMuonTriggerFilter],
+                                                                OutputLevel=INFO
+                                                                )
+ToolSvc+=DV_MuonFinalFilter
+topSequence += kernel("RPVLL_DVMuonFilterKernel",
+                      SkimmingTools = [DV_MuonFinalFilter])
+RPVLLfilterNames.extend(["RPVLL_DVMuonFilterKernel"])
 
-DVCombinedFilter=LogicalFilterCombiner("DVCombinedFilter")
-topSequence+=DVCombinedFilter
+########################################
+## photon filter for DV+electron
+#######################################
 
-topSequence.DVCombinedFilter.cmdstring="DV_CombinedTriggerFilter and DV_CombinedOfflineFilter"
+DVPhotonTriggerFilter = skimtool( name = "DVPhotonTriggerFilter",
+                                expression = DVTriggerSelectionString(primRPVLLDESDM.DV_PhotonFilterFlags)
+                                )
+ToolSvc += DVPhotonTriggerFilter
 
-########### add this to the global top filter
+DVPhotonFilterTool = skimtool( name = "DVPhotonFilterTool",
+                               expression = DVSelectionString(primRPVLLDESDM.DV_PhotonFilterFlags, photonContainer),
+                               )
+ToolSvc += DVPhotonFilterTool
+DV_PhotonFinalFilter = DerivationFramework__FilterCombinationAND( name = "DV_PhotonFinalFilter",
+                                                                  FilterList=[DVPhotonFilterTool,DVPhotonTriggerFilter],
+                                                                  OutputLevel=INFO
+                                                                  )
+
+ToolSvc+=DV_PhotonFinalFilter
+
+topSequence += kernel( "RPVLL_DV_PhotonFilterKernel",
+                       SkimmingTools = [DV_PhotonFinalFilter]
+                       )
+RPVLLfilterNames.extend(["RPVLL_DV_PhotonFilterKernel"])
 
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="DVCombinedFilter"
 
-filtersToBookkeep+=["DVCombinedFilter"]
+###########################################################################################
+# DV+jets filter
+###########################################################################################
+
+DVMultiJetTriggerFilter = skimtool( name = "DVMultiJetTriggerFilter",
+                                  expression = DVTriggerSelectionString(primRPVLLDESDM.DV_MultiJetTriggerFlags)
+                                  )
+ToolSvc += DVMultiJetTriggerFilter
+
+DV4JetFilterTool = skimtool( name = "DV4JetFilterTool",
+                                 expression = DVSelectionString(primRPVLLDESDM.DV_4JetFilterFlags, jetContainer),
+                                        )
+ToolSvc += DV4JetFilterTool
+
+
+DV5JetFilterTool = skimtool( name = "DV5JetFilterTool",
+                             expression = DVSelectionString(primRPVLLDESDM.DV_5JetFilterFlags, jetContainer),
+                             )
+ToolSvc += DV5JetFilterTool
+
+
+DV6JetFilterTool = skimtool( name = "DV6JetFilterTool",
+                             expression = DVSelectionString(primRPVLLDESDM.DV_6JetFilterFlags, jetContainer),
+                             )
+ToolSvc += DV6JetFilterTool
+
+DV7JetFilterTool = skimtool( name = "DV7JetFilterTool",
+                             expression = DVSelectionString(primRPVLLDESDM.DV_7JetFilterFlags, jetContainer),
+                             )
+ToolSvc += DV7JetFilterTool
+
+
+
+
+DV_multiJet_offlineJetFilter = DerivationFramework__FilterCombinationOR( name = "DV_multiJet_offlineJetFilter",
+                                                                        FilterList=[DV4JetFilterTool,DV5JetFilterTool,DV6JetFilterTool,DV7JetFilterTool],
+                                                                        OutputLevel=INFO
+                                                                        )
+ToolSvc += DV_multiJet_offlineJetFilter
+
+
+
+DV_MultiJetFinalFilter = DerivationFramework__FilterCombinationAND( name = "DV_MultiJetFinalFilter",
+                                                                    FilterList=[DV_multiJet_offlineJetFilter,DVCombinedTracklessJetFilterTool,DVMultiJetTriggerFilter],
+                                                                    OutputLevel=INFO
+                                                                        )
+ToolSvc+= DV_MultiJetFinalFilter
+
+topSequence += kernel( "RPVLL_DV_MultiJetFilterKernel",
+                       SkimmingTools = [DV_MultiJetFinalFilter],
+                       )
+RPVLLfilterNames.extend(["RPVLL_DV_MultiJetFilterKernel"])
+
+
+############################################################
+## DV+MET filter
+###########################################################
+
+DVMETTriggerFilter = skimtool( name = "DVMETTriggerFilter",
+                               expression = DVTriggerSelectionString(primRPVLLDESDM.DV_METFilterFlags)
+                               )
+
+ToolSvc+=DVMETTriggerFilter
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__DVMissingETFilterTool
+
+
+DVMETFilterTool = DerivationFramework__DVMissingETFilterTool(name = "DVMETFilterTool",
+                                                             METContainerKey = METContainer,
+                                                             METCut=primRPVLLDESDM.DV_METFilterFlags.cutMetMin)
+ToolSvc+=DVMETFilterTool
+
+DV_METFinalFilter = DerivationFramework__FilterCombinationAND( name = "DV_METFinalFilter",
+                                                               FilterList=[DVMETFilterTool,DVCombinedTracklessJetFilterTool,DVMETTriggerFilter],
+                                                               OutputLevel=INFO
+                                                               )
+ToolSvc += DV_METFinalFilter
+
+topSequence += kernel( "RPVLL_DV_METFilterKernel",
+                       SkimmingTools = [DV_METFinalFilter],
+                       )
+RPVLLfilterNames.extend(["RPVLL_DV_METFilterKernel"])
+
+#########################################################################
+### M_eff filter - use the MET trigger, but then cut on Meff, or MET/Meff
+#######################################################################
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__DVMeffFilterTool
+DVMeffFilterTool = DerivationFramework__DVMeffFilterTool(name = "DVMeffFilterTool",
+                                                         METContainerKey = METContainer,
+                                                         MeffCut=primRPVLLDESDM.DV_MeffFilterFlags.cutMeffMin,
+                                                         METCut=primRPVLLDESDM.DV_MeffFilterFlags.cutMETMin,
+                                                         METoverMeffCut=primRPVLLDESDM.DV_MeffFilterFlags.cutMEToverMeffMin)
+ToolSvc += DVMeffFilterTool
+
+DV_MeffFinalFilter = DerivationFramework__FilterCombinationAND( name = "DV_MEffFinalFilter",
+                                                               FilterList=[DVMeffFilterTool,DVMETTriggerFilter],
+                                                               OutputLevel=INFO
+                                                                )
+ToolSvc += DV_MeffFinalFilter
+
+topSequence += kernel( "RPVLL_DV_MeffFilterKernel",
+                       SkimmingTools = [DV_MeffFinalFilter],
+                       )
+RPVLLfilterNames.extend(["RPVLL_DV_MeffFilterKernel"])
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DiLep.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DiLep.py
index d15274ab9e35767b56ea7e8663ad35d0b61eb9df..53e1d9a5b7fa485dc3d5ba2c498a4f1f4f5165f8 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DiLep.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_DiLep.py
@@ -1,369 +1,214 @@
+# ##########################################################################################
+# Electron/photon/muon augmentation
+# Use the derivation framework tools directly
+# ##########################################################################################
+
+# Cache the container names (used throughout)
+photons   = primRPVLLDESDM.DiLep_containerFlags.photonCollectionName
+electrons = primRPVLLDESDM.DiLep_containerFlags.electronCollectionName
+muons     = primRPVLLDESDM.DiLep_containerFlags.muonCollectionName
+
+# Electron d0
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__RpvElectronD0Tool
+DiLepElectronD0 = DerivationFramework__RpvElectronD0Tool( name           = "DiLepElectronD0",
+                                                          CollectionName = electrons,
+                                                          SGPrefix       = "DiLep" + electrons,
+                                                        )
+ToolSvc += DiLepElectronD0
+
+# Muon d0
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__RpvMuonD0Tool
+DiLepMuonD0 = DerivationFramework__RpvMuonD0Tool( name           = "DiLepMuonD0",
+                                                  CollectionName = muons,
+                                                  SGPrefix       = "DiLep" + muons,
+                                                )
+ToolSvc += DiLepMuonD0
+
+# Muon IsMS
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__RpvMuonMSTool
+DiLepMuonMS = DerivationFramework__RpvMuonMSTool( name           = "DiLepMuonMS",
+                                                  CollectionName = muons,
+                                                  SGPrefix       = "DiLep" + muons,
+                                                )
+ToolSvc += DiLepMuonMS
+
+# PROBLEM! Classes I want to use are not available in AtlasProduction
+# For now, I copied the classes to this package
+
+# Photon IsEM
+# from DerivationFrameworkEGamma.DerivationFrameworkEGammaConf import DerivationFramework__EGammaPassSelectionWrapper
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__RpvEgammaIDTool
+DiLepPhotonSelection = DerivationFramework__RpvEgammaIDTool( name               = "DiLepPhotonSelection",
+                                                             SelectionVariables = ["Loose", "Tight"],
+                                                             CollectionName     = photons,
+                                                             SGPrefix           = "DiLep" + photons,
+                                                           )
+ToolSvc += DiLepPhotonSelection
+
+# Electron IsEM
+DiLepElectronSelection = DerivationFramework__RpvEgammaIDTool( name               = "DiLepElectronSelection",
+                                                               SelectionVariables = ["Loose", "Medium", "Tight"],
+                                                               CollectionName     = electrons,
+                                                               SGPrefix           = "DiLep" + electrons,
+                                                             )
+ToolSvc += DiLepElectronSelection
+
+# Kernel for the augmentation tools
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
+topSequence += DerivationFramework__DerivationKernel( "RPVLLAugmentationKernel",
+                                                      AugmentationTools = [DiLepElectronD0, DiLepMuonD0, DiLepMuonMS, DiLepPhotonSelection, DiLepElectronSelection],
+                                                    )
+
+# ##########################################################################################
+# Selection algorithms setup
+# ##########################################################################################
+
+def EgammaSelectionString(flags, container, number = 1):
+    """Construct electron and photon selection string based on the flags provided (from DiLepFlags)
+    """
+
+    cutList = []
+    if flags.cutEtMin:  cutList.append('%s.pt > %s'          % (container, flags.cutEtMin))
+    if flags.cutEtaMax: cutList.append('abs(%s.eta) < %s'    % (container, flags.cutEtaMax))
+    if flags.cutd0Min:  cutList.append('abs(DiLep%sD0) > %s' % (container, flags.cutd0Min))
+    if flags.cutIsEM:   cutList.append('DiLep%s%s'           % (container, flags.cutIsEM))
+
+    cutString = 'count(' + ' && '.join(cutList) + ') > %i' % (number-1)
+    if flags.trigger: cutString = flags.trigger + ' && ' + cutString
+
+    print cutString
+    return cutString
+
+def MuonSelectionString(flags, container, number = 1):
+    """Construct muon selection string based on the flags provided (from DiLepFlags)
+    """
+
+    cutList_combined = []
+    if flags.cutEtMin:  cutList_combined.append('%s.pt > %s'          % (container, flags.cutEtMin))
+    if flags.cutEtaMax: cutList_combined.append('abs(%s.eta) < %s'    % (container, flags.cutEtaMax))
+    if flags.cutd0Min:  cutList_combined.append('abs(DiLep%sD0) > %s' % (container, flags.cutd0Min))
+    cutList_combined.append('DiLep%sisCombined == 1' % (container))
+
+    cutList_msonly = []
+    if flags.cutEtMin:  cutList_msonly.append('%s.pt > %s'       % (container, flags.cutEtMin))
+    if flags.cutEtaMax: cutList_msonly.append('abs(%s.eta) < %s' % (container, flags.cutEtaMax))
+    cutList_msonly.append('DiLep%sisCombined == 0' % (container))
+    cutList_msonly.append('DiLep%sisMS == 1'       % (container))
+
+    cutString = 'count((' + ' && '.join(cutList_combined) + ') || (' + ' && '.join(cutList_msonly) + ')) > %i' % (number-1)
+    if flags.trigger: cutString = flags.trigger + ' && ' + cutString
+
+    print cutString
+    return cutString
+
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool as skimtool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel
+
+# ##########################################################################################
+# Single photon filter
+# ##########################################################################################
+
+DiLepSinglePhotonFilterTool = skimtool( name       = "DiLepSinglePhotonFilterTool",
+                                        expression = EgammaSelectionString(primRPVLLDESDM.DiLep_singlePhotonFilterFlags, photons, 1),
+                                      )
+ToolSvc     += DiLepSinglePhotonFilterTool
+topSequence += kernel( "RPVLL_DiLep_SinglePhotonFilterKernel",
+                       SkimmingTools = [DiLepSinglePhotonFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_SinglePhotonFilterKernel"])
+
+# ##########################################################################################
+# Single photon + X filter
+# ##########################################################################################
+
+pString  = EgammaSelectionString(primRPVLLDESDM.DiLep_singlePhotonFilterFlags, photons, 1)
+apString = EgammaSelectionString(primRPVLLDESDM.DiLep_singlePhotonFilterFlags_addph, photons, 2) # 2 is not a bug! (double counting)
+aeString = EgammaSelectionString(primRPVLLDESDM.DiLep_singlePhotonFilterFlags_addel, electrons, 1)
+amString = MuonSelectionString(primRPVLLDESDM.DiLep_singlePhotonFilterFlags_addmu, muons, 1)
+DiLepSinglePhotonXFilterTool = skimtool( name       = "DiLepSinglePhotonXFilterTool",
+                                         expression = pString + ' && (' + apString + ' || ' + aeString + ' || ' + amString + ')',
+                                       )
+ToolSvc     += DiLepSinglePhotonXFilterTool
+topSequence += kernel( "RPVLL_DiLep_SinglePhotonXFilterKernel",
+                       SkimmingTools = [DiLepSinglePhotonXFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_SinglePhotonXFilterKernel"])
+
+# ##########################################################################################
+# Single electron filter
+# ##########################################################################################
+
+DiLepSingleElectronFilterTool = skimtool( name       = "DiLepSingleElectronFilterTool",
+                                          expression = EgammaSelectionString(primRPVLLDESDM.DiLep_singleElectronFilterFlags, electrons, 1),
+                                        )
+ToolSvc     += DiLepSingleElectronFilterTool
+topSequence += kernel( "RPVLL_DiLep_SingleElectronFilterKernel",
+                       SkimmingTools = [DiLepSingleElectronFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_SingleElectronFilterKernel"])
+
+# ##########################################################################################
+# Single muon filter
+# ##########################################################################################
+
+DiLepSingleMuonFilterTool = skimtool( name       = "DiLepSingleMuonFilterTool",
+                                      expression = MuonSelectionString(primRPVLLDESDM.DiLep_singleMuonFilterFlags, muons, 1),
+                                    )
+ToolSvc     += DiLepSingleMuonFilterTool
+topSequence += kernel( "RPVLL_DiLep_SingleMuonFilterKernel",
+                       SkimmingTools = [DiLepSingleMuonFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_SingleMuonFilterKernel"])
+
+# ##########################################################################################
+# Double photon filter
+# ##########################################################################################
+
+DiLepDiPhotonFilterTool = skimtool( name       = "DiLepDiPhotonFilterTool",
+                                    expression = EgammaSelectionString(primRPVLLDESDM.DiLep_diPhotonFilterFlags, photons, 2),
+                                  )
+ToolSvc     += DiLepDiPhotonFilterTool
+topSequence += kernel( "RPVLL_DiLep_DiPhotonFilterKernel",
+                       SkimmingTools = [DiLepDiPhotonFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_DiPhotonFilterKernel"])
+
+# ##########################################################################################
+# Double electron filter
+# ##########################################################################################
+
+DiLepDiElectronFilterTool = skimtool( name       = "DiLepDiElectronFilterTool",
+                                      expression = EgammaSelectionString(primRPVLLDESDM.DiLep_diElectronFilterFlags, electrons, 2),
+                                    )
+ToolSvc     += DiLepDiElectronFilterTool
+topSequence += kernel( "RPVLL_DiLep_DiElectronFilterKernel",
+                       SkimmingTools = [DiLepDiElectronFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_DiElectronFilterKernel"])
+
+# ##########################################################################################
+# Double electron+photon filters
+# ##########################################################################################
+
+eString = EgammaSelectionString(primRPVLLDESDM.DiLep_diEgammaFilterFlags_electron, electrons, 1)
+gString = EgammaSelectionString(primRPVLLDESDM.DiLep_diEgammaFilterFlags_photon, photons, 1)
+DiLepDiEgammaFilterTool = skimtool( name       = "DiLepDiEgammaFilterTool",
+                                    expression = eString + ' && ' + gString,
+                                  )
+ToolSvc     += DiLepDiEgammaFilterTool
+topSequence += kernel( "RPVLL_DiLep_DiEgammaFilterKernel",
+                       SkimmingTools = [DiLepDiEgammaFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_DiEgammaFilterKernel"])
+
+eLString = EgammaSelectionString(primRPVLLDESDM.DiLep_diLooseEgammaFilterFlags_electron, electrons, 1)
+gLString = EgammaSelectionString(primRPVLLDESDM.DiLep_diLooseEgammaFilterFlags_photon, photons, 1)
+DiLepDiLooseEgammaFilterTool = skimtool( name       = "DiLepDiLooseEgammaFilterTool",
+                                         expression = eLString + ' && ' + gLString,
+                                       )
+ToolSvc     += DiLepDiLooseEgammaFilterTool
+topSequence += kernel( "RPVLL_DiLep_DiLooseEgammaFilterKernel",
+                       SkimmingTools = [DiLepDiLooseEgammaFilterTool],
+                     )
+RPVLLfilterNames.extend(["RPVLL_DiLep_DiLooseEgammaFilterKernel"])
 
-### configure trigger filters
-if len(primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DiLep_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DiLep_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DiLep_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = primRPVLLDESDM.DiLep_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames += primRPVLLDESDM.DiLep_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames += primRPVLLDESDM.DiLep_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames))
-
-triggerFilterNames=[]
-
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.DiLep_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "DiLep_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "DiLep_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.DiLep_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["DiLep_CombinedTriggerFilter"]
-
-offlineObjectFilterNames=[]
-
-## configure a photon filter
-
-from PrimaryDPDMaker.PhotonFilter import PhotonFilter
-photonFilterName = 'DiLep_PhotonFilter'
-topSequence += PhotonFilter(photonFilterName)
-offlineObjectFilterNames.append( photonFilterName )
-topSequence.DiLep_PhotonFilter.cutEtMin = primRPVLLDESDM.DiLep_photonFilterFlags.cutEtMin
-topSequence.DiLep_PhotonFilter.cutEtaMax = primRPVLLDESDM.DiLep_photonFilterFlags.cutEtaMax
-topSequence.DiLep_PhotonFilter.cutIsEM=primRPVLLDESDM.DiLep_photonFilterFlags.cutIsEM
-topSequence.DiLep_PhotonFilter.cutAuthor=primRPVLLDESDM.DiLep_photonFilterFlags.cutAuthor
-topSequence.DiLep_PhotonFilter.photonCollectionName=primRPVLLDESDM.DiLep_photonFilterFlags.photonCollectionName
-
-## configure a electron filter
-
-from PrimaryDPDMaker.ElectronFilter import ElectronFilter
-electronFilterName = 'DiLep_ElectronFilter'
-topSequence += ElectronFilter(electronFilterName)
-##offlineObjectFilterNames.append( electronFilterName )
-topSequence.DiLep_ElectronFilter.cutEtMin = primRPVLLDESDM.DiLep_electronFilterFlags.cutEtMin
-topSequence.DiLep_ElectronFilter.cutEtaMax = primRPVLLDESDM.DiLep_electronFilterFlags.cutEtaMax
-topSequence.DiLep_ElectronFilter.cutIsEM=primRPVLLDESDM.DiLep_electronFilterFlags.cutIsEM
-topSequence.DiLep_ElectronFilter.cutAuthor=primRPVLLDESDM.DiLep_electronFilterFlags.cutAuthor
-topSequence.DiLep_ElectronFilter.electronCollectionName=primRPVLLDESDM.DiLep_electronFilterFlags.electronCollectionName
-
-
-
-## configure a medium photon filter
-
-from PrimaryDPDMaker.PhotonFilter import PhotonFilter
-sphotonFilterName = 'DiLep_MediumPhotonFilter'
-topSequence += PhotonFilter(sphotonFilterName)
-#offlineObjectFilterNames.append( sphotonFilterName )
-topSequence.DiLep_MediumPhotonFilter.cutEtMin = primRPVLLDESDM.DiLep_mediumphotonFilterFlags.cutEtMin
-topSequence.DiLep_MediumPhotonFilter.cutEtaMax = primRPVLLDESDM.DiLep_mediumphotonFilterFlags.cutEtaMax
-topSequence.DiLep_MediumPhotonFilter.cutIsEM=primRPVLLDESDM.DiLep_mediumphotonFilterFlags.cutIsEM
-topSequence.DiLep_MediumPhotonFilter.cutAuthor=primRPVLLDESDM.DiLep_mediumphotonFilterFlags.cutAuthor
-topSequence.DiLep_MediumPhotonFilter.photonCollectionName=primRPVLLDESDM.DiLep_mediumphotonFilterFlags.photonCollectionName
-
-## configure a medium electron filter
-
-from PrimaryDPDMaker.ElectronFilter import ElectronFilter
-selectronFilterName = 'DiLep_MediumElectronFilter'
-topSequence += ElectronFilter(selectronFilterName)
-#offlineObjectFilterNames.append( selectronFilterName )
-topSequence.DiLep_MediumElectronFilter.cutEtMin = primRPVLLDESDM.DiLep_mediumelectronFilterFlags.cutEtMin
-topSequence.DiLep_MediumElectronFilter.cutEtaMax = primRPVLLDESDM.DiLep_mediumelectronFilterFlags.cutEtaMax
-topSequence.DiLep_MediumElectronFilter.cutIsEM=primRPVLLDESDM.DiLep_mediumelectronFilterFlags.cutIsEM
-topSequence.DiLep_MediumElectronFilter.cutAuthor=primRPVLLDESDM.DiLep_mediumelectronFilterFlags.cutAuthor
-topSequence.DiLep_MediumElectronFilter.electronCollectionName=primRPVLLDESDM.DiLep_mediumelectronFilterFlags.electronCollectionName
-
-## configure a soft photon filter
-
-from PrimaryDPDMaker.PhotonFilter import PhotonFilter
-sphotonFilterName = 'DiLep_SoftPhotonFilter'
-topSequence += PhotonFilter(sphotonFilterName)
-#offlineObjectFilterNames.append( sphotonFilterName )
-topSequence.DiLep_SoftPhotonFilter.cutEtMin = primRPVLLDESDM.DiLep_softphotonFilterFlags.cutEtMin
-topSequence.DiLep_SoftPhotonFilter.cutEtaMax = primRPVLLDESDM.DiLep_softphotonFilterFlags.cutEtaMax
-topSequence.DiLep_SoftPhotonFilter.cutIsEM=primRPVLLDESDM.DiLep_softphotonFilterFlags.cutIsEM
-topSequence.DiLep_SoftPhotonFilter.cutAuthor=primRPVLLDESDM.DiLep_softphotonFilterFlags.cutAuthor
-topSequence.DiLep_SoftPhotonFilter.photonCollectionName=primRPVLLDESDM.DiLep_softphotonFilterFlags.photonCollectionName
-
-## configure a soft electron filter
-
-from PrimaryDPDMaker.ElectronFilter import ElectronFilter
-selectronFilterName = 'DiLep_SoftElectronFilter'
-topSequence += ElectronFilter(selectronFilterName)
-#offlineObjectFilterNames.append( selectronFilterName )
-topSequence.DiLep_SoftElectronFilter.cutEtMin = primRPVLLDESDM.DiLep_softelectronFilterFlags.cutEtMin
-topSequence.DiLep_SoftElectronFilter.cutEtaMax = primRPVLLDESDM.DiLep_softelectronFilterFlags.cutEtaMax
-topSequence.DiLep_SoftElectronFilter.cutIsEM=primRPVLLDESDM.DiLep_softelectronFilterFlags.cutIsEM
-topSequence.DiLep_SoftElectronFilter.cutAuthor=primRPVLLDESDM.DiLep_softelectronFilterFlags.cutAuthor
-topSequence.DiLep_SoftElectronFilter.electronCollectionName=primRPVLLDESDM.DiLep_softelectronFilterFlags.electronCollectionName
-
-## configure a soft muon filter
-
-#from PrimaryDPDMaker.MuonFilter import MuonFilter
-#muonFilterName = 'DiLep_MuonFilter'
-#topSequence += MuonFilter(muonFilterName)
-##offlineObjectFilterNames.append( smuonFilterName )
-#topSequence.DiLep_MuonFilter.cutPtMinMu = primRPVLLDESDM.DiLep_muonFilterFlags.cutEtMin
-#topSequence.DiLep_MuonFilter.usingAOD = False 
-#topSequence.DiLep_MuonFilter.cutEtaMax = primRPVLLDESDM.DiLep_muonFilterFlags.cutEtaMax
-#topSequence.DiLep_MuonFilter.cutContainerMu=primRPVLLDESDM.DiLep_muonFilterFlags.cutContainerMu
-#topSequence.DiLep_MuonFilter.muonAuthors="all"
-#topSequence.DiLep_MuonFilter.muonContainers="all"
-#topSequence.DiLep_MuonFilter.minNumberPassed=1
-
-
-
-offlineMuonFilterNames=[]
-
-	## configure muon filters
-
-from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
-
-muonCollNames=["MuidESDMuonCollection", "MuidMuonCollection", "StacoESDMuonCollection", "StacoMuonCollection"]
-
-for mucoll in muonCollNames:
-	muonFilterName = 'DiLep_MuFilter_'+mucoll
-	muonFilter = D2PDMuonSelector(muonFilterName)
-	offlineMuonFilterNames.append( muonFilterName )
-	muonFilter.ptMin = primRPVLLDESDM.DiLep_muonFilterFlags.cutEtMin
-	muonFilter.absEtaMax =primRPVLLDESDM.DiLep_muonFilterFlags.cutEtaMax
-	muonFilter.inputCollection = mucoll
-	muonFilter.minNumberPassed=1
-	topSequence+=muonFilter
-
-muonFilterName = "DiLep_MuonFilter"
-topSequence += LogicalFilterCombiner( muonFilterName )
-muonFilterCounter = 0
-cmdstring = ""
-for muFilterName in offlineMuonFilterNames :
-	if muonFilterCounter > 0 :
-		cmdstring += " or "
-		pass
-	cmdstring += muFilterName
-	muonFilterCounter += 1
-	pass
-      
-topSequence.DiLep_MuonFilter.cmdstring=cmdstring ##+ " and DV_JetFilter2"
-
-## configure a diphoton filter
-from PrimaryDPDMaker.DiPhotonFilter import DiPhotonFilter
-diphotonFilterName = 'DiLep_DiPhotonFilter'
-topSequence += DiPhotonFilter(diphotonFilterName)
-offlineObjectFilterNames.append( diphotonFilterName )
-topSequence.DiLep_DiPhotonFilter.cutEtMin1 = primRPVLLDESDM.DiLep_diphotonFilterFlags.cutEtMin1
-topSequence.DiLep_DiPhotonFilter.cutEtMin2 = primRPVLLDESDM.DiLep_diphotonFilterFlags.cutEtMin2
-topSequence.DiLep_DiPhotonFilter.cutIsEM1=primRPVLLDESDM.DiLep_diphotonFilterFlags.cutIsEM1
-topSequence.DiLep_DiPhotonFilter.cutIsEM2=primRPVLLDESDM.DiLep_diphotonFilterFlags.cutIsEM2
-topSequence.DiLep_DiPhotonFilter.cutAuthor1=primRPVLLDESDM.DiLep_diphotonFilterFlags.cutAuthor1
-topSequence.DiLep_DiPhotonFilter.cutAuthor2=primRPVLLDESDM.DiLep_diphotonFilterFlags.cutAuthor2
-
-## configure a dielectron filter
-from PrimaryDPDMaker.DiElectronFilter import DiElectronFilter
-dielectronFilterName = 'DiLep_DiElectronFilter'
-topSequence += DiElectronFilter(dielectronFilterName)
-##offlineObjectFilterNames.append( dielectronFilterName )
-topSequence.DiLep_DiElectronFilter.cutEtMin1 = primRPVLLDESDM.DiLep_dielectronFilterFlags.cutEtMin1
-topSequence.DiLep_DiElectronFilter.cutEtMin2 = primRPVLLDESDM.DiLep_dielectronFilterFlags.cutEtMin2
-topSequence.DiLep_DiElectronFilter.cutIsEM1=primRPVLLDESDM.DiLep_dielectronFilterFlags.cutIsEM1
-topSequence.DiLep_DiElectronFilter.cutIsEM2=primRPVLLDESDM.DiLep_dielectronFilterFlags.cutIsEM2
-topSequence.DiLep_DiElectronFilter.cutAuthor1=primRPVLLDESDM.DiLep_dielectronFilterFlags.cutAuthor1
-topSequence.DiLep_DiElectronFilter.cutAuthor2=primRPVLLDESDM.DiLep_dielectronFilterFlags.cutAuthor2
-
-## configure a EMCluster filter
-
-#from PrimaryDPDMaker.DiEMClusterFilter import DiEMClusterFilter
-#diemclusterFilterName = 'DiLep_DiEMClusterFilter'
-#topSequence += DiEMClusterFilter(diemclusterFilterName)
-#offlineObjectFilterNames.append( diemclusterFilterName )
-#
-#topSequence.DiLep_DiEMClusterFilter.cutEtMinEMCl1 = primRPVLLDESDM.DiLep_diemclusterFilterFlags.cutEtMinEMCl1
-#topSequence.DiLep_DiEMClusterFilter.cutEtMinEMCl2 = primRPVLLDESDM.DiLep_diemclusterFilterFlags.cutEtMinEMCl2 
-#topSequence.DiLep_DiEMClusterFilter.cutEtaMax   = primRPVLLDESDM.DiLep_diemclusterFilterFlags.cutEtaMax
-#topSequence.DiLep_DiEMClusterFilter.removeEtaCrack= primRPVLLDESDM.DiLep_diemclusterFilterFlags.removeEtaCrack
-#topSequence.DiLep_DiEMClusterFilter.crackEtaMin = primRPVLLDESDM.DiLep_diemclusterFilterFlags.crackEtaMin
-#topSequence.DiLep_DiEMClusterFilter.crackEtaMax = primRPVLLDESDM.DiLep_diemclusterFilterFlags.crackEtaMax
-#
-#### configure a EMCluster filter
-#
-#from PrimaryDPDMaker.DiEMClusterFilter import DiEMClusterFilter
-#diemcluster2FilterName = 'DiLep_DiEMCluster2Filter'
-#topSequence += DiEMClusterFilter(diemcluster2FilterName)
-#offlineObjectFilterNames.append( diemcluster2FilterName )
-#
-#topSequence.DiLep_DiEMCluster2Filter.cutEtMinEMCl1 = primRPVLLDESDM.DiLep_diemcluster2FilterFlags.cutEtMinEMCl1
-#topSequence.DiLep_DiEMCluster2Filter.cutEtMinEMCl2 = primRPVLLDESDM.DiLep_diemcluster2FilterFlags.cutEtMinEMCl2 
-#topSequence.DiLep_DiEMCluster2Filter.cutEtaMax   = primRPVLLDESDM.DiLep_diemcluster2FilterFlags.cutEtaMax
-#topSequence.DiLep_DiEMCluster2Filter.removeEtaCrack= primRPVLLDESDM.DiLep_diemcluster2FilterFlags.removeEtaCrack
-#topSequence.DiLep_DiEMCluster2Filter.crackEtaMin = primRPVLLDESDM.DiLep_diemcluster2FilterFlags.crackEtaMin
-#topSequence.DiLep_DiEMCluster2Filter.crackEtaMax = primRPVLLDESDM.DiLep_diemcluster2FilterFlags.crackEtaMax
-## configure a MissingEt filter
-
-### configure an ElectronPhoton filter
-#topSequence += LogicalFilterCombiner( "DiLep_ElectronPhotonFilter" )
-#topSequence.DiLep_ElectronPhotonFilter = "DiLep_PhotonFilter and DiLep_SoftElectronFilter"
-#
-
-ElectronPhotonFilterName = "DiLep_softElectronPhotonFilter"
-topSequence += LogicalFilterCombiner( ElectronPhotonFilterName)
-topSequence.DiLep_softElectronPhotonFilter.cmdstring = "DiLep_MediumPhotonFilter and DiLep_SoftElectronFilter"
-offlineObjectFilterNames.append( "DiLep_softElectronPhotonFilter" )
-
-
-
-MuonPhotonFilterName = "DiLep_softMuonPhotonFilter"
-topSequence += LogicalFilterCombiner( MuonPhotonFilterName)
-topSequence.DiLep_softMuonPhotonFilter.cmdstring = "DiLep_SoftPhotonFilter and DiLep_MuonFilter"
-offlineObjectFilterNames.append( "DiLep_softMuonPhotonFilter" )
-
-
-
-
-#filtersToBookkeep+=["DV_JetOrD0Filter"]
-##
-
-from PrimaryDPDMaker.MissingEtFilter import MissingEtFilter
-missingetFilterName = 'DiLep_MissingEtFilter'
-topSequence += MissingEtFilter(missingetFilterName)
-offlineObjectFilterNames.append( missingetFilterName )
-
-topSequence.DiLep_MissingEtFilter.cutMetMin = primRPVLLDESDM.DiLep_missingetFilterFlags.cutMetMin
-topSequence.DiLep_MissingEtFilter.jetContainerTypeList = primRPVLLDESDM.DiLep_missingetFilterFlags.jetContainerTypeList
-topSequence.DiLep_MissingEtFilter.jetContainerNameList = primRPVLLDESDM.DiLep_missingetFilterFlags.jetContainerNameList
-topSequence.DiLep_MissingEtFilter.useUncalibratedJets = primRPVLLDESDM.DiLep_missingetFilterFlags.useUncalibratedJets
-topSequence.DiLep_MissingEtFilter.useLeadingJet = primRPVLLDESDM.DiLep_missingetFilterFlags.useLeadingJet
-topSequence.DiLep_MissingEtFilter.minDeltaPhi = primRPVLLDESDM.DiLep_missingetFilterFlags.minDeltaPhi
-topSequence.DiLep_MissingEtFilter.requireMet = primRPVLLDESDM.DiLep_missingetFilterFlags.requireMet
-
-##if rec.triggerStream() == "Egamma":
-  ##  offlineEgammaFilterNames=[]
-    
-from D2PDMaker.D2PDMakerConf import D2PDElectronSelector	
-electronCollNames=["ElectronCollection"]
-
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlgEgamma
-d0FilterEgammaName="DiLep_egammad0Filter"
-d0FilterEgamma=DVFilterAlgEgamma(d0FilterEgammaName)
-offlineObjectFilterNames.append(  d0FilterEgammaName )
-topSequence+=d0FilterEgamma
-topSequence.DiLep_egammad0Filter.electronD0Cut=primRPVLLDESDM.DiLep_d0FilterFlagsEgamma.electronD0Cut
-topSequence.DiLep_egammad0Filter.electronPtCut=primRPVLLDESDM.DiLep_d0FilterFlagsEgamma.electronPtCut
-topSequence.DiLep_egammad0Filter.electronEtaCut=primRPVLLDESDM.DiLep_d0FilterFlagsEgamma.electronEtaCut
-filtersToBookkeep+=["DiLep_egammad0Filter"]
-
-########## get our own filter
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlg
-d0FilterName="DiLep_mud0Filter"
-d0Filter=DVFilterAlg(d0FilterName)
-topSequence+=d0Filter
-topSequence.DiLep_mud0Filter.MuonD0Cut=primRPVLLDESDM.DiLep_d0FilterFlagsMuon.muD0Cut
-topSequence.DiLep_mud0Filter.MuonPtCut=primRPVLLDESDM.DiLep_d0FilterFlagsMuon.muPtCut
-topSequence.DiLep_mud0Filter.MuonEtaCut=primRPVLLDESDM.DiLep_d0FilterFlagsMuon.muEtaCut
-filtersToBookkeep+=["DiLep_mud0Filter"]
-
-
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlgEgamma
-softd0FilterEgammaName="DiLep_softegammad0Filter"
-softd0FilterEgamma=DVFilterAlgEgamma(softd0FilterEgammaName)
-## offlineObjectFilterNames.append(  softd0FilterEgammaName )
-topSequence+=softd0FilterEgamma
-topSequence.DiLep_softegammad0Filter.electronD0Cut=primRPVLLDESDM.DiLep_softd0FilterFlagsEgamma.electronD0Cut
-topSequence.DiLep_softegammad0Filter.electronPtCut=primRPVLLDESDM.DiLep_softd0FilterFlagsEgamma.electronPtCut
-topSequence.DiLep_softegammad0Filter.electronEtaCut=primRPVLLDESDM.DiLep_softd0FilterFlagsEgamma.electronEtaCut
-filtersToBookkeep+=["DiLep_softegammad0Filter"]
-## 
-## Di-electron filter
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVFilterAlgDiElectron
-d0FilterDiElectronName="DiLep_diElectrond0Filter"
-d0FilterEgamma=DVFilterAlgDiElectron(d0FilterDiElectronName)
-offlineObjectFilterNames.append( d0FilterDiElectronName )
-topSequence+=d0FilterEgamma
-topSequence.DiLep_diElectrond0Filter.dielectronD0Cut=primRPVLLDESDM.DiLep_d0FilterFlagsDiElectron.dielectronD0Cut
-topSequence.DiLep_diElectrond0Filter.dielectronPtCut=primRPVLLDESDM.DiLep_d0FilterFlagsDiElectron.dielectronPtCut
-topSequence.DiLep_diElectrond0Filter.dielectronEtaCut=primRPVLLDESDM.DiLep_d0FilterFlagsDiElectron.dielectronEtaCut
-filtersToBookkeep+=["DiLep_diElectrond0Filter"]
-#
-
-MuonElectronFilterName = "DiLep_d0MuonElectronFilter"
-topSequence += LogicalFilterCombiner( MuonElectronFilterName)
-#topSequence.DiLep_softMuonElectronFilter.cmdstring = "DiLep_MuonFilter and DiLep_MediumElectronFilter"
-topSequence.DiLep_d0MuonElectronFilter.cmdstring = "DiLep_MuonFilter and DiLep_softegammad0Filter"
-offlineObjectFilterNames.append( "DiLep_d0MuonElectronFilter" )
-
-MuonElectronFilterName2 = "DiLep_Muond0ElectronFilter"
-topSequence += LogicalFilterCombiner( MuonElectronFilterName2)
-#topSequence.DiLep_softMuonElectronFilter.cmdstring = "DiLep_MuonFilter and DiLep_MediumElectronFilter"
-topSequence.DiLep_Muond0ElectronFilter.cmdstring = "DiLep_mud0Filter and DiLep_SoftElectronFilter"
-offlineObjectFilterNames.append( "DiLep_Muond0ElectronFilter" )
-
-PhotonElectronFilterName = "DiLep_softPhotonElectronFilter"
-topSequence += LogicalFilterCombiner( PhotonElectronFilterName)
-topSequence.DiLep_softPhotonElectronFilter.cmdstring = "DiLep_SoftPhotonFilter and DiLep_softegammad0Filter"
-offlineObjectFilterNames.append( "DiLep_softPhotonElectronFilter" )
-
-### configure a Jet filter
-#
-#from PrimaryDPDMaker.JetFilter import JetFilter
-#jetFilterName = 'DiLep_JetFilter'
-#topSequence += JetFilter(jetFilterName)
-#offlineObjectFilterNames.append( jetFilterName )
-#topSequence.DiLep_JetFilter.jetCollectionName = primRPVLLDESDM.DiLep_jetFilterFlags.jetCollectionName
-#topSequence.DiLep_JetFilter.cutEtMin = primRPVLLDESDM.DiLep_jetFilterFlags.cutEtMin
-#topSequence.DiLep_JetFilter.cutEtMax = primRPVLLDESDM.DiLep_jetFilterFlags.cutEtMax
-#topSequence.DiLep_JetFilter.cutEtaMax = primRPVLLDESDM.DiLep_jetFilterFlags.cutEtaMax
-#topSequence.DiLep_JetFilter.removeOverlap = primRPVLLDESDM.DiLep_jetFilterFlags.removeOverlap
-#topSequence.DiLep_JetFilter.deltaR = primRPVLLDESDM.DiLep_jetFilterFlags.deltaR
-#topSequence.DiLep_JetFilter.leptonContainerTypeList = primRPVLLDESDM.DiLep_jetFilterFlags.leptonContainerTypeList
-#topSequence.DiLep_JetFilter.leptonContainerNameList = primRPVLLDESDM.DiLep_jetFilterFlags.leptonContainerNameList
-#topSequence.DiLep_JetFilter.minNumberPassed = primRPVLLDESDM.DiLep_jetFilterFlags.minNumberPassed
-#
-############ combine the offline filters
-
-combinedOfflineFilterName = "DiLep_CombinedOfflineFilter"
-topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-
-offlineFilterCounter = 0
-cmdstring = ""
-for offlineFilterName in offlineObjectFilterNames :
-    if offlineFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += offlineFilterName
-    offlineFilterCounter += 1
-    pass
-topSequence.DiLep_CombinedOfflineFilter.cmdstring=cmdstring
-filtersToBookkeep+=["DiLep_CombinedOfflineFilter"]
-
-########### combine the trigger and offline filters
-
-DiLepCombinedFilter=LogicalFilterCombiner("DiLepCombinedFilter")
-topSequence+=DiLepCombinedFilter
-
-topSequence.DiLepCombinedFilter.cmdstring="DiLep_CombinedTriggerFilter and DiLep_CombinedOfflineFilter"
-
-########### add this to the global top filter
-
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="DiLepCombinedFilter"
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HNL.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HNL.py
new file mode 100644
index 0000000000000000000000000000000000000000..f554315ffe3ef15e30e04be95fa3615b06ec7768
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HNL.py
@@ -0,0 +1,19 @@
+import AthenaCommon.SystemOfUnits as Units
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__HnlSkimmingTool as skimtool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel
+
+HnlFilterTool = skimtool( name = "HnlFilterTool",
+                          Triggers  = [],
+                          Mu1PtMin  = 28*Units.GeV,
+                          Mu1Types  = [0],
+                          Mu1IsoCut = 0.05,
+                          Mu2PtMin  = 5*Units.GeV,
+                          Mu2IsoCut = 1,
+                          Mu2d0Min  = 1 )
+
+ToolSvc += HnlFilterTool
+topSequence += kernel( "RPVLL_HnlFilterKernel",
+                       SkimmingTools = [HnlFilterTool] )
+
+RPVLLfilterNames.extend(["RPVLL_HnlFilterKernel"])
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HV.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HV.py
index 8783e207ba5500f6d61d886028b1709c99f17814..86fcbb273d4c28187e71967267c99724c6e9fc9d 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HV.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_HV.py
@@ -1,89 +1,19 @@
-
-### configure trigger filters
-
-triggerFilterNames=[]
-
-if len(primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.HV_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.HV_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.HV_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = primRPVLLDESDM.HV_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames += primRPVLLDESDM.HV_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames += primRPVLLDESDM.HV_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames))
-
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "HV_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "HV_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.HV_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["HV_CombinedTriggerFilter"]
-
-offlineObjectFilterNames=[]
-
-## configure a muon filter
-
-#from PrimaryDPDMaker.MuonFilter import MuonFilter
-#muonFilterName = 'HV_MuonFilter'
-#topSequence += MuonFilter(muonFilterName)
-#offlineObjectFilterNames.append( muonFilterName )
-#topSequence.HV_MuonFilter.cutPtMinMu = primRPVLLDESDM.HV_muonFilterFlags.cutEtMin
-#topSequence.HV_MuonFilter.cutContainerMu=primRPVLLDESDM.HV_muonFilterFlags.cutContainerMu
-#topSequence.HV_MuonFilter.usingAOD=primRPVLLDESDM.HV_muonFilterFlags.usingAOD
-
-########### combine the offline filters
-
-#combinedOfflineFilterName = "HV_CombinedOfflineFilter"
-#topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-
-#offlineFilterCounter = 0
-#cmdstring = ""
-#for offlineFilterName in offlineObjectFilterNames :
-#    if offlineFilterCounter > 0 :
-#        cmdstring += " or "
-#        pass
-#    cmdstring += offlineFilterName
-#    offlineFilterCounter += 1
-#    pass
-#topSequence.HV_CombinedOfflineFilter.cmdstring=cmdstring
-#filtersToBookkeep+=["HV_CombinedOfflineFilter"]
-
-########### combine the trigger and offline filters
-
-HVCombinedFilter=LogicalFilterCombiner("HVCombinedFilter")
-topSequence+=HVCombinedFilter
-
-topSequence.HVCombinedFilter.cmdstring="HV_CombinedTriggerFilter" #and HV_CombinedOfflineFilter"
-
-########### add this to the global top filter
-
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="HVCombinedFilter"
-
-filtersToBookkeep+=["HVCombinedFilter"]
+# ##########################################################################################
+# Selection algorithms setup
+# ##########################################################################################
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool as skimtool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool
+
+
+###########################################################################################
+# HV Trigger Filter
+###########################################################################################
+
+HVSkimmingTool = DerivationFramework__TriggerSkimmingTool(   name                    = "HVSkimmingTool",
+                                                             TriggerListOR          = primRPVLLDESDM.HV_triggerFilterFlags.TriggerNames )
+ToolSvc += HVSkimmingTool
+topSequence += kernel( "RPVLL_HV_TriggerFilterKernel",
+                       SkimmingTools = [HVSkimmingTool],
+                       )
+RPVLLfilterNames.extend(["RPVLL_HV_TriggerFilterKernel"])
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Hips.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Hips.py
index 27d20808771b32e990bcb999a22e259fec6bfb60..dc6c39abcb4de956befddb847142af40d9118946 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Hips.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Hips.py
@@ -1,144 +1,15 @@
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool as skimtool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel
 
-### configure trigger filters
-if len(primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames += primRPVLLDESDM.Hips_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames += primRPVLLDESDM.Hips_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
+# ##########################################################################################
+# HIP trigger filter
+# ##########################################################################################
 
-### configure hiptrt trigger filter 
-if len(primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.EgammaTriggerNames
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames += primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.JetTauEtmissTriggerNames
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames += primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
+HipTriggerFilterTool = skimtool( name = "HipTriggerFilterTool",
+                                 expression = 'HLT_g0_hiptrt_L1EM18VH || HLT_g0_hiptrt_L1EM20VH || HLT_g0_hiptrt_L1EM20VHI || HLT_g0_hiptrt_L1EM22VHI' )
 
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames))
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR  ## hiptrt
-primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames = list(set(primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames))
-
-triggerFilterNames=[]
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.Hips_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "Hips_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-### hiptrt
-triggerFilterNames_hiptrt=[]
-for trigName_hiptrt in primRPVLLDESDM.Hips_triggerFilterFlags_hiptrt.TriggerNames:
-    TriggerFilterName_hiptrt = "Hips_TriggerFilter_"+trigName_hiptrt
-    topSequence += TriggerFilter( TriggerFilterName_hiptrt,
-                                  trigger = trigName_hiptrt )
-    triggerFilterNames_hiptrt.append( TriggerFilterName_hiptrt )
-    pass
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "Hips_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.Hips_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["Hips_CombinedTriggerFilter"]
-
-# Create a combined filter by ORing together all the trigger filters -- hiptrt
-combinedTriggerFilterName_hiptrt = "Hips_CombinedTriggerFilter_hiptrt"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName_hiptrt )
-triggerFilterCounter_hiptrt = 0
-cmdstring = ""
-for triggerFilterName_hiptrt in triggerFilterNames_hiptrt :
-    if triggerFilterCounter_hiptrt > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName_hiptrt
-    triggerFilterCounter_hiptrt += 1
-    pass
-topSequence.Hips_CombinedTriggerFilter_hiptrt.cmdstring = cmdstring    
-filtersToBookkeep+=["Hips_CombinedTriggerFilter_hiptrt"]
-
-
-offlineObjectFilterNames=[]
-
-## configure an electron filter
-
-## from PrimaryDPDMaker.ElectronFilter import ElectronFilter
-## electronFilterName = 'Hips_ElectronFilter'
-## topSequence += ElectronFilter(electronFilterName)
-## offlineObjectFilterNames.append( electronFilterName )
-## topSequence.Hips_ElectronFilter.cutPtMin = primRPVLLDESDM.Hips_electronFilterFlags.cutMinE
-## topSequence.Hips_ElectronFilter.cutEtaMax = primRPVLLDESDM.Hips_electronFilterFlags.cutEtaMax
-## topSequence.Hips_ElectronFilter.passAll = True
-
-## configure a HIPs filter
-
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import HIPsFilterAlg
-hipsFilterName = 'Hips_HIPsFilter'
-topSequence += HIPsFilterAlg(hipsFilterName)
-offlineObjectFilterNames.append( hipsFilterName )
-
-topSequence.Hips_HIPsFilter.cutMinE  = primRPVLLDESDM.Hips_hipsFilterFlags.cutMinE
-topSequence.Hips_HIPsFilter.cutEtaMax = primRPVLLDESDM.Hips_hipsFilterFlags.cutEtaMax
-topSequence.Hips_HIPsFilter.cutMaxDeltaPhi = primRPVLLDESDM.Hips_hipsFilterFlags.cutMaxDeltaPhi
-topSequence.Hips_HIPsFilter.cutMinTRTHTHits = primRPVLLDESDM.Hips_hipsFilterFlags.cutMinTRTHTHits
-topSequence.Hips_HIPsFilter.cutMinTRTHTFraction = primRPVLLDESDM.Hips_hipsFilterFlags.cutMinTRTHTFraction
-topSequence.Hips_HIPsFilter.caloCluster = primRPVLLDESDM.Hips_hipsFilterFlags.cutCaloCluster
-topSequence.Hips_HIPsFilter.passAll = False
-
-########### combine the offline filters
-
-combinedOfflineFilterName = "Hips_CombinedOfflineFilter"
-topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-
-offlineFilterCounter = 0
-cmdstring = ""
-for offlineFilterName in offlineObjectFilterNames :
-    if offlineFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += offlineFilterName
-    offlineFilterCounter += 1
-    pass
-topSequence.Hips_CombinedOfflineFilter.cmdstring=cmdstring
-filtersToBookkeep+=["Hips_CombinedOfflineFilter"]
-
-########### combine the trigger and offline filters
-
-HipsCombinedFilter=LogicalFilterCombiner("HipsCombinedFilter")
-topSequence+=HipsCombinedFilter
-
-topSequence.HipsCombinedFilter.cmdstring="(Hips_CombinedTriggerFilter and Hips_CombinedOfflineFilter) or Hips_CombinedTriggerFilter_hiptrt"
-
-########### add this to the global top filter
-
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="HipsCombinedFilter"
+ToolSvc += HipTriggerFilterTool
+topSequence += kernel( "RPVLL_HipTriggerFilterKernel",
+                       SkimmingTools = [HipTriggerFilterTool] )
 
+RPVLLfilterNames.extend(["RPVLL_HipTriggerFilterKernel"])
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_KinkedTrack.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_KinkedTrack.py
index a5a428ddddc773368bb32bfadf3e465766fa3613..2f8c4d97bd450bb25537a2db96d02c42f9da9d21 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_KinkedTrack.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_KinkedTrack.py
@@ -9,257 +9,202 @@
 ##
 ##-----------------------------------------------------------------------------
 
-if primRPVLLDESDM.KinkedTrack_do2010Skim() :
-    ###################################
-    ### configuration for 2010 data ###
-    ###################################
-
-    ### configure trigger filters
-    if len(primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames) == 0:
-        if rec.triggerStream() == "Egamma":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags.EgammaTriggerNames
-        elif rec.triggerStream() == "JetTauEtmiss":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags.JetTauEtmissTriggerNames
-        elif rec.triggerStream() == "Muons":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags.MuonsTriggerNames
-        elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.EgammaTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.JetTauEtmissTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.MuonsTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.EgammaTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.JetTauEtmissTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.MuonsTriggerNames
-        else:
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-    # get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-    primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = list(set(primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames))
-
-    triggerFilterNames=[]
-
-    from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-    for trigName in primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames:
-        TriggerFilterName = "KinkedTrack_TriggerFilter_"+trigName
-        topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-        triggerFilterNames.append( TriggerFilterName )
-        pass
-
-    # Create a combined filter by ORing together all the trigger filters
-    combinedTriggerFilterName = "KinkedTrack_CombinedTriggerFilter"
-    topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-    triggerFilterCounter = 0
-    cmdstring = ""
-    for triggerFilterName in triggerFilterNames :
-        if triggerFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += triggerFilterName
-        triggerFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedTriggerFilter.cmdstring = cmdstring    
-
-    offlineObjectFilterNames=[]
-
-    ## configure a singlejetmet filter
-    ## ( searching for chargino direct production associated with ISR jet )
-    if primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags() :
-        from LongLivedParticleDPDMaker.SingleJetMetFilter import SingleJetMetFilter
-        singleJetMetFilterName = 'KinkedTrack_SingleJetMetFilter'
-        topSequence += SingleJetMetFilter(singleJetMetFilterName)
-        offlineObjectFilterNames.append( singleJetMetFilterName )
-        topSequence.KinkedTrack_SingleJetMetFilter.jetCollectionName = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.jetCollectionName
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEt1Min = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEt1Min
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEta1Max = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEta1Max
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEt2Min = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEt2Min
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEta2Max = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEta2Max
-        topSequence.KinkedTrack_SingleJetMetFilter.doSecondJetVeto = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.doSecondJetVeto
-        topSequence.KinkedTrack_SingleJetMetFilter.requireMet = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.requireMet
-        topSequence.KinkedTrack_SingleJetMetFilter.metCollectionNames = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.metCollectionNames
-        topSequence.KinkedTrack_SingleJetMetFilter.cutMetMin = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutMetMin
-        pass
-
-    ## configure a multijetmet filter
-    ## ( searching for charginos via colored production )
-    #if primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags() :
-        #from LongLivedParticleDPDMaker.MultiJetMetFilter import MultiJetMetFilter
-        #multiJetMetFilterName = 'KinkedTrack_MultiJetMetFilter'
-        #topSequence += MultiJetMetFilter(multiJetMetFilterName)
-        #offlineObjectFilterNames.append( multiJetMetFilterName )
-        #topSequence.KinkedTrack_MultiJetMetFilter.jetCollectionName = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.jetCollectionName
-        #topSequence.KinkedTrack_MultiJetMetFilter.cutsEtMin = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutsEtMin
-        #topSequence.KinkedTrack_MultiJetMetFilter.cutEtaMax = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutEtaMax
-        #topSequence.KinkedTrack_MultiJetMetFilter.requireMet = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.requireMet
-        #topSequence.KinkedTrack_MultiJetMetFilter.metCollectionNames = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.metCollectionNames
-        #topSequence.KinkedTrack_MultiJetMetFilter.cutMetMin = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutMetMin
-        #pass
-    
-    ########### combine the offline filters
-    
-    combinedOfflineFilterName = "KinkedTrack_CombinedOfflineFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-    
-    offlineFilterCounter = 0
-    cmdstring = ""
-    for offlineFilterName in offlineObjectFilterNames :
-        if offlineFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += offlineFilterName
-        offlineFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedOfflineFilter.cmdstring=cmdstring
-    
-    ########### combine the trigger and offline filters
-    
-    KinkedTrackCombinedFilter=LogicalFilterCombiner("KinkedTrackCombinedFilter")
-    topSequence+=KinkedTrackCombinedFilter
-    
-    topSequence.KinkedTrackCombinedFilter.cmdstring="KinkedTrack_CombinedTriggerFilter and KinkedTrack_CombinedOfflineFilter"    
-
-elif primRPVLLDESDM.KinkedTrack_do2011Skim() :    
-    ###################################
-    ### configuration for 2011 data ###
-    ###################################
-
-    ### configure trigger filters
-    if len(primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames) == 0:
-        if rec.triggerStream() == "Egamma":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.EgammaTriggerNames
-        elif rec.triggerStream() == "JetTauEtmiss":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.JetTauEtmissTriggerNames
-        elif rec.triggerStream() == "Muons":
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.MuonsTriggerNames
-        elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.EgammaTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.JetTauEtmissTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2010.MuonsTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.EgammaTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.JetTauEtmissTriggerNames
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames += primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.MuonsTriggerNames
-        else:
-            primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-    # get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-    primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames = list(set(primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames))
-
-    triggerFilterNames=[]
-    triggerDPhiFilterNames=[]
-
-    from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-    for trigName in primRPVLLDESDM.KinkedTrack_triggerFilterFlags2011.TriggerNames:
-        TriggerFilterName = "KinkedTrack_TriggerFilter_"+trigName
-        topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-        if "dphi" in trigName:
-            triggerDPhiFilterNames.append( TriggerFilterName )
-        else:
-            triggerFilterNames.append( TriggerFilterName )
-        pass
-
-    # Create a combined filter by ORing together all the trigger filters
-    combinedTriggerFilterName = "KinkedTrack_CombinedTriggerFilter"
-    topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-    triggerFilterCounter = 0
-    cmdstring = ""
-    for triggerFilterName in triggerFilterNames :
-        if triggerFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += triggerFilterName
-        triggerFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedTriggerFilter.cmdstring = cmdstring    
-
-    combinedDPhiTriggerFilterName = "KinkedTrack_CombinedDPhiTriggerFilter"
-    topSequence += LogicalFilterCombiner( combinedDPhiTriggerFilterName )
-    triggerDPhiFilterCounter = 0
-    cmdstring = ""
-    for triggerFilterName in triggerDPhiFilterNames :
-        if triggerDPhiFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += triggerFilterName
-        triggerDPhiFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedDPhiTriggerFilter.cmdstring = cmdstring    
-
-    ## configure a multijetmet filter
-    ## ( searching for charginos via colored production )
-    offlineMultiJetMetFilterNames=[]
-
-    if primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags() :
-        from LongLivedParticleDPDMaker.MultiJetMetFilter import MultiJetMetFilter
-        multiJetMetFilterName = 'KinkedTrack_MultiJetMetFilter'
-        topSequence += MultiJetMetFilter( multiJetMetFilterName )
-        offlineMultiJetMetFilterNames.append( multiJetMetFilterName )
-        topSequence.KinkedTrack_MultiJetMetFilter.jetCollectionName = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.jetCollectionName
-        topSequence.KinkedTrack_MultiJetMetFilter.cutsEtMin = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutsEtMin
-        topSequence.KinkedTrack_MultiJetMetFilter.cutEtaMax = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutEtaMax
-        topSequence.KinkedTrack_MultiJetMetFilter.requireMet = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.requireMet
-        topSequence.KinkedTrack_MultiJetMetFilter.metCollectionNames = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.metCollectionNames
-        topSequence.KinkedTrack_MultiJetMetFilter.cutMetMin = primRPVLLDESDM.KinkedTrack_multiJetMetFilterFlags.cutMetMin
-        pass
-    
-    ## configure a singlejetmet filter
-    ## ( searching for chargino direct production associated with ISR jet )
-    offlineSingleJetMetFilterNames=[]
-
-    if primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags() :
-        from LongLivedParticleDPDMaker.SingleJetMetFilter import SingleJetMetFilter
-        singleJetMetFilterName = 'KinkedTrack_SingleJetMetFilter'
-        topSequence += SingleJetMetFilter(singleJetMetFilterName)
-        offlineSingleJetMetFilterNames.append( singleJetMetFilterName )
-        topSequence.KinkedTrack_SingleJetMetFilter.jetCollectionName = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.jetCollectionName
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEt1Min = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEt1Min
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEta1Max = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEta1Max
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEt2Min = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEt2Min
-        topSequence.KinkedTrack_SingleJetMetFilter.cutEta2Max = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEta2Max
-        topSequence.KinkedTrack_SingleJetMetFilter.doSecondJetVeto = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.doSecondJetVeto
-        topSequence.KinkedTrack_SingleJetMetFilter.requireMet = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.requireMet
-        topSequence.KinkedTrack_SingleJetMetFilter.metCollectionNames = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.metCollectionNames
-        topSequence.KinkedTrack_SingleJetMetFilter.cutMetMin = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutMetMin
-        pass
-
-    ########### combine the offline filters
-    
-    combinedOfflineMultiJetMetFilterName = "KinkedTrack_CombinedOfflineMultiJetMetFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineMultiJetMetFilterName )
-    offlineMultiJetMetFilterCounter = 0
-    cmdstring = ""
-    for offlineFilterName in offlineMultiJetMetFilterNames :
-        if offlineMultiJetMetFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += offlineFilterName
-        offlineMultiJetMetFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedOfflineMultiJetMetFilter.cmdstring=cmdstring
-
-    combinedOfflineSingleJetMetFilterName = "KinkedTrack_CombinedOfflineSingleJetMetFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineSingleJetMetFilterName )
-    offlineSingleJetMetFilterCounter = 0
-    cmdstring = ""
-    for offlineFilterName in offlineSingleJetMetFilterNames :
-        if offlineSingleJetMetFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += offlineFilterName
-        offlineSingleJetMetFilterCounter += 1
-        pass
-    topSequence.KinkedTrack_CombinedOfflineSingleJetMetFilter.cmdstring=cmdstring
-    
-    ########### combine the trigger and offline filters
-    
-    KinkedTrackCombinedFilter=LogicalFilterCombiner("KinkedTrackCombinedFilter")
-    topSequence+=KinkedTrackCombinedFilter
-    
-    topSequence.KinkedTrackCombinedFilter.cmdstring="( KinkedTrack_CombinedTriggerFilter and KinkedTrack_CombinedOfflineMultiJetMetFilter ) or ( KinkedTrack_CombinedDPhiTriggerFilter and KinkedTrack_CombinedOfflineSingleJetMetFilter)"
-    
-########### add this to the global top filter
-    
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="KinkedTrackCombinedFilter"
- 
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool
+from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__FilterCombinationAND
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__FilterCombinationOR
+from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__PrescaleTool
+
+#import AthenaCommon.SystemOfUnits as Units
+jetContainer = primRPVLLDESDM.KinkedTrack_containerFlags.jetCollectionName
+electronContainer = primRPVLLDESDM.KinkedTrack_containerFlags.electronCollectionName
+muonContainer = primRPVLLDESDM.KinkedTrack_containerFlags.muonCollectionName
+METContainer = primRPVLLDESDM.KinkedTrack_containerFlags.METCollectionName
+METTerm = primRPVLLDESDM.KinkedTrack_containerFlags.METTermName
+egClusterContainer = primRPVLLDESDM.KinkedTrack_containerFlags.egClusterCollectionName
+msTrackContainer = primRPVLLDESDM.KinkedTrack_containerFlags.msTrackCollectionName
+
+def KinkTrkTriggerFilterString(flags):
+    selectionString = ''
+    if flags.triggerNames:
+        triggers = list(set(flags.triggerNames))
+        selectionString += '(' + ' || '.join(triggers) + ')'
+
+    return selectionString
+
+
+
+
+#====================================================================
+# JetMetFilter
+#====================================================================
+#KinkTrkJetTriggerFilterTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkJetTriggerFilterTool",
+#                                                                          expression = KinkTrkTriggerFilterString(primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags))
+KinkTrkJetTriggerFilterTool = DerivationFramework__TriggerSkimmingTool(name = "KinkTrkJetTriggerFilterTool",
+                                                                       TriggerListOR = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.triggerNames)
+#print KinkTrkJetTriggerFilter
+ToolSvc += KinkTrkJetTriggerFilterTool
+
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__KinkTrkSingleJetMetFilterTool
+KinkTrkSingleJetMetFilterTool = DerivationFramework__KinkTrkSingleJetMetFilterTool(name                 = "KinkTrkSingleJetMetFilterTool",
+                                                                                   LeptonVeto           = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.doLeptonVeto,
+                                                                                   JetContainerKey      = jetContainer,
+                                                                                   ElectronContainerKey = electronContainer,
+                                                                                   ElectronIDKey        = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.electronIDKey,
+                                                                                   MuonContainerKey     = muonContainer,
+                                                                                   MuonIDKey            = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.muonIDKey,
+                                                                                   MetContainerKey      = METContainer,
+                                                                                   MetTerm              = METTerm,
+                                                                                   MetCut               = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutMetMin,
+                                                                                   JetPtCuts            = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutsEtMin,
+                                                                                   JetEtaMax            = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.cutEtaMax,
+                                                                                   JetMetDphiMin        = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.jetMetDphiMin,
+                                                                                   LeptonPtCut          = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.leptonPtMax,
+                                                                                   LeptonEtaMax         = primRPVLLDESDM.KinkedTrack_singleJetMetFilterFlags.leptonEtaMax)
+
+print KinkTrkSingleJetMetFilterTool
+ToolSvc += KinkTrkSingleJetMetFilterTool
+
+
+KinkTrkJetFilterTool = DerivationFramework__FilterCombinationAND(name = "KinkTrkJetFilterTool",
+                                                                 FilterList=[KinkTrkJetTriggerFilterTool, KinkTrkSingleJetMetFilterTool],
+                                                                 OutputLevel=INFO)
+ToolSvc+= KinkTrkJetFilterTool
+
+topSequence += DerivationFramework__DerivationKernel("RPVLL_KinkedTrackJetFilterKernel",
+                                                     SkimmingTools = [KinkTrkJetFilterTool])
+RPVLLfilterNames.extend(["RPVLL_KinkedTrackJetFilterKernel"])
+
+
+
+#====================================================================
+# Zee/Zmumu filter
+#====================================================================
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__KinkTrkZeeTagTool
+KinkTrkZeeTagTool = DerivationFramework__KinkTrkZeeTagTool(name                 = "KinkTrkZeeTagTool",
+                                                           Triggers             = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.triggerNames,
+                                                           TriggerMatchDeltaR   = 0.1,
+                                                           RequireTriggerMatch  = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.doTriggerMatch,
+                                                           ElectronContainerKey = electronContainer,
+                                                           ElectronIDKeys       = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.electronIDKeys,
+                                                           ElectronPtMin        = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.electronPtMin,
+                                                           ElectronEtaMax       = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.electronEtaMax,
+                                                           ClusterContainerKey  = egClusterContainer,
+                                                           ClusterEtMin         = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.clusterEtMin,
+                                                           ClusterEtaMax        = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.clusterEtaMax,
+                                                           DiEleMassLow         = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.diElectronMassLow,
+                                                           DiEleMassHigh        = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.diElectronMassHigh,
+                                                           DeltaPhiMax          = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.deltaPhiMax,
+                                                           StoreGateKeyPrefix   = "KinkTrk")
+
+print KinkTrkZeeTagTool
+ToolSvc += KinkTrkZeeTagTool
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DerivationFramework__KinkTrkZmumuTagTool
+KinkTrkZmumuTagTool = DerivationFramework__KinkTrkZmumuTagTool(name            = "KinkTrkZmumuTagTool",
+                                                           Triggers            = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.triggerNames,
+                                                           TriggerMatchDeltaR  = 0.1,
+                                                           RequireTriggerMatch = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.doTriggerMatch,
+                                                           MuonContainerKey    = muonContainer,
+                                                           MuonIDKeys          = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.muonIDKeys,
+                                                           MuonPtMin           = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.muonPtMin,
+                                                           MuonEtaMax          = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.muonEtaMax,
+                                                           TrackContainerKey   = msTrackContainer,
+                                                           TrackPtMin          = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.trackPtMin,
+                                                           TrackEtaMax         = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.trackEtaMax,
+                                                           DiMuonMassLow       = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.diMuonMassLow,
+                                                           DiMuonMassHigh      = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.diMuonMassHigh,
+                                                           DeltaPhiMax         = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.deltaPhiMax,
+                                                           StoreGateKeyPrefix  = "KinkTrk")
+
+print KinkTrkZmumuTagTool
+ToolSvc += KinkTrkZmumuTagTool
+
+## Kernel for the augmentation tools
+topSequence += DerivationFramework__DerivationKernel( "KinkTrkAugmentationKernel",
+                                                      AugmentationTools = [KinkTrkZeeTagTool, KinkTrkZmumuTagTool])
+
+## Trigger filters
+KinkTrkZeeTriggerFilterTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZeeTriggerFilterTool",
+                                                                          expression = KinkTrkTriggerFilterString(primRPVLLDESDM.KinkedTrack_ZeeFilterFlags))
+#KinkTrkZeeTriggerFilterTool = DerivationFramework__TriggerSkimmingTool(name = "KinkTrkZeeTriggerFilterTool",
+#                                                                       TriggerListOR = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.triggerNames)
+ToolSvc += KinkTrkZeeTriggerFilterTool
+
+KinkTrkZmumuTriggerFilterTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZmumuTriggerFilterTool",
+                                                                            expression = KinkTrkTriggerFilterString(primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags))
+#KinkTrkZmumuTriggerFilterTool = DerivationFramework__TriggerSkimmingTool(name = "KinkTrkZmumuTriggerFilterTool",
+#                                                                       TriggerListOR = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.triggerNames)
+ToolSvc += KinkTrkZmumuTriggerFilterTool
+
+
+## Selecting low-pT probe electrons
+KinkTrkZeeLowPtSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZeeLowPtSkimmingTool",
+                                                                          expression = 'count(abs(KinkTrkDiEleMass)>0)>=1 && count(KinkTrkProbeEleEt>=%f)==0' % primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.preScaleClusterEtMax)
+ToolSvc += KinkTrkZeeLowPtSkimmingTool
+
+## Selecting high-pT probe electrons
+KinkTrkZeeHighPtSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZeeHighPtSkimmingTool",
+                                                                           expression = 'count(abs(KinkTrkDiEleMass)>0)>=1 && count(KinkTrkProbeEleEt>=%f)>=1' % primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.preScaleClusterEtMax)
+ToolSvc += KinkTrkZeeHighPtSkimmingTool
+
+## Prescale for low-pT probes
+KinkTrkZeePrescaleTool = DerivationFramework__PrescaleTool(name = "KinkTrkZeePrescaleTool",
+                                                           Prescale = primRPVLLDESDM.KinkedTrack_ZeeFilterFlags.preScale)
+ToolSvc += KinkTrkZeePrescaleTool
+
+KinkTrkZeeLowPtFilterTool = DerivationFramework__FilterCombinationAND(name = "KinkTrkZeeLowPtFilterTool",
+                                                                      FilterList = [KinkTrkZeeLowPtSkimmingTool, KinkTrkZeePrescaleTool])
+ToolSvc += KinkTrkZeeLowPtFilterTool
+
+KinkTrkZeeFilterTool = DerivationFramework__FilterCombinationOR(name = "KinkTrkZeeFilterTool",
+                                                                FilterList = [KinkTrkZeeLowPtFilterTool, KinkTrkZeeHighPtSkimmingTool])
+ToolSvc += KinkTrkZeeFilterTool
+
+KinkTrkZeeFinalFilterTool = DerivationFramework__FilterCombinationAND(name = "KinkTrkZeeFinalFilterTool",
+                                                                      FilterList=[KinkTrkZeeTriggerFilterTool, KinkTrkZeeFilterTool],
+                                                                      OutputLevel=INFO)
+ToolSvc+= KinkTrkZeeFinalFilterTool
+
+topSequence += DerivationFramework__DerivationKernel("RPVLL_KinkedTrackZeeFilterKernel",
+                                                     SkimmingTools = [KinkTrkZeeFinalFilterTool])
+RPVLLfilterNames.extend(["RPVLL_KinkedTrackZeeFilterKernel"])
+
+
+##
+## Selecting low-pT probe muons
+KinkTrkZmumuLowPtSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZmumuLowPtSkimmingTool",
+                                                                            expression = 'count(abs(KinkTrkDiMuMass)>0)>=1 && count(KinkTrkProbeMuPt>=%f)==0' % primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.preScaleTrackPtMax)
+ToolSvc += KinkTrkZmumuLowPtSkimmingTool
+
+## Selecting high-pT probe muons
+KinkTrkZmumuHighPtSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "KinkTrkZmumuHighPtSkimmingTool",
+                                                                             expression = 'count(abs(KinkTrkDiMuMass)>0)>=1 && count(KinkTrkProbeMuPt>=%f)>=1'% primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.preScaleTrackPtMax)
+ToolSvc += KinkTrkZmumuHighPtSkimmingTool
+
+## Prescale for low-pT probes
+KinkTrkZmumuPrescaleTool = DerivationFramework__PrescaleTool(name = "KinkTrkZmumuPrescaleTool",
+                                                             Prescale = primRPVLLDESDM.KinkedTrack_ZmumuFilterFlags.preScale)
+ToolSvc += KinkTrkZmumuPrescaleTool
+
+KinkTrkZmumuLowPtFilterTool = DerivationFramework__FilterCombinationAND(name = "KinkTrkZmumuLowPtFilterTool",
+                                                                        FilterList = [KinkTrkZmumuLowPtSkimmingTool, KinkTrkZmumuPrescaleTool])
+ToolSvc += KinkTrkZmumuLowPtFilterTool
+
+KinkTrkZmumuFilterTool = DerivationFramework__FilterCombinationOR(name = "KinkTrkZmumuFilterTool",
+                                                                  FilterList = [KinkTrkZmumuLowPtFilterTool, KinkTrkZmumuHighPtSkimmingTool])
+ToolSvc += KinkTrkZmumuFilterTool
+
+
+KinkTrkZmumuFinalFilterTool = DerivationFramework__FilterCombinationAND(name = "KinkTrkZmumuFinalFilterTool",
+                                                                        FilterList=[KinkTrkZmumuTriggerFilterTool, KinkTrkZmumuFilterTool],
+                                                                        OutputLevel=INFO)
+ToolSvc+= KinkTrkZmumuFinalFilterTool
+
+## Prescale for low-pT electron probes
+topSequence += DerivationFramework__DerivationKernel("RPVLL_KinkedTrackZmumuFilterKernel",
+                                                     SkimmingTools = [KinkTrkZmumuFinalFilterTool])
+RPVLLfilterNames.extend(["RPVLL_KinkedTrackZmumuFilterKernel"])
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_NonPointing.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_NonPointing.py
deleted file mode 100644
index 302cd44ba72396b1df1576fb2a9eac5f4969b741..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_NonPointing.py
+++ /dev/null
@@ -1,143 +0,0 @@
-
-### configure trigger filters
-if len(primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = primRPVLLDESDM.NonPointing_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = primRPVLLDESDM.NonPointing_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = primRPVLLDESDM.NonPointing_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = primRPVLLDESDM.NonPointing_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames += primRPVLLDESDM.NonPointing_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames += primRPVLLDESDM.NonPointing_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames))
-
-triggerFilterNames=[]
-
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.NonPointing_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "NonPointing_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "NonPointing_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.NonPointing_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["NonPointing_CombinedTriggerFilter"]
-
-offlineObjectFilterNames=[]
-
-## configure a photon filter
-
-from PrimaryDPDMaker.PhotonFilter import PhotonFilter
-photonFilterName = 'NonPointing_PhotonFilter'
-topSequence += PhotonFilter(photonFilterName)
-offlineObjectFilterNames.append( photonFilterName )
-topSequence.NonPointing_PhotonFilter.cutEtMin = primRPVLLDESDM.NonPointing_photonFilterFlags.cutEtMin
-topSequence.NonPointing_PhotonFilter.cutEtaMax = primRPVLLDESDM.NonPointing_photonFilterFlags.cutEtaMax
-topSequence.NonPointing_PhotonFilter.cutIsEM=primRPVLLDESDM.NonPointing_photonFilterFlags.cutIsEM
-topSequence.NonPointing_PhotonFilter.photonCollectionName=primRPVLLDESDM.NonPointing_photonFilterFlags.photonCollectionName
-
-## configure a diphoton filter
-from PrimaryDPDMaker.DiPhotonFilter import DiPhotonFilter
-diphotonFilterName = 'NonPointing_DiPhotonFilter'
-topSequence += DiPhotonFilter(diphotonFilterName)
-offlineObjectFilterNames.append( diphotonFilterName )
-topSequence.NonPointing_DiPhotonFilter.cutEtMin1 = primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutEtMin1
-topSequence.NonPointing_DiPhotonFilter.cutEtMin2 = primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutEtMin2
-topSequence.NonPointing_DiPhotonFilter.cutIsEM1=primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutIsEM1
-topSequence.NonPointing_DiPhotonFilter.cutIsEM2=primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutIsEM2
-topSequence.NonPointing_DiPhotonFilter.cutAuthor1=primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutAuthor1
-topSequence.NonPointing_DiPhotonFilter.cutAuthor2=primRPVLLDESDM.NonPointing_diphotonFilterFlags.cutAuthor2
-
-## configure a EMCluster filter
-
-from PrimaryDPDMaker.DiEMClusterFilter import DiEMClusterFilter
-diemclusterFilterName = 'NonPointing_DiEMClusterFilter'
-topSequence += DiEMClusterFilter(diemclusterFilterName)
-offlineObjectFilterNames.append( diemclusterFilterName )
-
-topSequence.NonPointing_DiEMClusterFilter.cutEtMinEMCl1 = primRPVLLDESDM.NonPointing_diemclusterFilterFlags.cutEtMinEMCl1
-topSequence.NonPointing_DiEMClusterFilter.cutEtMinEMCl2 = primRPVLLDESDM.NonPointing_diemclusterFilterFlags.cutEtMinEMCl2 
-topSequence.NonPointing_DiEMClusterFilter.cutEtaMax   = primRPVLLDESDM.NonPointing_diemclusterFilterFlags.cutEtaMax
-topSequence.NonPointing_DiEMClusterFilter.removeEtaCrack= primRPVLLDESDM.NonPointing_diemclusterFilterFlags.removeEtaCrack
-topSequence.NonPointing_DiEMClusterFilter.crackEtaMin = primRPVLLDESDM.NonPointing_diemclusterFilterFlags.crackEtaMin
-topSequence.NonPointing_DiEMClusterFilter.crackEtaMax = primRPVLLDESDM.NonPointing_diemclusterFilterFlags.crackEtaMax
-## configure a MissingEt filter
-
-from PrimaryDPDMaker.MissingEtFilter import MissingEtFilter
-missingetFilterName = 'NonPointing_MissingEtFilter'
-topSequence += MissingEtFilter(missingetFilterName)
-offlineObjectFilterNames.append( missingetFilterName )
-
-topSequence.NonPointing_MissingEtFilter.cutMetMin = primRPVLLDESDM.NonPointing_missingetFilterFlags.cutMetMin
-topSequence.NonPointing_MissingEtFilter.jetContainerTypeList = primRPVLLDESDM.NonPointing_missingetFilterFlags.jetContainerTypeList
-topSequence.NonPointing_MissingEtFilter.jetContainerNameList = primRPVLLDESDM.NonPointing_missingetFilterFlags.jetContainerNameList
-topSequence.NonPointing_MissingEtFilter.useUncalibratedJets = primRPVLLDESDM.NonPointing_missingetFilterFlags.useUncalibratedJets
-topSequence.NonPointing_MissingEtFilter.useLeadingJet = primRPVLLDESDM.NonPointing_missingetFilterFlags.useLeadingJet
-topSequence.NonPointing_MissingEtFilter.minDeltaPhi = primRPVLLDESDM.NonPointing_missingetFilterFlags.minDeltaPhi
-topSequence.NonPointing_MissingEtFilter.requireMet = primRPVLLDESDM.NonPointing_missingetFilterFlags.requireMet
-
-## configure a Jet filter
-
-from PrimaryDPDMaker.JetFilter import JetFilter
-jetFilterName = 'NonPointing_JetFilter'
-topSequence += JetFilter(jetFilterName)
-offlineObjectFilterNames.append( jetFilterName )
-topSequence.NonPointing_JetFilter.jetCollectionName = primRPVLLDESDM.NonPointing_jetFilterFlags.jetCollectionName
-topSequence.NonPointing_JetFilter.cutEtMin = primRPVLLDESDM.NonPointing_jetFilterFlags.cutEtMin
-topSequence.NonPointing_JetFilter.cutEtMax = primRPVLLDESDM.NonPointing_jetFilterFlags.cutEtMax
-topSequence.NonPointing_JetFilter.cutEtaMax = primRPVLLDESDM.NonPointing_jetFilterFlags.cutEtaMax
-topSequence.NonPointing_JetFilter.removeOverlap = primRPVLLDESDM.NonPointing_jetFilterFlags.removeOverlap
-topSequence.NonPointing_JetFilter.deltaR = primRPVLLDESDM.NonPointing_jetFilterFlags.deltaR
-topSequence.NonPointing_JetFilter.leptonContainerTypeList = primRPVLLDESDM.NonPointing_jetFilterFlags.leptonContainerTypeList
-topSequence.NonPointing_JetFilter.leptonContainerNameList = primRPVLLDESDM.NonPointing_jetFilterFlags.leptonContainerNameList
-topSequence.NonPointing_JetFilter.minNumberPassed = primRPVLLDESDM.NonPointing_jetFilterFlags.minNumberPassed
-
-########### combine the offline filters
-
-combinedOfflineFilterName = "NonPointing_CombinedOfflineFilter"
-topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-
-offlineFilterCounter = 0
-cmdstring = ""
-for offlineFilterName in offlineObjectFilterNames :
-    if offlineFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += offlineFilterName
-    offlineFilterCounter += 1
-    pass
-topSequence.NonPointing_CombinedOfflineFilter.cmdstring=cmdstring
-filtersToBookkeep+=["NonPointing_CombinedOfflineFilter"]
-
-########### combine the trigger and offline filters
-
-NonPointingCombinedFilter=LogicalFilterCombiner("NonPointingCombinedFilter")
-topSequence+=NonPointingCombinedFilter
-
-topSequence.NonPointingCombinedFilter.cmdstring="NonPointing_CombinedTriggerFilter and NonPointing_CombinedOfflineFilter"
-
-########### add this to the global top filter
-
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="NonPointingCombinedFilter"
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL.py
index fdf1318094fabf53a15c88bf27223dc6f3b2cbe5..77878b39d85241ab3161bbd3fe43d5f8fee34ce9 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL.py
@@ -5,111 +5,102 @@
 ## Email:  Nicholas.Robert.Barlow@cern.ch
 ## Author: Christian Ohm (Stockholm)
 ## Email:  Christian.Ohm@cern.ch
+## Author: Mike Flowerdew (Munich MPI)
+## Email:  Michael.Flowerdew@cern.ch
 ##
 ## Description: This defines the content of the DESDM_RPVLL output stream.
 ##
 ##-----------------------------------------------------------------------------
 
-import AthenaCommon.SystemOfUnits as Units
+# ##########################################################################################
+# Imports and initial setup
+# ##########################################################################################
+
+# MJF: Needs attention and cleaning up - lots of PrimaryDPDMaker dependencies!
 
 from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
-from LongLivedParticleDPDMaker.LongLivedDPDFlags import *
-from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName
+
+from LongLivedParticleDPDMaker.LongLivedDPDFlags import WriteRPVLLStream
 from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLLStream import primRPVLLDESDM
-from PrimaryDPDMaker.LogicalFilterCombiner import LogicalFilterCombiner
 
-streamName = primDPD.WriteRPVLLStream.StreamName
+from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName
+from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
 
+streamName = primDPD.WriteRPVLLStream.StreamName
 fileName   = buildFileName( primDPD.WriteRPVLLStream )
-RPVLL=MSMgr.NewPoolStream( streamName,fileName )
+RPVLL      = MSMgr.NewPoolStream( streamName,fileName )
 
+# MJF: Possibly remove if not useful?
 if primRPVLLDESDM.prescaleFlags.applyPrescale:
     RPVLL.SetPrescale(primRPVLLDESDM.prescaleFlags.prescaleFactor)
 
-topCmdString=""
-filtersToBookkeep = []
-################# start adding filters #################
+RPVLLfilterNames = [] # Filters should append their final selection algo names to this list
+filtersToBookkeep = [] # Not sure what this does?
 
+# ##########################################################################################
+# Filter configuration
+# ##########################################################################################
 
 ## For each analysis, include a job options file that defines the filter 
 ## for that analysis and adds it to the top filter
 
-## Logics of how selections are activated
-#  - for MC, rec.TriggerStream() will "" => use doXyz flags (all True by default)
-#  - for data which has trigger stream metadata, activate a selection if the currently processed
-#    trigger stream is in the doXyz.TriggerStreams list, OR, if doXyz.ForceToRun is set to True
-#    (False by default, can be overridden with preExec)
+# ##########################################################################################
+# First, the filters which are *definitely* planned for Run 2
 
-## MS-agnostic SMP search (contact: Sascha Mehlhase)
-if (primRPVLLDESDM.doSmpCaloId() and (rec.triggerStream() == ""  or rec.triggerStream() in primRPVLLDESDM.doSmpCaloId.TriggerStreams)) or primRPVLLDESDM.doSmpCaloId.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_SmpCaloId.py")
+## Dilepton search (contact Mike Flowerdew)
+if primRPVLLDESDM.doDiLep():
+    include("LongLivedParticleDPDMaker/PhysDESDM_DiLep.py")
     pass
 
 ## RPV search based on displaced vertex finding in the ID (contact: Nick Barlow)
-if (primRPVLLDESDM.doDV() and rec.triggerStream() in primRPVLLDESDM.doDV.TriggerStreams) or primRPVLLDESDM.doDV.ForceToRunMuonsSel or primRPVLLDESDM.doDV.ForceToRunEgammaSel or primRPVLLDESDM.doDV.ForceToRunJetTauEtmissSel :
+if primRPVLLDESDM.doDV():
     include("LongLivedParticleDPDMaker/PhysDESDM_DV.py")
     pass
 
-## VH DV search based on displaced vertex finding in the ID along with a W or Z leptonic decay (contact: Andy Haas)
-if (primRPVLLDESDM.doVH_DV() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doVH_DV.TriggerStreams)) or primRPVLLDESDM.doVH_DV.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_VH_DV.py")
-    pass
-
-## Quirks search (contact: Jim Black)
-if (primRPVLLDESDM.doQuirks() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doQuirks.TriggerStreams)) or primRPVLLDESDM.doQuirks.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_Quirks.py")
+# Kink-based chargino search (contact: Shimpei Yamamoto)
+if primRPVLLDESDM.doKinkedTrack():
+    include("LongLivedParticleDPDMaker/PhysDESDM_KinkedTrack.py")
     pass
 
-## Dilepton search (contact Helen Hayward)
-if (primRPVLLDESDM.doDiLep() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doDiLep.TriggerStreams)) or primRPVLLDESDM.doDiLep.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_DiLep.py")
+## Stopped R-hadron search (contact: Andy Haas)
+if primRPVLLDESDM.doStopped():
+    include("LongLivedParticleDPDMaker/PhysDESDM_Stopped.py")
     pass
 
-## MS-based SMP search (contact: Sofia Vallecorsa)
-if (primRPVLLDESDM.doSmpMs() and (rec.triggerStream() == ""  or rec.triggerStream() in primRPVLLDESDM.doSmpMs.TriggerStreams)) or primRPVLLDESDM.doSmpMs.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_SmpMs.py")
+## Highly ionizing particles search (contact: Avishek Chatterjee)
+if primRPVLLDESDM.doHips():
+    include("LongLivedParticleDPDMaker/PhysDESDM_Hips.py")
     pass
 
-## Kink-based chargino search (contact: Shimpei Yamamote, Yuya Azuma)
-if (primRPVLLDESDM.doKinkedTrack() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doKinkedTrack.TriggerStreams)) or primRPVLLDESDM.doKinkedTrack.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_KinkedTrack.py")
+## Heavy neutral lepton search (contact: Avishek Chatterjee)
+if primRPVLLDESDM.doHnl():
+    include("LongLivedParticleDPDMaker/PhysDESDM_HNL.py")
     pass
 
-## Non-pointing photon search (contact: Helen Hayward)
-if (primRPVLLDESDM.doNonPointing() and (rec.triggerStream() == ""  or rec.triggerStream() in primRPVLLDESDM.doNonPointing.TriggerStreams)) or primRPVLLDESDM.doNonPointing.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_NonPointing.py")
+# Exotics displaced hadronic jets =search (contact: Heather Russell)
+if primRPVLLDESDM.doHV():
+    include("LongLivedParticleDPDMaker/PhysDESDM_HV.py")
     pass
 
-## Highly ionizing particles search (contact: Sergey Burdin)
-if (primRPVLLDESDM.doHips() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doHips.TriggerStreams)) or primRPVLLDESDM.doHips.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_Hips.py")
-    pass
+# ##########################################################################################
+# Second, filters I'm not sure of (move above this line if definitely needed)
 
-## Stopped gluino search (contact: Andy Haas)
-if (primRPVLLDESDM.doStopped() and (rec.triggerStream() == "" or rec.triggerStream() in primRPVLLDESDM.doStopped.TriggerStreams)) or primRPVLLDESDM.doStopped.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_Stopped.py")
+## VH DV search based on displaced vertex finding in the ID along with a W or Z leptonic decay (contact: Andy Haas)
+if primRPVLLDESDM.doVH_DV():
+    include("LongLivedParticleDPDMaker/PhysDESDM_VH_DV.py")
     pass
 
-## Hidden Valley search (contact: Orin Harris, Gordon Watts)
-if (primRPVLLDESDM.doHV() and (rec.triggerStream() == ""  or rec.triggerStream() in primRPVLLDESDM.doHV.TriggerStreams)) or primRPVLLDESDM.doHV.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_HV.py")
+## Quirks search (contact: Jim Black)
+if primRPVLLDESDM.doQuirks():
+    include("LongLivedParticleDPDMaker/PhysDESDM_Quirks.py")
     pass
 
-## Stealth Supersymmetry search (contact: Heather Russell, Henry Lubatti)
-if (primRPVLLDESDM.doStealth() and (rec.triggerStream() == ""  or rec.triggerStream() in primRPVLLDESDM.doStealth.TriggerStreams)) or primRPVLLDESDM.doStealth.ForceToRun:
-    include("LongLivedParticleDPDMaker/PhysDESDM_Stealth.py")
-    pass
 
 
 ################# OR together all the filters into one, if at least one analysis selection is active
 
-if topCmdString != "":
-    topFilterName = "RPVLL_DESDMStream_TopFilter"
-    topSequence += LogicalFilterCombiner( topFilterName )
-    topSequence.RPVLL_DESDMStream_TopFilter.cmdstring=topCmdString
-    acceptAlgsNames=[]
-    acceptAlgsNames.append( topFilterName )
-    RPVLL.AcceptAlgs(acceptAlgsNames)
+if RPVLLfilterNames:
+    RPVLL.AcceptAlgs(RPVLLfilterNames)
 
 # if the automatic trigger stream logics or command-line overrides did not activate a single selection,
 # choose to not write out any events to the output file (can happen e.g. in Reco_trf.py test jobs)
@@ -122,53 +113,23 @@ else:
     vetoAlgsNames.append( dummyFilterName )
     RPVLL.VetoAlgs(vetoAlgsNames)
 
-################# thinnning and event content #################
-
-# thinning of CaloCells
-if primRPVLLDESDM.doCaloCellThinning():
-    from PrimaryDPDMaker.PrimaryDPDMakerConf import ThinContainers
-    topSequence += ThinContainers("ThinContainersInRPVLLStream")
-    topSequence.ThinContainersInRPVLLStream.thinSvc  = 'ThinningSvc/RPVLLStreamThinning'
-    topSequence.ThinContainersInRPVLLStream.thinCaloCells               = True
-    topSequence.ThinContainersInRPVLLStream.caloCellCollectionName      = 'AllCalo'
-    topSequence.ThinContainersInRPVLLStream.keepCellsFromLinkContainers = True
-    try:
-        topSequence.ThinContainersInRPVLLStream.useCaloCellEnergyCut = True
-    except(AttributeError):
-        pass
-    topSequence.ThinContainersInRPVLLStream.cellLinkContainerNames = [ "LArClusterEMSofte_Link", \
-                                                                       "egClusterCollection_Link", \
-                                                                       "LArClusterEM_Link", \
-                                                                       "EMTopoCluster430_Link" ]
-    topSequence.ThinContainersInRPVLLStream.keepForwardElectronCells    = True
-    
-    from AthenaServices.Configurables import ThinningSvc, createThinningSvc
-    augStream=MSMgr.GetStream( streamName )
-    evtStream=augStream.GetEventStream()
-    svcMgr += createThinningSvc( svcName="RPVLLStreamThinning", outStreams=[evtStream] )
-    
-    pass
-
-from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput
+# ##########################################################################################
+# Output stream definition
+# ##########################################################################################
 
-excludeList=[]
-#    "Track#*",
-#    "InDet::Track#*",    
-#    "TrackCollection#*",    
-#    "Trk::TrackCollection#*",
-#    'CaloShowerContainer#*',
-#    ]
+# Add everything from the input file
+from AthenaCommon.KeyStore import CfgKeyStore,CfgItemList
+theCKS = CfgKeyStore('KeyStore')
+outList = CfgItemList( 'RPVLL' )
+outList += theCKS['inputFile']
 
-if primDPD.UseMCTruth() and primRPVLLDESDM.UseAODTruth():
-    excludeList+=["McEventCollection#TruthEvent"]
-dpdOutput.addAllItemsFromInputExceptExcludeList( streamName,excludeList )
+# Remove items here, as needed
+outList.removeAllItems( 'RpcPadContainer#RPCPAD' ) # Avoids crash in 20.1.0.2
 
-if primDPD.UseMCTruth() and primRPVLLDESDM.UseAODTruth():
-    if not "McAodBuilder" in dir(topSequence):
-        from McParticleAlgs.JobOptCfg import McAodBuilder
-        topSequence+=McAodBuilder()
-    RPVLL.AddItem( ['McEventCollection#GEN_AOD'] ) #AOD MC Truth
-    RPVLL.AddItem( ['TruthParticleContainer#SpclMC'] ) #AOD MC Truth
+# Configure the stream
+RPVLL.AddItem(outList())
 
 # make sure bookkeeping info is kept for additional filters
+# MJF: Does this do anything useful?
 RPVLL.AddOtherAlgsToBookkeep(filtersToBookkeep)
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL_CosmicCalo.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL_CosmicCalo.py
deleted file mode 100644
index c5d5c7b20c77291f45270d31700b7e7f6e3d0d2d..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_RPVLL_CosmicCalo.py
+++ /dev/null
@@ -1,151 +0,0 @@
-##-----------------------------------------------------------------------------
-## Name: PhysDPD_RPVLL_CosmicCalo.py
-##
-## Author: Paul Jackson (SLAC) 
-## Email:  Paul.Jackson@cern.ch
-## Author: Nick Barlow (Cambridge)
-## Email:  Nicholas.Robert.Barlow@cern.ch
-## Author: Christian Ohm (Stockholm)
-## Email:  Christian.Ohm@cern.ch
-##
-## Description: This defines the content of the RPVLL primary physics
-##              Cosmic Calo ESD-basedDPD output stream.
-##
-##-----------------------------------------------------------------------------
-
-import AthenaCommon.SystemOfUnits as Units
-
-from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
-from LongLivedParticleDPDMaker.LongLivedDPDFlags import *
-from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName
-from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLL_CosmicCaloStream import primRPVLLCosmicCaloDESDM
-
-streamName = primDPD.WriteRPVLL_CosmicCaloStream.StreamName 
-fileName   = buildFileName( primDPD.WriteRPVLL_CosmicCaloStream )
-RPVLL_CosmicCalo=MSMgr.NewPoolStream( streamName,fileName )
-
-if primDPD.ApplySkimming():
-    primDPD.SetupTrigDecisionTool = True
-
-    # Arrays holding the names of all offline object filters, 
-    # trigger filters and accept algorithms/filters
-    offlineJetFilterNames = []
-    offlineMuSegFilterNames=[]
-    triggerFilterNames = []
-    acceptAlgsNames = []
-
-############# Offline object filters
-
-## first cut on number of muon segments
-
-    from LongLivedParticleDPDMaker.MuonSegmentFilter import MuonSegmentFilter
-    muSegFilterName = "RPVLLCC_DESDMStream_MuonSegmentFilter"
-    topSequence += MuonSegmentFilter(muSegFilterName,
-                                     maxNumberSegments=primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.cutNsegMax,
-                                     minNumberSegments=primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.cutNsegMin)
-    offlineMuSegFilterNames.append(muSegFilterName)
-
-### if required, add a second MuonSegmentFilter instance, with looser cuts, but prescale it.
-
-    if primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.addPrescaledLooseFilter:
-        looseMuSegFilterName = "RPVLLCC_DESDMStream_looseMuSegFilter"
-        topSequence += MuonSegmentFilter(looseMuSegFilterName,
-                                         maxNumberSegments=primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.cutNsegMaxLoose,
-                                         minNumberSegments=primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.cutNsegMinLoose)
-        from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler
-        prescaledMuSegFilterName = "RPVLLCC_DESDMStream_prescaledMuSegFilter"
-        topSequence += PrimaryDPDPrescaler(prescaledMuSegFilterName,Prescale=primRPVLLCosmicCaloDESDM.muonSegmentFilterFlags.prescaleFactorForLooseFilter,
-                                           AcceptAlgs=[looseMuSegFilterName])
-        offlineMuSegFilterNames.append(prescaledMuSegFilterName)
-        pass
-    
-## jet filter
-    
-    from PrimaryDPDMaker.JetFilter import JetFilter
-    jetFilterName = 'RPVLL_CosmicCaloDESDMStream_JetFilter'
-    topSequence += JetFilter(jetFilterName)
-    offlineJetFilterNames.append( jetFilterName )
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.cutEtMin = primRPVLLCosmicCaloDESDM.jetFilterFlags.cutEtMin
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.cutEtMax = primRPVLLCosmicCaloDESDM.jetFilterFlags.cutEtMax
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.cutEtaMax = primRPVLLCosmicCaloDESDM.jetFilterFlags.cutEtaMax    
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.minNumberPassed = primRPVLLCosmicCaloDESDM.jetFilterFlags.nJetCut
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.jetCollectionName = primRPVLLCosmicCaloDESDM.jetFilterFlags.jetCollectionName 
-    topSequence.RPVLL_CosmicCaloDESDMStream_JetFilter.goodJetCollectionName = primRPVLLCosmicCaloDESDM.jetFilterFlags.goodJetCollectionName
-
-    # Create a combined filter by ORing together all the offline object filters
-    from PrimaryDPDMaker.LogicalFilterCombiner import LogicalFilterCombiner
-    combinedOfflineObjectFilterName = "RPVLL_CosmicCaloDESDMStream_CombinedOfflineObjectFilter"
-    topSequence += LogicalFilterCombiner( combinedOfflineObjectFilterName )
-    offlineFilterCounter = 0
-    cmdstring = "("
-    for offlineFilterName in offlineMuSegFilterNames :
-        if offlineFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += offlineFilterName
-        offlineFilterCounter += 1
-        pass
-    cmdstring+= ")"
-    for offlineFilterName in offlineJetFilterNames:
-        if offlineFilterCounter > 0 :
-            cmdstring += " and "
-            pass
-        cmdstring += offlineFilterName
-        offlineFilterCounter += 1
-        pass
-    topSequence.RPVLL_CosmicCaloDESDMStream_CombinedOfflineObjectFilter.cmdstring = cmdstring    
-
-
-    # Now, define the trigger filters
-    from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-    for trigName in primRPVLLCosmicCaloDESDM.triggerFilterFlags.TriggerNames :
-        TriggerFilterName = "RPVLL_CosmicCaloDESDMStream_TriggerFilter_"+trigName
-        topSequence += TriggerFilter( TriggerFilterName,
-                                 trigger = trigName )
-        triggerFilterNames.append( TriggerFilterName )
-        pass
-
-    # Create a combined filter by ORing together all the trigger filters
-    combinedTriggerFilterName = "RPVLL_CosmicCaloDESDMStream_CombinedTriggerFilter"
-    topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-    triggerFilterCounter = 0
-    cmdstring = ""
-    for triggerFilterName in triggerFilterNames :
-        if triggerFilterCounter > 0 :
-            cmdstring += " or "
-            pass
-        cmdstring += triggerFilterName
-        triggerFilterCounter += 1
-        pass
-    topSequence.RPVLL_CosmicCaloDESDMStream_CombinedTriggerFilter.cmdstring = cmdstring    
-
-    # Create the final combined filter ANDing together the combined
-    # trigger filter with the combined offline object filter
-    combinedTriggerAndOfflineObjectFilterName = "RPVLL_CosmicCaloDESDMStream_CombinedTriggerAndOfflineObjectFilter"
-    topSequence += LogicalFilterCombiner( combinedTriggerAndOfflineObjectFilterName )
-    cmdstring = combinedOfflineObjectFilterName + " and " + combinedTriggerFilterName
-    topSequence.RPVLL_CosmicCaloDESDMStream_CombinedTriggerAndOfflineObjectFilter.cmdstring = cmdstring
-    acceptAlgsNames.append( combinedTriggerAndOfflineObjectFilterName )
-
-    RPVLL_CosmicCalo.AcceptAlgs(acceptAlgsNames)
-    RPVLL_CosmicCalo.AddOtherAlgsToBookkeep( [combinedOfflineObjectFilterName, 
-                                       combinedTriggerFilterName, 
-                                       combinedTriggerAndOfflineObjectFilterName] )
-    pass
-
-
-from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput
-
-excludeList=['TrackCollection#Tracks',
-             'TrackCollection#*',
-             'Trk::TrackCollection#*',
-             'CaloShowerContainer#*'
-             ]
-dpdOutput.addAllItemsFromInputExceptExcludeList( streamName,excludeList )
-
-if primDPD.UseMCTruth():
-    if not "McAodBuilder" in dir(topSequence):
-        from McParticleAlgs.JobOptCfg import McAodBuilder
-        topSequence+=McAodBuilder()
-    RPVLL.AddItem( ['McEventCollection#GEN_AOD'] ) #AOD MC Truth
-    RPVLL.AddItem( ['TruthParticleContainer#SpclMC'] ) #AOD MC Truth
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpCaloId.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpCaloId.py
index 60805ca4e75cc2930af1931ff1396a8d811eff95..ec61f98ece6ad4ecead8f064ec2f53a0716e1dc5 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpCaloId.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpCaloId.py
@@ -26,7 +26,7 @@ from PrimaryDPDMaker.TriggerFilter import TriggerFilter
 for trigName in primRPVLLDESDM.SmpCaloId_triggerFilterFlags.TriggerNames:
     TriggerFilterName = "SmpCaloId_TriggerFilter_"+trigName
     topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
+                                  trigger = trigName)
     triggerFilterNames.append( TriggerFilterName )
     pass
 
@@ -46,39 +46,78 @@ topSequence.SmpCaloId_CombinedTriggerFilter.cmdstring = cmdstring
 filtersToBookkeep+=["SmpCaloId_CombinedTriggerFilter"]
 
 offlineObjectFilterNames=[]
+#=#=
+#=#=## configure muon filters
+#=#=
+#=#=#from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
+#=#=#
+#=#=#muonCollNames=["CaloESDMuonCollection", "CaloMuonCollection", "MuGirlLowBetaCollection", "MuidESDMuonCollection", "MuidMuonCollection",
+#=#=#               "StacoESDMuonCollection", "StacoMuonCollection"]
+#=#=#
+#=#=#for mucoll in muonCollNames:
+#=#=#    muonFilterName = 'SmpCaloId_MuFilter_'+mucoll
+#=#=#    muonFilter = D2PDMuonSelector(muonFilterName)
+#=#=#    offlineObjectFilterNames.append( muonFilterName )
+#=#=#    muonFilter.ptMin = primRPVLLDESDM.SmpCaloId_muonFilterFlags.cutEtMin
+#=#=#    muonFilter.inputCollection = mucoll
+#=#=#    muonFilter.minNumberPassed=1
+#=#=#    topSequence+=muonFilter
+#=#=
+#=#=## configure a track particle filter
+#=#=
+#=#=#from EventUtils.EventUtilsConf import ParticleSelectionAlg
+#=#=#trackParticleFilterName = 'SmpCaloId_TrackParticleFilter'
+#=#=#topSequence += ParticleSelectionAlg(trackParticleFilterName,
+#=#=#                                   InputContainer="InDetTrackParticles",
+#=#=#                                    OutputContainer="SmpCaloId_SelectedTrackParticles",
+#=#=#                                    Selection="pt>10000.")
+#=#=
+#=#=
+#=#from EventUtils.EventUtilsConf import CutAlg
+#=#cutString="count( "
+#=#cutString+= primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutInputCollection
+#=#cutString+=".pt > "
+#=#cutString+= str(primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPtMin)
+#=#cutString+= " && "
+#=#cutString+= primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutInputCollection
+#=#cutString+=".numberOfBLayerHits >="
+#=#cutString+=str(primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutBLayerHitsMin)
+#=#cutString+=" ) >= 1 "
+#=#print "NICK SmpCaloId cutString is ",cutString
+
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import SmpTrackFilterAlg
 
-## configure muon filters
-
-#from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
-#
-#muonCollNames=["CaloESDMuonCollection", "CaloMuonCollection", "MuGirlLowBetaCollection", "MuidESDMuonCollection", "MuidMuonCollection",
-#               "StacoESDMuonCollection", "StacoMuonCollection"]
-#
-#for mucoll in muonCollNames:
-#    muonFilterName = 'SmpCaloId_MuFilter_'+mucoll
-#    muonFilter = D2PDMuonSelector(muonFilterName)
-#    offlineObjectFilterNames.append( muonFilterName )
-#    muonFilter.ptMin = primRPVLLDESDM.SmpCaloId_muonFilterFlags.cutEtMin
-#    muonFilter.inputCollection = mucoll
-#    muonFilter.minNumberPassed=1
-#    topSequence+=muonFilter
-
-## configure a track particle filter
-from D2PDMaker.D2PDMakerConf import D2PDTrackParticleSelector
 trackParticleFilterName = 'SmpCaloId_TrackParticleFilter'
-topSequence += D2PDTrackParticleSelector( trackParticleFilterName,
-                                          ptMin                = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPtMin,
-                                          numberBLayerHitsMin  = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutBLayerHitsMin,
-                                          numberPixelHitsMin   = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPixelHitsMin,
-                                          numberSCTHitsMin     = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSCTHitsMin, 
-                                          numberSiliconHitsMin = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSiliconHitsMin,
-                                          inputCollection      = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutInputCollection,
-                                          outputLinkCollection = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutOutputLinkCollection,
-                                          minNumberPassed      = 1 )
-offlineObjectFilterNames.append( trackParticleFilterName )
+topSequence+=SmpTrackFilterAlg(trackParticleFilterName,
+                               ptMin                = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPtMin,
+                               numberBLayerHitsMin  = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutBLayerHitsMin,
+                               numberPixelHitsMin   = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPixelHitsMin,
+                               numberSCTHitsMin     = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSCTHitsMin, 
+                               numberSiliconHitsMin = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSiliconHitsMin,
+                               inputCollection      = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutInputCollection,
+                               minNumberPassed      = 1)
+
+##topSequence += CutAlg(trackParticleFilterName,
+##                      Cut = cutString)
 
-########### combine the offline filters
+offlineObjectFilterNames.append( trackParticleFilterName )
 
+#=#=
+#=#=from D2PDMaker.D2PDMakerConf import D2PDTrackParticleSelector
+#=#=
+#=#=topSequence += D2PDTrackParticleSelector( trackParticleFilterName,
+#=#=                                          ptMin                = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPtMin,
+#=#=                                          numberBLayerHitsMin  = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutBLayerHitsMin,
+#=#=                                          numberPixelHitsMin   = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutPixelHitsMin,
+#=#=                                          numberSCTHitsMin     = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSCTHitsMin, 
+#=#=                                          numberSiliconHitsMin = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutSiliconHitsMin,
+#=#=                                          inputCollection      = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutInputCollection,
+#=#=                                          outputLinkCollection = primRPVLLDESDM.SmpCaloId_trackParticleFilterFlags.cutOutputLinkCollection,
+#=#=                                          minNumberPassed      = 1 )
+#=#=offlineObjectFilterNames.append( trackParticleFilterName )
+#=#=
+#=#=########### combine the offline filters
+#=#=
 combinedOfflineFilterName = "SmpCaloId_CombinedOfflineFilter"
 topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
 
@@ -91,8 +130,10 @@ for offlineFilterName in offlineObjectFilterNames :
     cmdstring += offlineFilterName
     offlineFilterCounter += 1
     pass
+print "NICK cmdstring of OfflineObjectFilter is ",cmdstring
 topSequence.SmpCaloId_CombinedOfflineFilter.cmdstring=cmdstring
 filtersToBookkeep+=["SmpCaloId_CombinedOfflineFilter"]
+#=#=#=#=
 
 ########### combine the trigger and offline filters
 
@@ -100,6 +141,7 @@ SmpCaloIdCombinedFilter=LogicalFilterCombiner("SmpCaloIdCombinedFilter")
 topSequence+=SmpCaloIdCombinedFilter
 
 topSequence.SmpCaloIdCombinedFilter.cmdstring="SmpCaloId_CombinedTriggerFilter and SmpCaloId_CombinedOfflineFilter"
+##topSequence.SmpCaloIdCombinedFilter.cmdstring="SmpCaloId_CombinedTriggerFilter"
 
 ########### add this to the global top filter
 
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpMs.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpMs.py
index 68a9cd4d8e5ffbee8bf868a62f272f8bb5c3dc02..4e8ee2164a380ce03f3e7c4e22372153efbd25ed 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpMs.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_SmpMs.py
@@ -46,28 +46,20 @@ offlineObjectFilterNames=[]
 
 ## configure muon filters
 
-from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
-
-muonCollNames=["CaloESDMuonCollection", "CaloMuonCollection", "MuGirlLowBetaCollection", "MuidESDMuonCollection", "MuidMuonCollection",
-               "StacoESDMuonCollection", "StacoMuonCollection"]
-
-for mucoll in muonCollNames:
-    muonFilterName = 'SmpMs_MuFilter_'+mucoll
-    muonFilter = D2PDMuonSelector(muonFilterName)
-    offlineObjectFilterNames.append( muonFilterName )
-    muonFilter.ptMin = primRPVLLDESDM.SmpMs_muonFilterFlags.cutEtMin
-    muonFilter.inputCollection = mucoll
-    muonFilter.minNumberPassed=1
-    topSequence+=muonFilter
-
-
-###from PrimaryDPDMaker.MuonFilter import MuonFilter
-###muonFilterName = 'SmpMs_MuonFilter'
-###topSequence += MuonFilter(muonFilterName)
-###offlineObjectFilterNames.append( muonFilterName )
-###topSequence.SmpMs_MuonFilter.cutPtMinMu = primRPVLLDESDM.SmpMs_muonFilterFlags.cutEtMin
-###topSequence.SmpMs_MuonFilter.cutContainerMu=primRPVLLDESDM.SmpMs_muonFilterFlags.cutContainerMu
-###topSequence.SmpMs_MuonFilter.usingAOD=primRPVLLDESDM.SmpMs_muonFilterFlags.usingAOD
+from EventUtils.EventUtilsConf import CutAlg
+
+
+muonFilterName = 'SmpMs_MuonFilter'
+cutString="count( Muons.pt > "
+cutString+=str(primRPVLLDESDM.DV_muonFilterFlags.cutEtMin)
+cutString+=" ) > 1"
+
+
+muonFilter = CutAlg(muonFilterName,
+                    Cut=cutString)
+offlineObjectFilterNames.append( muonFilterName )
+topSequence+=muonFilter
+
 
 ########### combine the offline filters
 
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stealth.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stealth.py
deleted file mode 100644
index e78e5161532106a65a243d0b95e167d2c75bd597..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stealth.py
+++ /dev/null
@@ -1,88 +0,0 @@
-### configure trigger filters
-if len(primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames) == 0:
-    if rec.triggerStream() == "Egamma":
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Stealth_triggerFilterFlags.EgammaTriggerNames
-    elif rec.triggerStream() == "JetTauEtmiss":
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Stealth_triggerFilterFlags.JetTauEtmissTriggerNames
-    elif rec.triggerStream() == "Muons":
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Stealth_triggerFilterFlags.MuonsTriggerNames
-    elif rec.triggerStream() == "": # for MC the string will be empty, but we want to use all of the triggers
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = primRPVLLDESDM.Stealth_triggerFilterFlags.EgammaTriggerNames
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames += primRPVLLDESDM.Stealth_triggerFilterFlags.JetTauEtmissTriggerNames
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames += primRPVLLDESDM.Stealth_triggerFilterFlags.MuonsTriggerNames
-    else:
-        primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = ["dummy"] # back-up, to prevent empty-string failure in test jobs if no triggers used
-
-# get rid of potential doubles in the trigger lists, since attempting to add identical algs generates an ERROR
-primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames = list(set(primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames))
-
-triggerFilterNames=[]
-from PrimaryDPDMaker.TriggerFilter import TriggerFilter
-for trigName in primRPVLLDESDM.Stealth_triggerFilterFlags.TriggerNames:
-    TriggerFilterName = "Stealth_TriggerFilter_"+trigName
-    topSequence += TriggerFilter( TriggerFilterName,
-                                  trigger = trigName )
-    triggerFilterNames.append( TriggerFilterName )
-    pass
-
-
-# Create a combined filter by ORing together all the trigger filters
-combinedTriggerFilterName = "Stealth_CombinedTriggerFilter"
-topSequence += LogicalFilterCombiner( combinedTriggerFilterName )
-triggerFilterCounter = 0
-cmdstring = ""
-for triggerFilterName in triggerFilterNames :
-    if triggerFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += triggerFilterName
-    triggerFilterCounter += 1
-    pass
-topSequence.Stealth_CombinedTriggerFilter.cmdstring = cmdstring    
-filtersToBookkeep+=["Stealth_CombinedTriggerFilter"]
-
-offlineObjectFilterNames=[]
-
-## configure a track filter
-
-from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import StealthFilterAlg
-stealthFilterName = 'Stealth_StealthFilter'
-topSequence += StealthFilterAlg(stealthFilterName)
-offlineObjectFilterNames.append( stealthFilterName )
-
-topSequence.Stealth_StealthFilter.cutMinTrackSd0 = primRPVLLDESDM.Stealth_stealthFilterFlags.cutMinTrackSd0
-topSequence.Stealth_StealthFilter.cutMinNTracks = primRPVLLDESDM.Stealth_stealthFilterFlags.cutMinNTracks
-topSequence.Stealth_StealthFilter.cutMinTrackpT = primRPVLLDESDM.Stealth_stealthFilterFlags.cutMinTrackpT
-topSequence.Stealth_StealthFilter.cutMinTrackEta = primRPVLLDESDM.Stealth_stealthFilterFlags.cutMinTrackEta
-topSequence.Stealth_StealthFilter.passAll = False
-
-########### combine the offline filters
-
-combinedOfflineFilterName = "Stealth_CombinedOfflineFilter"
-topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-
-offlineFilterCounter = 0
-cmdstring = ""
-for offlineFilterName in offlineObjectFilterNames :
-    if offlineFilterCounter > 0 :
-        cmdstring += " or "
-        pass
-    cmdstring += offlineFilterName
-    offlineFilterCounter += 1
-    pass
-topSequence.Stealth_CombinedOfflineFilter.cmdstring=cmdstring
-filtersToBookkeep+=["Stealth_CombinedOfflineFilter"]
-
-########### combine the trigger and offline filters
-
-StealthCombinedFilter=LogicalFilterCombiner("StealthCombinedFilter")
-topSequence+=StealthCombinedFilter
-
-topSequence.StealthCombinedFilter.cmdstring="(Stealth_CombinedTriggerFilter and Stealth_CombinedOfflineFilter)"
-
-########### add this to the global top filter
-
-if topCmdString.__len__() > 0:
-    topCmdString+=" or "
-    pass
-topCmdString+="StealthCombinedFilter"
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stopped.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stopped.py
index 6dbd663480bfc750cdde47ecea6bcc3b74668b24..8e356407f6548a5c5d4c2828391b7b41e3af8583 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stopped.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_Stopped.py
@@ -46,38 +46,52 @@ filtersToBookkeep+=["Stopped_CombinedTriggerFilter"]
 #    Stopped_CombinedTriggerFilter && (jet && (muon or prescale) )
 ##
 
+from EventUtils.EventUtilsConf import CutAlg
+
 ## configure a jet filter
 flags = primRPVLLDESDM.Stopped_jetFilterFlags
 jetFilterName = "Stopped_JetFilter"
 
-from D2PDMaker.D2PDMakerConf import D2PDJetSelector
-topSequence += D2PDJetSelector(jetFilterName)
-topSequence.Stopped_JetFilter.etMin = flags.cutEtMin
-topSequence.Stopped_JetFilter.etMax = flags.cutEtMax
-topSequence.Stopped_JetFilter.absEtaMin = flags.cutEtaMin
-topSequence.Stopped_JetFilter.absEtaMax = flags.cutEtaMax
-topSequence.Stopped_JetFilter.jetPSFractionMax = flags.cutPSFracMax
-topSequence.Stopped_JetFilter.inputCollection = flags.jetCollectionName
-topSequence.Stopped_JetFilter.minNumberPassed=1
-
+cutString= "count( "
+cutString+= flags.jetCollectionName
+cutString+=".pt > "
+cutString+= str(flags.cutEtMin)
+cutString+=" && "
+cutString+= flags.jetCollectionName
+cutString+=".pt < "
+cutString+= str(flags.cutEtMax)
+cutString+=" && abs("
+cutString+= flags.jetCollectionName
+cutString+=".eta) < "
+cutString+= str(flags.cutEtaMax)
+cutString+=" && abs("
+cutString+= flags.jetCollectionName
+cutString+=".eta) > "
+cutString+= str(flags.cutEtaMin)
+cutString+=") >= 1"
+topSequence += CutAlg(jetFilterName,
+                      Cut=cutString)
+filtersToBookkeep+=[jetFilterName]
+
+# NB: Does not have the max jet presampler fraction (flags.cutPSFracMax)
 
 ## configure a muon segment filter
-from LongLivedParticleDPDMaker.MuonSegmentFilter import MuonSegmentFilter
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import MuonSegmentFilterAlg
 segFilterName = "Stopped_MuonSegmentFilter"
-segmentFilter = MuonSegmentFilter(segFilterName)
+segmentFilter = MuonSegmentFilterAlg(segFilterName)
 flags = primRPVLLDESDM.Stopped_muonSegmentFilterFlags
 
-segmentFilter.minNumberSegments                 = flags.cutNsegMin
-segmentFilter.maxNumberSegments                 = flags.cutNsegMax
-segmentFilter.muonSegmentContainerName  = flags.muonSegmentCollectionName
+segmentFilter.minNumberSegments    = flags.cutNsegMin
+segmentFilter.maxNumberSegments    = flags.cutNsegMax
+segmentFilter.muonSegmentContainer = flags.muonSegmentCollectionName
 topSequence += segmentFilter
 
 if primRPVLLDESDM.Stopped_muonSegmentFilterFlags.addPrescaledLooseFilter:
     looseMuSegFilterName = "Stopped_looseMuSegFilter"
-    looseMuSegFilter = MuonSegmentFilter(looseMuSegFilterName)
+    looseMuSegFilter = MuonSegmentFilterAlg(looseMuSegFilterName)
     looseMuSegFilter.maxNumberSegments=flags.cutNsegMaxLoose
     looseMuSegFilter.minNumberSegments=flags.cutNsegMinLoose
-    looseMuSegFilter.muonSegmentContainerName=flags.muonSegmentCollectionName
+    looseMuSegFilter.muonSegmentContainer=flags.muonSegmentCollectionName
     topSequence += looseMuSegFilter
     
     from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_VH_DV.py b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_VH_DV.py
index a853e8066b989e636cb919100014efe1b35428cb..d09faeae991afd107f6e9fd9a36090f3892ca422 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_VH_DV.py
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/share/PhysDESDM_VH_DV.py
@@ -42,23 +42,23 @@ for triggerFilterName in triggerFilterNames :
 topSequence.VH_DV_CombinedTriggerFilter.cmdstring = cmdstring    
 filtersToBookkeep+=["VH_DV_CombinedTriggerFilter"]
 
-##  a real jet filter
-from LongLivedParticleDPDMaker.FancyJetFilter import FancyJetFilter
+##  a fancy jet filter
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import FancyJetFilterAlg
 jetFilterName = "VH_DV_JetFilter"
-topSequence += FancyJetFilter(jetFilterName)
+topSequence += FancyJetFilterAlg(jetFilterName)
 topSequence.VH_DV_JetFilter.cutEtMin=primRPVLLDESDM.VH_DV_jetFilterFlags.jetPtCut
-topSequence.VH_DV_JetFilter.cutEtMax=14.0*Units.TeV
 topSequence.VH_DV_JetFilter.minNumberPassed=primRPVLLDESDM.VH_DV_jetFilterFlags.nJetPassed
 topSequence.VH_DV_JetFilter.cutSumPtTrkMax=primRPVLLDESDM.VH_DV_jetFilterFlags.MaxSumPtTrk
-topSequence.VH_DV_JetFilter.jetCollectionName = "AntiKt4TopoEMJets"
+topSequence.VH_DV_JetFilter.jetCollectionName = "AntiKt4LCTopoJets"
 filtersToBookkeep+=["VH_DV_JetFilter"]
 
 ## METfilter
-from PrimaryDPDMaker.MissingEtFilter import MissingEtFilter
+from LongLivedParticleDPDMaker.LongLivedParticleDPDMakerConf import DVMETFilterAlg
+##from PrimaryDPDMaker.MissingEtFilter import MissingEtFilter
 missingetFilterName = 'VH_DV_MissingEtFilter'
-topSequence += MissingEtFilter(missingetFilterName)
+topSequence += DVMETFilterAlg(missingetFilterName)
 topSequence.VH_DV_MissingEtFilter.cutMetMin = primRPVLLDESDM.VH_DV_missingetFilterFlags.cutMetMin
-topSequence.VH_DV_MissingEtFilter.requireMet = True
+##topSequence.VH_DV_MissingEtFilter.requireMet = True
 filtersToBookkeep+=["VH_DV_MissingEtFilter"]
 
 jetMetFilterName = "VH_DV_JetMetFilter"
@@ -66,81 +66,91 @@ topSequence += LogicalFilterCombiner( jetMetFilterName)
 topSequence.VH_DV_JetMetFilter.cmdstring = "VH_DV_JetFilter and VH_DV_MissingEtFilter"
 filtersToBookkeep+=["VH_DV_JetMetFilter"]
 
+from EventUtils.EventUtilsConf import CutAlg
+
 if rec.triggerStream() == "Muons" or rec.triggerStream() == "":
+    cutString="count( Muons.pt > "
+    cutString+=str(primRPVLLDESDM.VH_DV_muonFilterFlags.cutEtMin)
+    cutString+=" && abs(Muons.eta) < "
+    cutString+=str(primRPVLLDESDM.VH_DV_muonFilterFlags.cutEtaMax)
+    cutString+=" ) > 0"
+    muonFilterName = 'VH_DV_MuonFilter'
+    
+    muonFilter = CutAlg(muonFilterName,
+                        Cut=cutString)
+
+    topSequence+=muonFilter
+
 
-	offlineMuonFilterNames=[]
-	from D2PDMaker.D2PDMakerConf import D2PDMuonSelector
-	muonCollNames=["MuidESDMuonCollection", "MuidMuonCollection", "StacoESDMuonCollection", "StacoMuonCollection"]
-	for mucoll in muonCollNames:
-		muonFilterName = 'VH_DV_MuFilter_'+mucoll
-		muonFilter = D2PDMuonSelector(muonFilterName)
-		offlineMuonFilterNames.append( muonFilterName )
-		muonFilter.ptMin = primRPVLLDESDM.VH_DV_muonFilterFlags.cutEtMin
-		muonFilter.absEtaMax = primRPVLLDESDM.VH_DV_muonFilterFlags.cutEtaMax
-		muonFilter.inputCollection = mucoll
-		muonFilter.minNumberPassed=1
-		topSequence+=muonFilter
-
-	########### combine the offline filters
-	muonFilterName = "VH_DV_MuonFilter"
-	topSequence += LogicalFilterCombiner( muonFilterName )
-	muonFilterCounter = 0
-	cmdstring = ""
-	for muFilterName in offlineMuonFilterNames :
-		if muonFilterCounter > 0 :
-			cmdstring += " or "
-			pass
-		cmdstring += muFilterName
-		muonFilterCounter += 1
-		pass
-	topSequence.VH_DV_MuonFilter.cmdstring=cmdstring ##+ " and VH_DV_JetFilter2"
-	filtersToBookkeep+=["VH_DV_MuonFilter"]
-
-	combinedOfflineFilterName = "VH_DV_CombinedMuonsOfflineFilter"
-	topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-	cmdstring = "VH_DV_MuonFilter and VH_DV_JetMetFilter"
-	topSequence.VH_DV_CombinedMuonsOfflineFilter.cmdstring=cmdstring 
-	filtersToBookkeep+=["VH_DV_CombinedMuonsOfflineFilter"]
+    combinedOfflineFilterName = "VH_DV_CombinedMuonsOfflineFilter"
+    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
+    cmdstring = "VH_DV_MuonFilter and VH_DV_JetMetFilter"
+    topSequence.VH_DV_CombinedMuonsOfflineFilter.cmdstring=cmdstring 
+    filtersToBookkeep+=["VH_DV_CombinedMuonsOfflineFilter"]
 	
 if rec.triggerStream() == "Egamma" or rec.triggerStream() == "":
 
-	from PrimaryDPDMaker.ElectronFilter import ElectronFilter
-	electronFilterName = 'VH_DV_ElectronFilter'
-	topSequence += ElectronFilter(electronFilterName)
-	topSequence.VH_DV_ElectronFilter.cutEtMin = primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtMin
-	topSequence.VH_DV_ElectronFilter.cutEtaMax = primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtaMax
-	topSequence.VH_DV_ElectronFilter.cutIsEM=primRPVLLDESDM.VH_DV_electronFilterFlags.cutIsEM
-	topSequence.VH_DV_ElectronFilter.cutAuthor=primRPVLLDESDM.VH_DV_electronFilterFlags.cutAuthor
-	topSequence.VH_DV_ElectronFilter.electronCollectionName=primRPVLLDESDM.VH_DV_electronFilterFlags.electronCollectionName
-	filtersToBookkeep+=["VH_DV_ElectronFilter"]
-
-	electronFilterName = 'VH_DV_DiElectronFilter'
-	topSequence += ElectronFilter(electronFilterName)
-	topSequence.VH_DV_DiElectronFilter.cutEtMin = primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtMin
-	topSequence.VH_DV_DiElectronFilter.cutEtaMax = primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtaMax
-	topSequence.VH_DV_DiElectronFilter.cutIsEM=primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutIsEM
-	topSequence.VH_DV_DiElectronFilter.cutAuthor=primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutAuthor
-	topSequence.VH_DV_DiElectronFilter.electronCollectionName=primRPVLLDESDM.VH_DV_DielectronFilterFlags.electronCollectionName
-	topSequence.VH_DV_DiElectronFilter.minNumberPassed = 2
-	filtersToBookkeep+=["VH_DV_DiElectronFilter"]
-
-	combinedOfflineFilterName = "VH_DV_CombinedWOfflineFilter"
-	topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-	cmdstring = "VH_DV_ElectronFilter and VH_DV_JetMetFilter"
-	topSequence.VH_DV_CombinedWOfflineFilter.cmdstring=cmdstring 
-	filtersToBookkeep+=[combinedOfflineFilterName]
-
-	combinedOfflineFilterName = "VH_DV_CombinedZOfflineFilter"
-	topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-	cmdstring = "VH_DV_DiElectronFilter and VH_DV_JetFilter"
-	topSequence.VH_DV_CombinedZOfflineFilter.cmdstring=cmdstring 
-	filtersToBookkeep+=[combinedOfflineFilterName]
-
-	combinedOfflineFilterName = "VH_DV_CombinedEgammaOfflineFilter"
-	topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
-	cmdstring = "VH_DV_CombinedWOfflineFilter or VH_DV_CombinedZOfflineFilter"
-	topSequence.VH_DV_CombinedEgammaOfflineFilter.cmdstring=cmdstring 
-	filtersToBookkeep+=[combinedOfflineFilterName]
+    electronFilterName = 'VH_DV_ElectronFilter'
+    cutString="count( "
+    cutString+= primRPVLLDESDM.VH_DV_electronFilterFlags.electronCollectionName
+    cutString+=".pt > "
+    cutString += str(primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtMin)
+    cutString+= " && abs("
+    cutString+= primRPVLLDESDM.VH_DV_electronFilterFlags.electronCollectionName
+    cutString+=".eta) < "
+    cutString+= str(primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtaMax)
+    cutString+=" ) > 0"
+    topSequence += CutAlg(electronFilterName,
+                          Cut=cutString)
+    filtersToBookkeep+=["VH_DV_ElectronFilter"]
+##    topSequence += ElectronFilter(electronFilterName)
+##    topSequence.VH_DV_ElectronFilter.cutEtMin = primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtMin
+##    topSequence.VH_DV_ElectronFilter.cutEtaMax = primRPVLLDESDM.VH_DV_electronFilterFlags.cutEtaMax
+##    topSequence.VH_DV_ElectronFilter.cutIsEM=primRPVLLDESDM.VH_DV_electronFilterFlags.cutIsEM
+##    topSequence.VH_DV_ElectronFilter.cutAuthor=primRPVLLDESDM.VH_DV_electronFilterFlags.cutAuthor
+##    topSequence.VH_DV_ElectronFilter.electronCollectionName=primRPVLLDESDM.VH_DV_electronFilterFlags.electronCollectionName
+
+
+    electronFilterName = 'VH_DV_DiElectronFilter'
+    cutString="count( "
+    cutString+= primRPVLLDESDM.VH_DV_DielectronFilterFlags.electronCollectionName
+    cutString+=".pt > "
+    cutString += str(primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtMin)
+    cutString+= " && abs("
+    cutString+= primRPVLLDESDM.VH_DV_DielectronFilterFlags.electronCollectionName
+    cutString+=".eta) < "
+    cutString+= str(primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtaMax)
+    cutString+=" ) > 1"
+    topSequence += CutAlg(electronFilterName,
+                          Cut=cutString)
+    filtersToBookkeep+=["VH_DV_DiElectronFilter"]
+
+##    topSequence += ElectronFilter(electronFilterName)
+##    topSequence.VH_DV_DiElectronFilter.cutEtMin = primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtMin
+##    topSequence.VH_DV_DiElectronFilter.cutEtaMax = primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutEtaMax
+##    topSequence.VH_DV_DiElectronFilter.cutIsEM=primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutIsEM
+##    topSequence.VH_DV_DiElectronFilter.cutAuthor=primRPVLLDESDM.VH_DV_DielectronFilterFlags.cutAuthor
+##    topSequence.VH_DV_DiElectronFilter.electronCollectionName=primRPVLLDESDM.VH_DV_DielectronFilterFlags.electronCollectionName
+##    topSequence.VH_DV_DiElectronFilter.minNumberPassed = 2
+
+    
+    combinedOfflineFilterName = "VH_DV_CombinedWOfflineFilter"
+    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
+    cmdstring = "VH_DV_ElectronFilter and VH_DV_JetMetFilter"
+    topSequence.VH_DV_CombinedWOfflineFilter.cmdstring=cmdstring 
+    filtersToBookkeep+=[combinedOfflineFilterName]
+    
+    combinedOfflineFilterName = "VH_DV_CombinedZOfflineFilter"
+    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
+    cmdstring = "VH_DV_DiElectronFilter and VH_DV_JetFilter"
+    topSequence.VH_DV_CombinedZOfflineFilter.cmdstring=cmdstring 
+    filtersToBookkeep+=[combinedOfflineFilterName]
+    
+    combinedOfflineFilterName = "VH_DV_CombinedEgammaOfflineFilter"
+    topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
+    cmdstring = "VH_DV_CombinedWOfflineFilter or VH_DV_CombinedZOfflineFilter"
+    topSequence.VH_DV_CombinedEgammaOfflineFilter.cmdstring=cmdstring 
+    filtersToBookkeep+=[combinedOfflineFilterName]
 
 
 ########### combine the trigger and offline filters
@@ -151,7 +161,7 @@ if rec.triggerStream() == "Muons":
 elif rec.triggerStream() == "Egamma":
     topSequence+=VH_DVCombinedFilter
     topSequence.VH_DVCombinedFilter.cmdstring="VH_DV_CombinedTriggerFilter and VH_DV_CombinedEgammaOfflineFilter"
-elif rec.triggerStream() == "": #MC
+else:
     combinedOfflineFilterName = "VH_DV_CombinedEgammaMuonsOfflineFilter"
     topSequence += LogicalFilterCombiner( combinedOfflineFilterName )
     cmdstring = "VH_DV_CombinedEgammaOfflineFilter or VH_DV_CombinedMuonsOfflineFilter"
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlg.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlg.cxx
deleted file mode 100644
index f807b40bd8696985bec04f21e19e6fdd1f106cb8..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlg.cxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LongLivedParticleDPDMaker/DVFilterAlg.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-#include "VxVertex/VxContainer.h"
-#include "muonEvent/MuonContainer.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-
-/// Standard Service Constructor
-DVFilterAlg::DVFilterAlg(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthFilterAlgorithm(name, pSvcLocator), 
-    m_nProcessed(0),
-    m_nPassMuonCut(0),
-    m_trackToVertexTool("Reco::TrackToVertex")
-{
-  declareProperty("passAll", m_passAll = false); 
-  declareProperty("primVtxColl",m_primVtxName="VxPrimaryCandidate");
-  declareProperty("MuonCollection",m_muonCollName="MuidMuonCollection");
-  declareProperty("MuonPtCut",m_muonPtCut=20000.);
-  declareProperty("MuonEtaCut",m_muonEtaCut=2.);
-  declareProperty("MuonD0Cut",m_muonD0Cut=1.);
-}
-
-/// Destructor
-DVFilterAlg::~DVFilterAlg() {}
-
-StatusCode DVFilterAlg::initialize()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-  sc = m_trackToVertexTool.retrieve();
-  if(sc.isFailure()){
-    msg(MSG::INFO) << "Could not retrieve TrackToVertexTool";
-    return StatusCode::FAILURE;
-  }
-
-  return sc;
-}
-
-StatusCode DVFilterAlg::execute()
-{
-
-  StatusCode sc(StatusCode::SUCCESS);
-
-  m_nProcessed += 1;
-  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "==> execute " << name() << " on " << m_nProcessed << " event..." << endreq;
-
-  ///If passAll is selected, accept all events
-  if(m_passAll){
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << name() << " event passed because passAll is true" << endreq;
-    setFilterPassed(true);
-    return sc;
-  }
-
-  const VxContainer* primVertices(0);
-  sc = evtStore()->retrieve(primVertices,m_primVtxName);
-  if (sc.isFailure()) 
-    msg(MSG::ERROR)<<"Failed to retrieve VxPrimaryCandidate collection "<<m_primVtxName<<endreq;
-  else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)<<"retrieved VxPrimaryCandidate size "<<primVertices->size()<<endreq;  
-
-  if (primVertices->size() == 0) {
-    msg(MSG::WARNING)<<"Primary vertex not found, will skip this event"<<endreq;
-    setFilterPassed(false);
-    return StatusCode::SUCCESS;
-  }
-
-
-  const  Analysis::MuonContainer*  muon_reco=0;
-  sc=evtStore()->retrieve(muon_reco , m_muonCollName);
-  if( sc.isFailure()  ||  !muon_reco ) {
-    msg(MSG::WARNING) << "No muon container found, will skip this event" << endreq; 
-    setFilterPassed(false);
-    return StatusCode::SUCCESS;
-  } 
-
-
-  Analysis::MuonContainer::const_iterator muonItr = muon_reco->begin();  
-  Analysis::MuonContainer::const_iterator muonItrE = muon_reco->end(); 
-  
-  for (; muonItr!=muonItrE; ++muonItr) { 
-    
-    if (fabs((*muonItr)->pt()) < m_muonPtCut ) continue;
-    if (fabs((*muonItr)->eta()) > m_muonEtaCut ) continue;
-    Rec::TrackParticle* muTrack = const_cast<Rec::TrackParticle*>((*muonItr)->track());
-    if (muTrack==0) continue;
-    /// Find d0 wrt all PVs in the event
-    bool muGoodD0=true;
-
-    for (unsigned int i_vtx=0; i_vtx<primVertices->size(); ++i_vtx) {
-      const Trk::RecVertex pVtx = (primVertices->at(i_vtx))->recVertex();
-      const Trk::Perigee* perigeeAtPV = m_trackToVertexTool->perigeeAtVertex(*muTrack, pVtx.position());
-      if (perigeeAtPV == 0) {
-	msg(MSG::DEBUG)<<"perigee at PV is null"<<endreq;
-	continue;
-      }
-      double d0 = perigeeAtPV->parameters()[Trk::d0];
-      if (fabs(d0)< m_muonD0Cut ) muGoodD0=false;
-      break;
-    }
-    if (muGoodD0) { 
-      m_nPassMuonCut++;
-      setFilterPassed(true);
-      return sc;
-    }
-  }
-  setFilterPassed(false);
-  return sc;  
-}
-
-StatusCode DVFilterAlg::finalize()
-{
-
-  StatusCode sc(StatusCode::SUCCESS);
-
-
-  if (msgLvl(MSG::INFO)) {
-    msg(MSG::INFO) << "Finalize " << name() << endreq;
-    msg(MSG::INFO) <<"nProcessed "<<m_nProcessed<<endreq;
-    msg(MSG::INFO) <<"nPassMuonCut "<<m_nPassMuonCut<<endreq;
-    msg(MSG::INFO) <<"Efficiency =  "<<100.0*(float)m_nPassMuonCut/ (float)m_nProcessed<<"%"<<endreq;
-  }
-  return sc;  
-}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgDiElectron.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgDiElectron.cxx
deleted file mode 100644
index e4f0cba179b2d91f5eb654972901dd872ee9bc18..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgDiElectron.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LongLivedParticleDPDMaker/DVFilterAlgDiElectron.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-#include "VxVertex/VxContainer.h"
-#include "egammaEvent/ElectronContainer.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-
-/// Standard Service Constructor
-DVFilterAlgDiElectron::DVFilterAlgDiElectron(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthFilterAlgorithm(name, pSvcLocator), 
-    m_nProcessed(0),
-    m_nPassElectronCut(0),
-    m_trackToVertexTool("Reco::TrackToVertex")
-{
-	declareProperty("passAll", m_passAll = false); 
-	declareProperty("primVtxColl",m_primVtxName="VxPrimaryCandidate");
-	declareProperty("ElectronCollection",m_electronCollName="ElectronCollection");
-	declareProperty("dielectronD0Cut",m_dielectronD0Cut=1.);
-	declareProperty("dielectronPtCut",m_dielectronPtCut=20000.);
-	declareProperty("dielectronEtaCut",m_dielectronEtaCut=2.5);
-}
-
-/// Destructor
-DVFilterAlgDiElectron::~DVFilterAlgDiElectron() {}
-
-StatusCode DVFilterAlgDiElectron::initialize()
-{
-	// Declare the simple StatusCode
-	StatusCode sc(StatusCode::SUCCESS);
-	sc = m_trackToVertexTool.retrieve();
-	if(sc.isFailure())
-	{
-		msg(MSG::INFO) << "Could not retrieve TrackToVertexTool";
-		return StatusCode::FAILURE;
-	}
-
-	return sc;
-}
-
-StatusCode DVFilterAlgDiElectron::execute()
-{
-
-	StatusCode sc(StatusCode::SUCCESS);
-
-	m_nProcessed += 1;
-	if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "==> execute " << name() << " on " << m_nProcessed << " event..." << endreq;
-
-	///If passAll is selected, accept all events
-	if(m_passAll)
-	{
-		if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << name() << " event passed because passAll is true" << endreq;
-		setFilterPassed(true);
-		return sc;
-	}
-
-	const VxContainer* primVertices(0);
-	sc = evtStore()->retrieve(primVertices,m_primVtxName);
-	if (sc.isFailure()) 
-	msg(MSG::ERROR)<<"Failed to retrieve VxPrimaryCandidate collection "<<m_primVtxName<<endreq;
-	else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)<<"retrieved VxPrimaryCandidate size "<<primVertices->size()<<endreq;  
-
-	if (primVertices->size() == 0) 
-	{
-		msg(MSG::WARNING)<<"Primary vertex not found, will skip this event"<<endreq;
-		setFilterPassed(false);
-		return StatusCode::SUCCESS;
-	}
-
-	const  ElectronContainer*  electron_reco=0;
-	sc=evtStore()->retrieve(electron_reco , m_electronCollName);
-	if( sc.isFailure()  ||  !electron_reco ) 
-	{
-		msg(MSG::WARNING) << "No electron container found, will skip this event" << endreq; 
-		setFilterPassed(false);
-		return StatusCode::SUCCESS;
-	} 
-
-	ElectronContainer::const_iterator electronItr = electron_reco->begin();  
-	ElectronContainer::const_iterator electronItrE = electron_reco->end(); 
-	
-	m_diElectronCounter = 0;
-	bool elGoodD0_bookkeeping=false;
-	for (; electronItr!=electronItrE; ++electronItr) 
-	{ 	
-		if (fabs((*electronItr)->pt()) < m_dielectronPtCut ) continue;
-		// if (fabs((*electronItr)->eta()) > m_dielectronEtaCut ) continue;  
-		m_diElectronCounter++;
-		
-		Rec::TrackParticle* elTrack = const_cast<Rec::TrackParticle*>((*electronItr)->trackParticle());
-		if (elTrack==0) continue;
-			
-		// Find d0 wrt all PVs in the event
-		bool elGoodD0=true;
-		for (unsigned int i_vtx=0; i_vtx<primVertices->size(); ++i_vtx) 
-		{
-			const Trk::RecVertex pVtx = (primVertices->at(i_vtx))->recVertex();
-			const Trk::Perigee* perigeeAtPV = m_trackToVertexTool->perigeeAtVertex(*elTrack, pVtx.position());
-			if (perigeeAtPV == 0) 
-			{
-				msg(MSG::DEBUG)<<"perigee at PV is null"<<endreq;
-				continue;
-			}
-			double d0 = perigeeAtPV->parameters()[Trk::d0];
-			
-			if (fabs(d0)< m_dielectronD0Cut ) elGoodD0=false;
-			break;
-		}
-		//if (elGoodD0) m_diElectronCounter++;
-		if (elGoodD0) elGoodD0_bookkeeping=true;
-		
-		// if (elGoodD0 && m_diElectronCounter>1) 
-		if (elGoodD0_bookkeeping && m_diElectronCounter>1) 
-		{ 
-			m_nPassElectronCut++;
-			setFilterPassed(true);
-			return sc;
-		}
-	}
-	setFilterPassed(false);
-	return sc;  
-}
-
-StatusCode DVFilterAlgDiElectron::finalize()
-{
-
-	StatusCode sc(StatusCode::SUCCESS);
-
-	if (msgLvl(MSG::INFO)) 
-	{
-		msg(MSG::INFO) << "Finalize " << name() << endreq;
-		msg(MSG::INFO) <<"d0 cut = " << m_dielectronD0Cut << ", pT cut = " << m_dielectronPtCut << ", Eta cut = " << m_dielectronEtaCut << endreq;
-		msg(MSG::INFO) <<"nProcessed "<<m_nProcessed<<endreq;
-		msg(MSG::INFO) <<"nPassElectronCut "<<m_nPassElectronCut<<endreq;
-		msg(MSG::INFO) <<"Efficiency =  "<<100.0*(float)m_nPassElectronCut/ (float)m_nProcessed<<"%"<<endreq;
-	}
-	return sc;  
-}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgEgamma.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgEgamma.cxx
deleted file mode 100644
index 6915dcf05766ba0b41b374cefa24e0325d47b493..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVFilterAlgEgamma.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LongLivedParticleDPDMaker/DVFilterAlgEgamma.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-#include "VxVertex/VxContainer.h"
-#include "egammaEvent/ElectronContainer.h"
-#include "ITrackToVertex/ITrackToVertex.h"
-
-/// Standard Service Constructor
-DVFilterAlgEgamma::DVFilterAlgEgamma(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthFilterAlgorithm(name, pSvcLocator), 
-    m_nProcessed(0),
-    m_nPassElectronCut(0),
-    m_trackToVertexTool("Reco::TrackToVertex")
-{
-	declareProperty("passAll", m_passAll = false); 
-	declareProperty("primVtxColl",m_primVtxName="VxPrimaryCandidate");
-	declareProperty("ElectronCollection",m_electronCollName="ElectronCollection");
-	declareProperty("electronD0Cut",m_electronD0Cut=1.);
-	declareProperty("electronPtCut",m_electronPtCut=20000.);
-	declareProperty("electronEtaCut",m_electronEtaCut=2.5);
-}
-
-/// Destructor
-DVFilterAlgEgamma::~DVFilterAlgEgamma() {}
-
-StatusCode DVFilterAlgEgamma::initialize()
-{
-	// Declare the simple StatusCode
-	StatusCode sc(StatusCode::SUCCESS);
-	sc = m_trackToVertexTool.retrieve();
-	if(sc.isFailure())
-	{
-		msg(MSG::INFO) << "Could not retrieve TrackToVertexTool";
-		return StatusCode::FAILURE;
-	}
-
-	return sc;
-}
-
-StatusCode DVFilterAlgEgamma::execute()
-{
-
-	StatusCode sc(StatusCode::SUCCESS);
-
-	m_nProcessed += 1;
-	if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "==> execute " << name() << " on " << m_nProcessed << " event..." << endreq;
-
-	///If passAll is selected, accept all events
-	if(m_passAll)
-	{
-		if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << name() << " event passed because passAll is true" << endreq;
-		setFilterPassed(true);
-		return sc;
-	}
-
-	const VxContainer* primVertices(0);
-	sc = evtStore()->retrieve(primVertices,m_primVtxName);
-	if (sc.isFailure()) 
-	msg(MSG::ERROR)<<"Failed to retrieve VxPrimaryCandidate collection "<<m_primVtxName<<endreq;
-	else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)<<"retrieved VxPrimaryCandidate size "<<primVertices->size()<<endreq;  
-
-	if (primVertices->size() == 0) 
-	{
-		msg(MSG::WARNING)<<"Primary vertex not found, will skip this event"<<endreq;
-		setFilterPassed(false);
-		return StatusCode::SUCCESS;
-	}
-
-	const  ElectronContainer*  electron_reco=0;
-	sc=evtStore()->retrieve(electron_reco , m_electronCollName);
-	if( sc.isFailure()  ||  !electron_reco ) 
-	{
-		msg(MSG::WARNING) << "No electron container found, will skip this event" << endreq; 
-		setFilterPassed(false);
-		return StatusCode::SUCCESS;
-	} 
-
-	ElectronContainer::const_iterator electronItr = electron_reco->begin();  
-	ElectronContainer::const_iterator electronItrE = electron_reco->end(); 
-	  
-	for (; electronItr!=electronItrE; ++electronItr) 
-	{ 	
-		if (fabs((*electronItr)->pt()) < m_electronPtCut ) continue;
-		// if (fabs((*electronItr)->eta()) > m_electronEtaCut ) continue;                   
-		
-		Rec::TrackParticle* elTrack = const_cast<Rec::TrackParticle*>((*electronItr)->trackParticle());
-		if (elTrack==0) continue;
-			
-		// Find d0 wrt all PVs in the event
-		bool elGoodD0=true;
-		for (unsigned int i_vtx=0; i_vtx<primVertices->size(); ++i_vtx) 
-		{
-			const Trk::RecVertex pVtx = (primVertices->at(i_vtx))->recVertex();
-			const Trk::Perigee* perigeeAtPV = m_trackToVertexTool->perigeeAtVertex(*elTrack, pVtx.position());
-			if (perigeeAtPV == 0) 
-			{
-				msg(MSG::DEBUG)<<"perigee at PV is null"<<endreq;
-				continue;
-			}
-			double d0 = perigeeAtPV->parameters()[Trk::d0];
-			
-			if (fabs(d0)< m_electronD0Cut ) elGoodD0=false;
-			break;
-		}
-		if (elGoodD0) 
-		{ 
-			m_nPassElectronCut++;
-			setFilterPassed(true);
-			return sc;
-		}
-	}
-	setFilterPassed(false);
-	return sc;  
-}
-
-StatusCode DVFilterAlgEgamma::finalize()
-{
-
-	StatusCode sc(StatusCode::SUCCESS);
-
-	if (msgLvl(MSG::INFO)) 
-	{
-		msg(MSG::INFO) << "Finalize " << name() << endreq;
-		msg(MSG::INFO) <<"d0 cut = " << m_electronD0Cut << ", pT cut = " << m_electronPtCut << ", Eta cut = " << m_electronEtaCut << endreq;
-		msg(MSG::INFO) <<"nProcessed "<<m_nProcessed<<endreq;
-		msg(MSG::INFO) <<"nPassElectronCut "<<m_nPassElectronCut<<endreq;
-		msg(MSG::INFO) <<"Efficiency =  "<<100.0*(float)m_nPassElectronCut/ (float)m_nProcessed<<"%"<<endreq;
-	}
-	return sc;  
-}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMeffFilterTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMeffFilterTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c0cad886b89f11cbf028606d7a7f576fee7019f3
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMeffFilterTool.cxx
@@ -0,0 +1,106 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/////////////////////////////////////////////////////////////////
+// DVMissingETFilterTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#include "LongLivedParticleDPDMaker/DVMeffFilterTool.h"
+#include <vector>
+#include <string>
+#include "xAODMissingET/MissingETContainer.h"
+#include "xAODJet/JetContainer.h"
+
+// Constructor
+DerivationFramework::DVMeffFilterTool::DVMeffFilterTool( const std::string& t,
+                                                 const std::string& n,
+                                                 const IInterface* p ) : 
+  AthAlgTool(t,n,p),
+  m_ntot(0),
+  m_npass(0),
+  m_metSGKey("MET_Calo"),
+  m_jetSGKey("AntiKt4LCTopoJets"),
+  m_MeffCut(1000000.),
+  m_METoverMeffCut(0.3),
+  m_jetPtCut(40000.),
+  m_jetEtaCut(2.7),
+  m_METCut(80000.)
+  {
+    declareInterface<DerivationFramework::ISkimmingTool>(this);
+    declareProperty("METContainerKey", m_metSGKey);
+    declareProperty("MeffCut", m_MeffCut);
+    declareProperty("jetPtCut", m_jetPtCut);
+    declareProperty("jetEtaCut", m_jetEtaCut);
+    declareProperty("METoverMeffCut", m_METoverMeffCut);
+    declareProperty("METCut",m_METCut);
+    declareProperty("JetContainerKey", m_jetSGKey);
+  }
+  
+// Destructor
+DerivationFramework::DVMeffFilterTool::~DVMeffFilterTool() {
+}  
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::DVMeffFilterTool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::DVMeffFilterTool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
+     return StatusCode::SUCCESS;
+}
+
+// The filter itself
+bool DerivationFramework::DVMeffFilterTool::eventPassesFilter() const
+{
+     ++m_ntot;
+
+     double Meff=0.;
+     double MET=0.;
+     double totalJetPT = 0.;
+     bool passesEvent=false;
+     
+     const xAOD::MissingETContainer* metContainer(0);
+     StatusCode sc=evtStore()->retrieve(metContainer,m_metSGKey);
+     if( sc.isFailure()  ||  !metContainer ) {
+       msg(MSG::WARNING) << "No MET container found, will skip this event" << endreq;
+       return StatusCode::FAILURE;
+     } 
+     ///  msg(MSG::INFO)<<"size of  MET container is "<<metContainer->size()<<endreq;
+
+     if (metContainer->size() ==1) {
+       MET = metContainer->at(0)->met();
+     }
+  
+     const xAOD::JetContainer* jetContainer(0);
+     sc=evtStore()->retrieve(jetContainer,m_jetSGKey);
+     if( sc.isFailure()  ||  !jetContainer ) {
+       msg(MSG::WARNING) << "No jet container found, will skip this event" << endreq;
+       return StatusCode::FAILURE;
+     }
+     for (unsigned int i=0; i< jetContainer->size(); ++i) { 
+       const xAOD::Jet* jet = jetContainer->at(i);
+       if (( jet->pt() < m_jetPtCut) || (fabs(jet->eta())>m_jetEtaCut))  continue;
+       totalJetPT += jet->pt();
+     }
+     
+     Meff += MET;
+     Meff += totalJetPT;
+     ///     msg(MSG::DEBUG)<<" MET "<< MET<< " totalJetPT "<<totalJetPT<<" Meff "<<Meff<<" ratio "<< MET/Meff <<endreq;
+     
+     if ((Meff > m_MeffCut) || ((MET > m_METCut) && (MET/Meff > m_METoverMeffCut )))  {   //// NOTE: OR of these two requirements
+       passesEvent=true;
+       ++m_npass;
+     }
+
+
+
+     return passesEvent;
+
+
+}  
+  
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMissingETFilterTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMissingETFilterTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..9b27c0922e0e52a167554940bce08c868240526b
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVMissingETFilterTool.cxx
@@ -0,0 +1,97 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/////////////////////////////////////////////////////////////////
+// DVMissingETFilterTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#include "LongLivedParticleDPDMaker/DVMissingETFilterTool.h"
+#include <vector>
+#include <string>
+#include "xAODMissingET/MissingETContainer.h"
+#include "xAODJet/JetContainer.h"
+
+// Constructor
+DerivationFramework::DVMissingETFilterTool::DVMissingETFilterTool( const std::string& t,
+                                                 const std::string& n,
+                                                 const IInterface* p ) : 
+  AthAlgTool(t,n,p),
+  m_ntot(0),
+  m_npass(0),
+  m_metSGKey("MET_Calo"),
+  m_metCut(50000.0),
+  m_applyDeltaPhiCut(false),
+  m_deltaPhiCut(2.),
+  m_jetSGKey("AntiKt4LCTopoJets")
+  {
+    declareInterface<DerivationFramework::ISkimmingTool>(this);
+    declareProperty("METContainerKey", m_metSGKey);
+    declareProperty("METCut", m_metCut);
+    declareProperty("applyDeltaPhiCut", m_applyDeltaPhiCut);
+    declareProperty("DeltaPhiCut", m_deltaPhiCut);
+    declareProperty("JetContainerKey", m_jetSGKey);
+  }
+  
+// Destructor
+DerivationFramework::DVMissingETFilterTool::~DVMissingETFilterTool() {
+}  
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::DVMissingETFilterTool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::DVMissingETFilterTool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
+     return StatusCode::SUCCESS;
+}
+
+// The filter itself
+bool DerivationFramework::DVMissingETFilterTool::eventPassesFilter() const
+{
+     ++m_ntot;
+
+     const xAOD::MissingETContainer* metContainer(0);
+     StatusCode sc=evtStore()->retrieve(metContainer,m_metSGKey);
+     if( sc.isFailure()  ||  !metContainer ) {
+       msg(MSG::WARNING) << "No MET container found, will skip this event" << endreq;
+       return StatusCode::FAILURE;
+     } 
+     ///  msg(MSG::INFO)<<"size of  MET container is "<<metContainer->size()<<endreq;
+
+     if (metContainer->size() ==1) {
+	 
+       double MET = metContainer->at(0)->met();
+       bool passesEvent= (MET > m_metCut) ;
+
+
+       
+       if (m_applyDeltaPhiCut) {
+	 double phiMET=metContainer->at(0)->phi();
+	 const xAOD::JetContainer* jetContainer(0);
+	 StatusCode sc=evtStore()->retrieve(jetContainer,m_jetSGKey);
+	 if( sc.isFailure()  ||  !jetContainer ) {
+	   msg(MSG::WARNING) << "No jet container found, will skip this event" << endreq;
+	   return StatusCode::FAILURE;
+	 }
+	 if (jetContainer->size() > 0) {
+	   double phiJet = jetContainer->at(0)->phi();
+	   double deltaPhi = fabs(phiMET-phiJet);
+	   if (deltaPhi > M_PI) deltaPhi = 2.0*M_PI - deltaPhi;
+	   passesEvent = passesEvent && (deltaPhi < m_deltaPhiCut);
+	 }
+       }
+       
+       if (passesEvent) {
+	 ++m_npass;
+       }
+       return passesEvent;
+     }
+     return false;
+
+}  
+  
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVTracklessJetFilterTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVTracklessJetFilterTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..6718895b6ecf3f32db9e96dd75d9d49d2f5fcea5
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/DVTracklessJetFilterTool.cxx
@@ -0,0 +1,89 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/////////////////////////////////////////////////////////////////
+// DVTracklessJetFilterTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#include "LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h"
+#include <vector>
+#include <string>
+#include "xAODJet/JetContainer.h"
+
+
+// Constructor
+DerivationFramework::DVTracklessJetFilterTool::DVTracklessJetFilterTool( const std::string& t,
+                                                 const std::string& n,
+                                                 const IInterface* p ) : 
+  AthAlgTool(t,n,p),
+  m_ntot(0),
+  m_npass(0),
+  m_jetSGKey("AntiKt4EMTopoJets"),
+  m_ptCut(50000.0)
+  {
+    declareInterface<DerivationFramework::ISkimmingTool>(this);
+    declareProperty("JetContainerKey", m_jetSGKey);
+    declareProperty("JetPtCut", m_ptCut);	
+    declareProperty("JetEtaCut", m_etaCut);	
+    declareProperty("sumPtTrkCut", m_sumPtTrkCut);	
+    declareProperty("nJetsRequired", m_nJetsRequired=1);
+  }
+  
+// Destructor
+DerivationFramework::DVTracklessJetFilterTool::~DVTracklessJetFilterTool() {
+}  
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::DVTracklessJetFilterTool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     
+     return StatusCode::SUCCESS;
+     
+}
+StatusCode DerivationFramework::DVTracklessJetFilterTool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
+     return StatusCode::SUCCESS;
+}
+
+// The filter itself
+bool DerivationFramework::DVTracklessJetFilterTool::eventPassesFilter() const
+{
+  ++m_ntot;
+  bool passesEvent=false;
+
+  int nJetsPassed=0;
+  
+  const xAOD::JetContainer* jetContainer(0);
+  StatusCode sc=evtStore()->retrieve(jetContainer,m_jetSGKey);
+  if( sc.isFailure()  ||  !jetContainer ) {
+    msg(MSG::WARNING) << "No Jet container found, will skip this event" << endreq;
+    return StatusCode::FAILURE;
+  } 
+  msg(MSG::DEBUG)<<"size of  Jet container is "<<jetContainer->size()<<endreq;
+  
+  for (unsigned int i=0; i< jetContainer->size(); ++i) { 
+    const xAOD::Jet* jet = jetContainer->at(i);
+    if (( jet->pt() < m_ptCut) || (fabs(jet->eta())>m_etaCut))  continue;
+    
+    std::vector<float> sumPtTrkvec;
+    jet->getAttribute(xAOD::JetAttribute::SumPtTrkPt500, sumPtTrkvec);
+    if (sumPtTrkvec.size() > 0) {
+      msg(MSG::DEBUG)<<"sumptTrk is "<<sumPtTrkvec.at(0)<<endreq;
+      if (sumPtTrkvec.at(0) < m_sumPtTrkCut) {
+	nJetsPassed+=1;
+      }    
+    }
+  }
+  if (nJetsPassed >=m_nJetsRequired) {
+    ++m_npass;
+    passesEvent=true;
+  }
+  
+  return passesEvent;
+  
+}  
+  
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HIPsFilterAlg.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HIPsFilterAlg.cxx
deleted file mode 100644
index acfb4925f6aab1093e0a6596daed3cd3a9e446e0..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HIPsFilterAlg.cxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LongLivedParticleDPDMaker/HIPsFilterAlg.h"
-
-#include "InDetPrepRawData/TRT_DriftCircle.h"
-#include "InDetPrepRawData/TRT_DriftCircleContainer.h"
-#include "InDetReadoutGeometry/TRT_BaseElement.h"
-#include "TRT_DriftFunctionTool/TRT_DriftFunctionTool.h"
-
-#include "CaloEvent/CaloClusterContainer.h"
-#include "Identifier/Identifier.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventType.h"
-#include "EventInfo/TriggerInfo.h"
-
-const double PI = 3.1415926535;
-const double TWOPI = 2.0*PI;
-
-inline double delta_phi(double phi1, double phi2)
-{
-  float PHI=fabs(phi1-phi2);
-  return (PHI<=PI)? PHI : TWOPI-PHI;
-}
-
-/// Standard Service Constructor
-HIPsFilterAlg::HIPsFilterAlg(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthFilterAlgorithm(name, pSvcLocator), 
-    m_nProcessed(0),
-    m_nEventsPassE(0),
-    m_nEventsPassHTTRTnumber(0),
-    m_nEventsPassHTTRTfraction(0),
-    m_nEventsPassAll(0)
-  
-{
-
-  declareProperty("cutMinE", m_cutMinE = 0.0);
-  declareProperty("cutEtaMax", m_cutEtaMax = 3.0);
-  declareProperty("cutMaxDeltaPhi", m_cutMaxDeltaPhi = 0.5);
-  declareProperty("cutMinTRTHTHits", m_cutMinTRTHTHits = 100);
-  declareProperty("cutMinTRTHTFraction", m_cutMinTRTHTFraction = 0.1);
-  declareProperty("caloCluster", m_caloCluster = "CaloCalTopoCluster"); 
-  declareProperty("passAll", m_passAll = false); 
-  
-}
-
-/// Destructor
-HIPsFilterAlg::~HIPsFilterAlg() {}
-
-/// Gaudi Service Interface method implementations:
-StatusCode HIPsFilterAlg::initialize()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-
-  msg(MSG::INFO) << "==> initialize ..." << name() << endreq;
-  msg(MSG::INFO)<< "******* HIPsFilterAlg"<< name() <<" Configuration **********" << endreq;  
-  msg(MSG::INFO)<<"caloCluster       "<<      m_caloCluster     <<endreq;
-  msg(MSG::INFO)<<"cutMinE          "<<         m_cutMinE        <<endreq;
-  msg(MSG::INFO)<<"cutEtaMax           "<<          m_cutEtaMax         <<endreq;
-  msg(MSG::INFO)<<"cutMaxDeltaPhi         "<<        m_cutMaxDeltaPhi       <<endreq;
-  msg(MSG::INFO)<<"cutMinTRTHTHits         "<<        m_cutMinTRTHTHits       <<endreq;
-  msg(MSG::INFO)<<"cutMinTRTHTFraction         "<<        m_cutMinTRTHTFraction       <<endreq;
-  msg(MSG::INFO)<<"passAll             "<<            m_passAll           <<endreq;
-
-  return sc;
-}
-
-StatusCode HIPsFilterAlg::execute()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-
-  m_nProcessed += 1;
-  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "==> execute " << name() << " on " << m_nProcessed << " event..." << endreq;
-
-  // Reject al events from runs for which the hiptrt trigger was running online
-  const EventInfo* eventInfo;
-  sc = evtStore()->retrieve(eventInfo);
-  if ( sc.isFailure() ){
-    msg(MSG::ERROR) << "Could not retrieve event info" << endreq;
-    return sc;
-  }
-
-  //const EventID* myEventID=eventInfo->event_ID();  
-  //if(myEventID->run_number() < 211522){
-    
-    //If passAll is selected, accept all events
-    if(m_passAll){
-      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << name() << " event passed because passAll is true" << endreq;
-      setFilterPassed(true);
-      return sc;
-    }
-    
-    //  msg(MSG::INFO) << "==> calorimeter store gate" << endreq;
-    const CaloClusterContainer* caloclust = 0;
-    sc = evtStore()->retrieve(caloclust, m_caloCluster);
-    if(sc.isFailure() || !caloclust){
-      msg(MSG::WARNING) << m_caloCluster <<" container not found in StoreGate " << endreq;
-      setFilterPassed(false);
-      return StatusCode::SUCCESS;
-    }
-    
-    std::vector<std::pair<double, double> > calophieta;
-    
-    /// iterators over the container 
-    CaloClusterContainer::const_iterator emtopoItr  = caloclust->begin();
-    CaloClusterContainer::const_iterator emtopoItrE = caloclust->end();
-    
-    //  msg(MSG::INFO) << "==> calorimeter loop" << endreq;
-    
-    /// loop over the ESD electron container
-    /// and fill the egamma pt, eta and E/P histograms
-    for (; emtopoItr != emtopoItrE; ++emtopoItr) {
-      
-      double calE = (*emtopoItr)->e();
-      double calEta = (*emtopoItr)->eta();
-      double calPhi = (*emtopoItr)->phi();
-      
-      if (calE > m_cutMinE && fabs(calEta) < m_cutEtaMax) {
-	msg(MSG::DEBUG) << "Energy=" << (*emtopoItr)->e()
-			<< "  eta=" << (*emtopoItr)->eta()
-			<< "  phi=" << (*emtopoItr)->phi()
-			<< "  m=" << (*emtopoItr)->m()
-			<< endreq;
-	//      calophi.push_back(calPhi);
-	//      calomap.insert(std::make_pair(calE,std::make_pair(calPhi,calEta)));
-	calophieta.push_back(std::make_pair(calPhi,calEta));
-      }	
-    }
-    
-    if (!calophieta.empty()) m_nEventsPassE++;
-    
-    const TRT_ID *m_trtID = 0;
-    
-    sc = detStore()->retrieve(m_trtID, "TRT_ID");
-    
-    if (sc.isFailure() || !m_trtID) {
-      msg(MSG::WARNING) << "Could not get TRT ID helper" << endreq;
-      return StatusCode::SUCCESS;
-    }
-    
-    const InDet::TRT_DriftCircleContainer* driftCircleContainer = 0;  
-    
-    sc = evtStore()->retrieve( driftCircleContainer, "TRT_DriftCircles");
-    
-    if (sc.isFailure() || !driftCircleContainer) {
-      msg(MSG::DEBUG) << "No TRT RDO in StoreGate " << endreq;
-    } else {
-      msg(MSG::DEBUG) << "found TRT driftcircles in StoreGate " << endreq; 
-    }
-    
-    std::map<std::pair<double, double>, int> calotrt;
-    std::map<std::pair<double, double>, int> calohttrt;
-    
-    for (std::vector<std::pair<double, double> >::iterator it1 = calophieta.begin(); it1 != calophieta.end(); it1++){
-      calotrt[*it1] = 0;
-      calohttrt[*it1] = 0;
-    }
-    
-    InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItr  = driftCircleContainer->begin();
-    InDet::TRT_DriftCircleContainer::const_iterator trtdriftContainerItrE = driftCircleContainer->end();
-    
-    for (; trtdriftContainerItr != trtdriftContainerItrE; ++trtdriftContainerItr) {
-      
-      InDet::TRT_DriftCircleCollection::const_iterator trtItr = (*trtdriftContainerItr)->begin();
-      InDet::TRT_DriftCircleCollection::const_iterator trtEnd = (*trtdriftContainerItr)->end();
-      
-      for(; trtItr!=trtEnd; trtItr++){
-	
-	// find out which detector element the hit belongs to
-	const InDetDD::TRT_BaseElement *det = (*trtItr)->detectorElement();
-	
-	Identifier ID = (*trtItr)->identify();
-	
-	double streta = det->strawCenter(m_trtID->straw(ID)).eta();
-	double strphi = det->strawCenter(m_trtID->straw(ID)).phi();
-	
-	for (std::vector<std::pair<double, double> >::iterator it1 = calophieta.begin(); it1 != calophieta.end(); it1++){
-	  if (delta_phi(it1->first, strphi) < m_cutMaxDeltaPhi) {
-	    //	  if (fabs(it1->second) < 0.3 || it1->second * streta > 0.0){    // match eta requirements
-	    if ((fabs(it1->second) < 0.1 && abs(m_trtID->barrel_ec(ID)) == 1) || it1->second * streta > 0.0){    // match eta requirements
-	      calotrt[*it1]++;
-	      if ((*trtItr)->highLevel()) calohttrt[*it1]++;
-	      
-	      
-	      if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)
-		<< "timeOverThreshold=" << (*trtItr)->timeOverThreshold()
-		<< " highLevel=" << (*trtItr)->highLevel()
-		<< " rawDriftTime=" << (*trtItr)->rawDriftTime()
-		<< " barrel_ec=" << m_trtID->barrel_ec(ID)
-		<< " phi_module=" << m_trtID->phi_module(ID)
-		<< " layer_or_wheel=" << m_trtID->layer_or_wheel(ID)
-		<< " straw_layer=" << m_trtID->straw_layer(ID)
-		<< " straw=" << m_trtID->straw(ID)
-		<< " scR=" << det->strawCenter(m_trtID->straw(ID)).perp()
-		<< " scPhi=" << det->strawCenter(m_trtID->straw(ID)).phi()
-		<< endreq;		    
-	      
-	      
-	    }
-	  }
-	}
-      }
-    }
-    
-    bool bingo = false;
-    bool countedHTTRTnumber = false;
-    
-    for (std::vector<std::pair<double, double> >::iterator it1 = calophieta.begin(); it1 != calophieta.end(); it1++){
-      double ratioHT = (calotrt[*it1] > 0) ?  (double)calohttrt[*it1]/(double)calotrt[*it1] : 0.0;
-      if ( calohttrt[*it1] >= m_cutMinTRTHTHits) {      
-	if (!countedHTTRTnumber) {
-	  m_nEventsPassHTTRTnumber++;
-	  countedHTTRTnumber = true;
-	}
-	if (ratioHT >= m_cutMinTRTHTFraction) {
-	  m_nEventsPassHTTRTfraction++;
-	  bingo = true;
-	  break;
-	}
-      }
-    }
-    
-    if (bingo) {
-      setFilterPassed(true);
-      m_nEventsPassAll++;
-    }
-    else setFilterPassed(false);
-    
-    //  } else setFilterPassed(false); ////// Closing if(runMunber<XXXXXX)
-  
-  
-  return sc;  
-}
-
-StatusCode HIPsFilterAlg::finalize()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-  
-  // Calculate the efficiencies and their errors
-  
-  // Efficiencies
-  double effiEMClusters = m_nProcessed > 0 ? m_nEventsPassE / (1.0*m_nProcessed) : 0.0;
-  double effiHTTRTnumber = m_nEventsPassE > 0 ? m_nEventsPassHTTRTnumber / (1.0*m_nEventsPassE) : 0.0;
-  double effiHTTRTfraction = m_nEventsPassHTTRTnumber > 0 ? m_nEventsPassHTTRTfraction / (1.0*m_nEventsPassHTTRTnumber) : 0.0;
-  double effiPassedAll  = m_nProcessed > 0 ? m_nEventsPassAll / (1.0*m_nProcessed) : 0.0;
-  
-  // Error on efficiencies
-  
-  double rootn = m_nProcessed > 0 ? sqrt((double)m_nProcessed) : 0.0;
-  double rootHTnumber = m_nEventsPassE > 0 ? sqrt((double)m_nEventsPassE) : 0.0;
-  double rootHTfraction = m_nEventsPassHTTRTnumber > 0 ? sqrt((double)m_nEventsPassHTTRTnumber) : 0.0;
-  
-  double effiErrEMClusters = (rootn > 0 && effiEMClusters >= 0.0 && effiEMClusters <= 1.0)? sqrt(effiEMClusters*(1.0-effiEMClusters)) / rootn : 0.0;
-  double effiErrHTTRTnumber = (rootHTnumber > 0 && effiHTTRTnumber >= 0.0 && effiHTTRTnumber <= 1.0)? sqrt(effiHTTRTnumber*(1.0-effiHTTRTnumber)) / rootHTnumber : 0.0;
-  double effiErrHTTRTfraction = (rootHTfraction > 0 && effiHTTRTfraction >= 0.0 && effiHTTRTfraction <= 1.0)? sqrt(effiHTTRTfraction*(1.0-effiHTTRTfraction)) / rootHTfraction : 0.0;
-  double effiErrPassedAll = (rootn > 0 && effiPassedAll >= 0.0 && effiPassedAll <= 1.0)? sqrt(effiPassedAll*(1.0-effiPassedAll)) / rootn : 0.0;
-  
-  effiEMClusters *= 100.0;
-  effiHTTRTnumber *= 100.0;
-  effiHTTRTfraction *= 100.0;
-  effiPassedAll *= 100.0;
-  effiErrEMClusters *= 100.0;
-  effiErrHTTRTnumber *= 100.0;
-  effiErrHTTRTfraction *= 100.0;
-  effiErrPassedAll *= 100.0;
-  
-  if (msgLvl(MSG::INFO)) {
-    msg(MSG::INFO) << "==> finalize " << name() << endreq;
-    msg(MSG::INFO) << "***************************************************************" << endreq;
-    msg(MSG::INFO) << "Cut-flow table of " << name() << " skimming algorithm:" << endreq;
-    msg(MSG::INFO) << "-------------" << endreq;
-    msg(MSG::INFO) << " Number of processed events: " << m_nProcessed << endreq;
-    msg(MSG::INFO) << " Events passed EM cluster cuts:  " << m_nEventsPassE << " and resulting efficiency = (" << effiEMClusters << "+/-" << effiErrEMClusters << ")" << endreq;
-    msg(MSG::INFO) << " Events passed HTTRT number cut:  " << m_nEventsPassHTTRTnumber << " and efficiency wrt EM = (" << effiHTTRTnumber << "+/-" << effiErrHTTRTnumber << ")" << endreq;
-    msg(MSG::INFO) << " Events passed HTTRT fraction cut:  " << m_nEventsPassHTTRTfraction << " and efficiency wrt HT number = (" << effiHTTRTfraction << "+/-" << effiErrHTTRTfraction << ")" << endreq;
-    msg(MSG::INFO) << " Events passed all cuts:  " << m_nEventsPassAll << " and resulting efficiency = (" << effiPassedAll << "+/-" << effiErrPassedAll << ")" << endreq;
-    msg(MSG::INFO) << "***************************************************************" << endreq;
-  }
-  return sc;  
-}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HnlSkimmingTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HnlSkimmingTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..decab84511c81591b02a0581fe1c5971cbc86d21
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/HnlSkimmingTool.cxx
@@ -0,0 +1,162 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/////////////////////////////////////////////////////////////////
+// HnlSkimmingTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Author: Avishek Chatterjee (avishek.chatterjee@cern.ch)
+// Heavily borrowed from DerivationFramework/DerivationFrameworkExamples/src/SkimmingToolExample.cxx 
+// and DerivationFramework/DerivationFrameworkMuons/src/dimuonTaggingTool.cxx
+
+#include "LongLivedParticleDPDMaker/HnlSkimmingTool.h"
+#include "AthenaKernel/errorcheck.h"
+#include <vector>
+#include <string>
+
+#include "CLHEP/Units/SystemOfUnits.h"
+
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include "xAODTracking/TrackParticleContainer.h"
+
+#include "TrigDecisionTool/ChainGroup.h"
+#include "TrigDecisionTool/FeatureContainer.h"
+#include "TrigDecisionTool/Feature.h"
+
+// Constructor
+DerivationFramework::HnlSkimmingTool::HnlSkimmingTool(const std::string& t,
+						      const std::string& n,
+						      const IInterface* p):
+  AthAlgTool(t, n, p),
+  m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool")
+{
+  declareInterface<DerivationFramework::ISkimmingTool>(this);
+  declareProperty("TrigDecisionTool", m_trigDecisionTool, "Tool to access the trigger decision");
+  declareProperty("Triggers", m_triggers=std::vector< std::string >());
+
+  declareProperty("MuonContainerKey", m_muonSGKey="Muons");
+  declareProperty("Mu1PtMin", m_mu1PtMin=-1);
+  declareProperty("Mu1AbsEtaMax", m_mu1AbsEtaMax=2.5);
+  declareProperty("Mu1Types", m_mu1Types=std::vector< int >());
+  declareProperty("Mu1IsoType", m_mu1IsoType=14); //ptcone30
+  declareProperty("Mu1IsoCutIsRel", m_mu1IsoCutIsRel=1); //Cut is on relative isolation
+  declareProperty("Mu1IsoCut", m_mu1IsoCut=0.05);
+
+  declareProperty("Mu2PtMin", m_mu2PtMin=-1);
+  declareProperty("Mu2AbsEtaMax", m_mu2AbsEtaMax=2.5);
+  declareProperty("Mu2Types", m_mu2Types=std::vector< int >());
+  declareProperty("Mu2IsoType", m_mu2IsoType=14); //ptcone30
+  declareProperty("Mu2IsoCutIsRel", m_mu2IsoCutIsRel=1); //Cut is on relative isolation
+  declareProperty("Mu2IsoCut", m_mu2IsoCut=1.);
+  declareProperty("Mu2d0Min", m_mu2d0Min=1.);
+}
+  
+// Destructor
+DerivationFramework::HnlSkimmingTool::~HnlSkimmingTool() {
+}  
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::HnlSkimmingTool::initialize()
+{
+  ATH_MSG_VERBOSE("HnlSkimmingTool initialize() ...");
+
+  if(m_trigDecisionTool.retrieve().isFailure()) {
+    ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_INFO("Retrieved tool: " << m_trigDecisionTool);
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DerivationFramework::HnlSkimmingTool::finalize()
+{
+  ATH_MSG_VERBOSE("HnlSkimmingTool finalize() ...");
+  return StatusCode::SUCCESS;
+}
+
+// The filter itself
+bool DerivationFramework::HnlSkimmingTool::eventPassesFilter() const
+{
+  bool acceptEvent(false);
+
+  bool passedTrigger(true);
+  if(m_triggers.size()>0){
+    passedTrigger = false;
+    for(unsigned int i=0; i<m_triggers.size(); i++){
+      int decision = m_trigDecisionTool->isPassed(m_triggers.at(i));
+      if(decision == 1){
+	passedTrigger = true;
+	break;
+      }
+    }
+  }
+
+  if(!passedTrigger) return acceptEvent;
+ 
+  // Retrieve muon container	
+  const xAOD::MuonContainer* muons(0);
+  StatusCode sc = evtStore()->retrieve(muons,m_muonSGKey);	
+  if (sc.isFailure()) {
+    ATH_MSG_FATAL("No muon collection with name " << m_muonSGKey << " found in StoreGate!");
+    return StatusCode::FAILURE;
+  }
+  
+  bool muon1passed(false);
+  xAOD::MuonContainer::const_iterator mu_itr1;
+  for(mu_itr1=muons->begin(); mu_itr1!=muons->end(); mu_itr1++) {
+    bool passTypeCut = true;
+    if(m_mu1Types.size()>0){
+      passTypeCut = false;
+      int type = (*mu_itr1)->muonType();
+      for(unsigned int i=0; i<m_mu1Types.size(); ++i) {if(m_mu1Types[i]==type) {passTypeCut=true; break;}}
+    }
+    bool isIso=false; float isoValue = 0.;
+    const xAOD::Iso::IsolationType isoType = static_cast<xAOD::Iso::IsolationType>(m_mu1IsoType);
+    if(m_mu1IsoCutIsRel==0){
+      if((*mu_itr1)->isolation(isoValue, isoType) && isoValue < m_mu1IsoCut) isIso = true;
+    }else{
+      if((*mu_itr1)->isolation(isoValue, isoType) && isoValue/(*mu_itr1)->pt() < m_mu1IsoCut) isIso = true;
+    }
+    if((*mu_itr1)->pt()>m_mu1PtMin && fabs((*mu_itr1)->eta())<m_mu1AbsEtaMax && passTypeCut && isIso){
+      muon1passed = true;
+      break;
+    }
+  }
+  
+  if(!muon1passed) return acceptEvent;
+
+  bool muon2passed(false);
+  xAOD::MuonContainer::const_iterator mu_itr2;
+  for(mu_itr2=muons->begin(); mu_itr2!=muons->end(); mu_itr2++) {
+    if(mu_itr2==mu_itr1) continue;
+    bool passTypeCut = true;
+    if(m_mu2Types.size()>0){
+      passTypeCut = false;
+      int type = (*mu_itr2)->muonType();
+      for(unsigned int i=0; i<m_mu2Types.size(); ++i) {if(m_mu2Types[i]==type) {passTypeCut=true; break;}}
+    }
+    bool isIso=false; float isoValue = 0.;
+    const xAOD::Iso::IsolationType isoType = static_cast<xAOD::Iso::IsolationType>(m_mu2IsoType);
+    if(m_mu2IsoCutIsRel==0){
+      if((*mu_itr2)->isolation(isoValue, isoType) && isoValue < m_mu2IsoCut) isIso = true;
+    }else{
+      if((*mu_itr2)->isolation(isoValue, isoType) && isoValue/(*mu_itr2)->pt() < m_mu2IsoCut) isIso = true;
+    }
+    bool passD0cut = true;
+    int type = (*mu_itr2)->muonType();
+    if(type==0){ //d0 cut is for combined muons only
+      passD0cut = false;
+      if(fabs((*mu_itr2)->primaryTrackParticle()->d0())>m_mu2d0Min) passD0cut = true;
+    }
+    if((*mu_itr2)->pt()>m_mu2PtMin && fabs((*mu_itr2)->eta())<m_mu2AbsEtaMax && passTypeCut && isIso && passD0cut){
+      muon2passed = true;
+      break;
+    }
+  }
+  
+  if(muon2passed) acceptEvent = true;
+  
+  return acceptEvent; 
+}  
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..33ca451e54e79335f198053ae949614827a76724
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkSingleJetMetFilterTool.cxx
@@ -0,0 +1,178 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LongLivedParticleDPDMaker/KinkTrkSingleJetMetFilterTool.h"
+#include "xAODJet/JetContainer.h"
+#include "xAODMissingET/MissingETContainer.h"
+#include "xAODMuon/MuonContainer.h"
+#include "xAODEgamma/ElectronContainer.h"
+#include "FourMomUtils/P4Helpers.h"
+#include <vector>
+
+/// Service Constructor
+DerivationFramework::KinkTrkSingleJetMetFilterTool::KinkTrkSingleJetMetFilterTool( const std::string& t,
+                                                           const std::string& n,
+                                                           const IInterface* p ) : 
+  AthAlgTool(t,n,p),
+  m_ntot(0),
+  m_npass(0),
+  m_passAll(false),
+  m_LeptonVeto(false),
+  m_jetSGKey("AntiKt4LCTopoJets"),
+  m_metSGKey("MET_RefFinal"),
+  m_metTerm("Final"),
+  m_muonSelectionTool("CP::MuonSelectionTool/MuonSelectionTool"),
+  m_muonSGKey("Muons"),
+  m_muonIDKey("Medium"),
+  m_electronSGKey("ElectronCollection"),
+  m_electronIDKey("Tight"),
+  m_metCut(-1),
+  m_jetPtCuts(std::vector<float>()),
+  m_jetEtaMax(3.2),
+  m_jetMetDphiMin(-1),
+  m_leptonPtCut(30.0),
+  m_leptonEtaMax(2.5)
+  {
+    declareInterface<DerivationFramework::ISkimmingTool>(this);
+    declareProperty("passAll", m_passAll); 
+    declareProperty("LeptonVeto", m_LeptonVeto);
+    declareProperty("JetContainerKey", m_jetSGKey);
+    declareProperty("MetContainerKey", m_metSGKey);
+    declareProperty("MetTerm", m_metTerm);
+    declareProperty("MuonContainerKey", m_muonSGKey);
+    declareProperty("MuonIDKey", m_muonIDKey);
+    declareProperty("ElectronContainerKey", m_electronSGKey);
+    declareProperty("ElectronIDKey", m_electronIDKey);
+    declareProperty("MetCut", m_metCut);
+    declareProperty("JetPtCuts", m_jetPtCuts);
+    declareProperty("JetEtaMax", m_jetEtaMax);
+    declareProperty("JetMetDphiMin", m_jetMetDphiMin);
+    declareProperty("LeptonPtCut", m_leptonPtCut);
+    declareProperty("LeptonEtaMax", m_leptonEtaMax);
+  }
+ 
+
+/// Destructor
+DerivationFramework::KinkTrkSingleJetMetFilterTool::~KinkTrkSingleJetMetFilterTool() {}
+
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::KinkTrkSingleJetMetFilterTool::initialize()
+{
+  ATH_MSG_VERBOSE("initialize() ...");
+
+  CHECK(m_muonSelectionTool.retrieve());
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode DerivationFramework::KinkTrkSingleJetMetFilterTool::finalize()
+{
+  ATH_MSG_VERBOSE("finalize() ...");
+  ATH_MSG_INFO("Processed " << m_ntot << " events, " << m_npass << " events passed filter ");
+  ATH_MSG_INFO("Efficiency = "<< 100.0*(float)m_npass/(float)m_ntot <<" % ");
+  return StatusCode::SUCCESS;
+}
+
+
+// The filter itself
+bool DerivationFramework::KinkTrkSingleJetMetFilterTool::eventPassesFilter() const
+{
+  ++m_ntot;
+  bool acceptEvent(false);
+
+  // If passAll is selected, accept all events
+  if(m_passAll){
+      ATH_MSG_DEBUG("Event passed because passAll is true.");
+      return acceptEvent; 
+  }
+
+
+  // Retrieve MET container 
+  const xAOD::MissingETContainer* metContainer(0);
+  const xAOD::MissingET* met(0);
+  ATH_CHECK( evtStore()->retrieve(metContainer, m_metSGKey) );	
+  met = (*metContainer)[m_metTerm];
+  if (!met) {
+    ATH_MSG_ERROR("Cannot retrieve MissingET term " << m_metTerm << " in " << m_metSGKey);
+    return acceptEvent; 
+  }
+  //ATH_MSG_DEBUG("MET and phi are " << met->met() << " " << met->phi());
+  if (met->met() < m_metCut) return acceptEvent; 
+
+  // Loop over jets
+  const DataVector<xAOD::Jet>* jetContainer(0);
+  ATH_CHECK( evtStore()->retrieve(jetContainer, m_jetSGKey) );
+  ATH_MSG_DEBUG("retrieved jet collection size "<< jetContainer->size());
+
+  bool passJet1(false);
+  std::vector<const xAOD::Jet*> goodJets;
+  for (const auto jet: *jetContainer) {
+    for (unsigned int i=0; i<m_jetPtCuts.size(); i++) {
+      if (jet->pt() > m_jetPtCuts[i] && fabs(jet->eta()) < m_jetEtaMax) {
+        if (i==0) passJet1 = true; 
+        goodJets.push_back(jet);
+        break;
+      }
+    }
+  }
+
+  if (!passJet1) return acceptEvent;
+
+  float minDphi = 9999;
+  for (unsigned int i=0; i<goodJets.size(); i++) {
+    if (i >= m_jetPtCuts.size()) break;
+    if (fabs(P4Helpers::deltaPhi(goodJets.at(i)->phi(), met->phi())) < minDphi) {
+      minDphi = fabs(P4Helpers::deltaPhi(goodJets.at(i)->phi(), met->phi()));
+    }
+  }
+  if (minDphi < m_jetMetDphiMin) return acceptEvent; 
+  
+  if (m_LeptonVeto) {
+    // Retrieve muon container	
+    const xAOD::MuonContainer* muons(0);
+    ATH_CHECK( evtStore()->retrieve(muons, m_muonSGKey) );	
+    int qflag(0);
+    if (m_muonIDKey == "VeryLoose") {
+      qflag = xAOD::Muon::VeryLoose;
+    } else if (m_muonIDKey == "Loose") {
+      qflag = xAOD::Muon::Loose;
+    } else if (m_muonIDKey == "Medium") {
+      qflag = xAOD::Muon::Medium;
+    } else if (m_muonIDKey == "Tight") {
+      qflag = xAOD::Muon::Tight;
+    } else {
+      ATH_MSG_WARNING("Cannot find the muon quality flag " << m_muonIDKey << ". Use Medium instead.");
+      qflag = xAOD::Muon::Medium;
+    }
+
+    for (auto muon: *muons) {
+      bool passID(false);
+      if (m_muonSelectionTool->getQuality(*muon) <= qflag) {
+        passID = true;
+      }
+      if (muon->pt() > m_leptonPtCut && fabs(muon->eta()) < m_leptonEtaMax && passID) {
+        return acceptEvent; 
+      }
+    }
+
+    // Retrieve electron container	
+    const xAOD::ElectronContainer* electrons(0);
+    ATH_CHECK(evtStore()->retrieve(electrons, m_electronSGKey));	
+    for (auto ele: *electrons) {
+      bool passID(false);
+      if (!ele->passSelection(passID, m_electronIDKey)) {
+        ATH_MSG_WARNING("Cannot find the electron quality flag " << m_muonIDKey);
+      }
+      if (ele->pt() > m_leptonPtCut && fabs(ele->eta()) < m_leptonEtaMax && passID) {
+        return acceptEvent; 
+      }
+    }
+  }
+
+  acceptEvent = true;
+  ++m_npass;
+  return acceptEvent; 
+
+}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZeeTagTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZeeTagTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..a06f5e2237401812c69daaa86ce9024c4e8f9afa
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZeeTagTool.cxx
@@ -0,0 +1,206 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// KinkTrkZeeTagTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Author: Shimpei Yamamoto (shimpei.yamamoto@cern.ch)
+
+#include "LongLivedParticleDPDMaker/KinkTrkZeeTagTool.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include "xAODMissingET/MissingETContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::KinkTrkZeeTagTool::KinkTrkZeeTagTool(const std::string& t,
+							    const std::string& n,
+							    const IInterface* p):
+  AthAlgTool(t, n, p),
+  m_trigDecisionTool("Trig::TrigDecisionTool"),
+  m_trigMatchTool("TrigMatchTool/TrigMatchTool"),
+  m_trigNames(std::vector<std::string>()),
+  m_trigMatchDeltaR(0.1),
+  m_doTrigMatch(false),
+  m_electronSGKey("ElectronCollection"),
+  m_electronIDKeys(std::vector<std::string>()),
+  m_electronPtCut(0),
+  m_electronEtaMax(9999),
+  m_clusterSGKey("egammaClusters"),
+  m_clusterEtCut(0),
+  m_clusterEtaMax(2.8),
+  m_diEleMassLow(50.),
+  m_diEleMassHigh(-1),
+  m_dPhiMax(10),
+  m_sgKeyPrefix("KinkTrk")
+{
+  declareInterface<DerivationFramework::IAugmentationTool>(this);
+  declareProperty("TriggerDecisionTool", m_trigDecisionTool);
+  declareProperty("TriggerMatchTool", m_trigMatchTool);
+  declareProperty("Triggers", m_trigNames);
+  declareProperty("TriggerMatchDeltaR", m_trigMatchDeltaR);
+  declareProperty("RequireTriggerMatch", m_doTrigMatch);
+  declareProperty("ElectronContainerKey", m_electronSGKey);
+  declareProperty("ElectronIDKeys", m_electronIDKeys),
+  declareProperty("ElectronPtMin", m_electronPtCut);
+  declareProperty("ElectronEtaMax", m_electronEtaMax);
+  declareProperty("ClusterContainerKey", m_clusterSGKey);
+  declareProperty("ClusterEtMin", m_clusterEtCut);
+  declareProperty("ClusterEtaMax", m_clusterEtaMax);
+  declareProperty("DiEleMassLow", m_diEleMassLow);
+  declareProperty("DiEleMassHigh", m_diEleMassHigh);
+  declareProperty("DeltaPhiMax", m_dPhiMax); 
+  declareProperty("StoreGateKeyPrefix", m_sgKeyPrefix);
+}
+  
+
+// Destructor
+DerivationFramework::KinkTrkZeeTagTool::~KinkTrkZeeTagTool() {
+}  
+
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::KinkTrkZeeTagTool::initialize()
+{
+  ATH_MSG_VERBOSE("initialize() ...");
+
+  // trigger decision tool
+  if (m_trigNames.size()>0) {
+    if (m_trigDecisionTool.retrieve().isFailure()) {
+      ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
+      return StatusCode::FAILURE;
+    }
+    ATH_MSG_INFO("TriggerDecisionTool: " << m_trigDecisionTool);
+
+    if (m_trigMatchTool.empty()) {
+      ATH_MSG_FATAL("TrigMatchTool is not specified.");
+      return StatusCode::FAILURE;
+    }
+    CHECK(m_trigMatchTool.retrieve());
+    ATH_MSG_INFO("TrgMatchTool retrived successfully");
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode DerivationFramework::KinkTrkZeeTagTool::finalize()
+{
+  ATH_MSG_VERBOSE("finalize() ...");
+  return StatusCode::SUCCESS;
+}
+
+
+
+// Augmentation
+StatusCode DerivationFramework::KinkTrkZeeTagTool::addBranches() const
+{
+  std::vector<float> *diEleMass = new std::vector<float>();
+  std::vector<float> *probeEleEt = new std::vector<float>();
+
+  const xAOD::ElectronContainer* electrons(0);
+  ATH_CHECK(evtStore()->retrieve(electrons, m_electronSGKey));	
+
+  const xAOD::CaloClusterContainer* clusters(0);
+  ATH_CHECK(evtStore()->retrieve(clusters, m_clusterSGKey));
+
+  for (const auto ele: *electrons) {
+    if (!checkTagElectron(ele)) continue;
+    for (const auto clu: *clusters) {
+      if (!checkCluster(clu)) continue;
+      if (!checkEleClusPair(ele, clu)) continue;
+      diEleMass->push_back((ele->p4()+clu->p4()).M());
+      probeEleEt->push_back(clu->et());
+    }
+  }
+
+  // Writing to SG
+  std::string sgKey1(m_sgKeyPrefix+"DiEleMass");
+  if (evtStore()->contains< float >(sgKey1)) {
+    ATH_MSG_ERROR("StoreGate key " << sgKey1 << "already exists.");
+    return StatusCode::FAILURE;
+  }
+  CHECK(evtStore()->record(diEleMass, sgKey1));
+
+  std::string sgKey2(m_sgKeyPrefix+"ProbeEleEt");
+  if (evtStore()->contains< float >(sgKey2)) {
+    ATH_MSG_ERROR("StoreGate key " << sgKey2 << "already exists.");
+    return StatusCode::FAILURE;
+  }
+  CHECK(evtStore()->record(probeEleEt, sgKey2));
+
+  return StatusCode::SUCCESS;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::passTrigger(const std::vector<std::string>& triggers) const
+{
+  for (unsigned int i=0; i<triggers.size(); i++) {
+    if (m_trigDecisionTool->isPassed(triggers[i])) return true;
+  }
+  return false;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::checkTagElectron(const xAOD::Electron *ele) const
+{
+  if (!passElectronQuality(ele)) return false;
+  if (m_doTrigMatch) {
+    if (!passElectronTrigMatch(ele, m_trigNames)) return false;
+  }
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::checkCluster(const xAOD::CaloCluster *clu) const
+{
+  if (!passClusterQuality(clu)) return false;
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::checkEleClusPair(const xAOD::Electron *ele, const xAOD::CaloCluster *clu) const
+{
+  if (fabs(ele->p4().DeltaPhi(clu->p4())) > m_dPhiMax) return false;
+  float mass = (ele->p4()+clu->p4()).M();
+  if (mass < m_diEleMassLow) return false;
+  if (mass > m_diEleMassHigh) return false;
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::passElectronQuality(const xAOD::Electron *ele) const
+{
+  if (ele->pt() < m_electronPtCut) return false;
+  if (fabs(ele->eta()) > m_electronEtaMax) return false;
+  bool passID(false);
+  for (unsigned int i=0; i<m_electronIDKeys.size(); i++) {
+    if (ele->passSelection(passID, m_electronIDKeys[i])) {
+      if (passID) break;
+    } else {
+      ATH_MSG_WARNING("Cannot find the electron quality flag " << m_electronIDKeys[i]);
+    }
+  }
+  if (!passID) return false;
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZeeTagTool::passClusterQuality(const xAOD::CaloCluster *clu) const
+{
+  if (clu->et() < m_clusterEtCut) return false;
+  if (fabs(clu->eta()) > m_clusterEtaMax) return false;
+  return true;
+}
+
+
+// checking the muon trigger matching
+bool DerivationFramework::KinkTrkZeeTagTool::passElectronTrigMatch(const xAOD::Electron *ele, const std::vector<std::string>& triggers) const
+{
+  for (unsigned int i=0; i<triggers.size(); i++) {
+    if (m_trigMatchTool->chainPassedByObject<TrigMatch::TrigElectronEF, xAOD::Electron>(ele, triggers[i], m_trigMatchDeltaR)) return true;
+  }
+  return false;
+}
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZmumuTagTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZmumuTagTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..e3836323b8dd05f464d0b8792d89cb78f8b7f3cd
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/KinkTrkZmumuTagTool.cxx
@@ -0,0 +1,228 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// KinkTrkZmumuTagTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Author: Shimpei Yamamoto (shimpei.yamamoto@cern.ch)
+
+#include "LongLivedParticleDPDMaker/KinkTrkZmumuTagTool.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include "xAODMissingET/MissingETContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::KinkTrkZmumuTagTool::KinkTrkZmumuTagTool(const std::string& t,
+							    const std::string& n,
+							    const IInterface* p):
+  AthAlgTool(t, n, p),
+  m_trigDecisionTool("Trig::TrigDecisionTool"),
+  m_trigMatchTool("TrigMatchTool/TrigMatchTool"),
+  m_trigNames(std::vector<std::string>()),
+  m_trigMatchDeltaR(0.1),
+  m_muonSelectionTool("CP::MuonSelectionTool/MuonSelectionTool"),
+  m_muonSGKey("Muons"),
+  m_muonIDKeys(std::vector<std::string>()),
+  m_muonPtCut(0),
+  m_muonEtaMax(9999),
+  m_trackSGKey("MuonSpectrometerTracks"),
+  m_trackPtCut(0),
+  m_trackEtaMax(9999),
+  m_diMuonMassLow(50.),
+  m_diMuonMassHigh(-1),
+  m_dPhiMax(10),
+  m_doOppositeSignReq(false),
+  m_sgKeyPrefix("KinkTrk")
+{
+  declareInterface<DerivationFramework::IAugmentationTool>(this);
+  declareProperty("TriggerDecisionTool", m_trigDecisionTool);
+  declareProperty("TriggerMatchTool", m_trigMatchTool);
+  declareProperty("Triggers", m_trigNames);
+  declareProperty("TriggerMatchDeltaR", m_trigMatchDeltaR);
+  declareProperty("RequireTriggerMatch", m_doTrigMatch);
+  declareProperty("MuonContainerKey", m_muonSGKey);
+  declareProperty("MuonIDKeys", m_muonIDKeys);
+  declareProperty("MuonPtMin", m_muonPtCut);
+  declareProperty("MuonEtaMax", m_muonEtaMax);
+  declareProperty("TrackContainerKey", m_trackSGKey);
+  declareProperty("TrackPtMin", m_trackPtCut);
+  declareProperty("TrackEtaMax", m_trackEtaMax);
+  declareProperty("DiMuonMassLow", m_diMuonMassLow);
+  declareProperty("DiMuonMassHigh", m_diMuonMassHigh);
+  declareProperty("DeltaPhiMax", m_dPhiMax); 
+  declareProperty("RequireOppositeSign", m_doOppositeSignReq); 
+  declareProperty("StoreGateKeyPrefix", m_sgKeyPrefix);
+}
+  
+
+// Destructor
+DerivationFramework::KinkTrkZmumuTagTool::~KinkTrkZmumuTagTool() {
+}  
+
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::KinkTrkZmumuTagTool::initialize()
+{
+  ATH_MSG_VERBOSE("initialize() ...");
+
+  // trigger decision tool
+  if (m_trigNames.size()>0) {
+    if (m_trigDecisionTool.retrieve().isFailure()) {
+      ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
+      return StatusCode::FAILURE;
+    }
+    ATH_MSG_INFO("TriggerDecisionTool: " << m_trigDecisionTool);
+
+    if (m_trigMatchTool.empty()) {
+      ATH_MSG_FATAL("TrigMatchTool is not specified.");
+      return StatusCode::FAILURE;
+    }
+    CHECK(m_trigMatchTool.retrieve());
+    ATH_MSG_INFO("TrgMatchTool retrived successfully");
+  }
+
+  CHECK(m_muonSelectionTool.retrieve());
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode DerivationFramework::KinkTrkZmumuTagTool::finalize()
+{
+  ATH_MSG_VERBOSE("finalize() ...");
+  return StatusCode::SUCCESS;
+}
+
+
+
+// Augmentation
+StatusCode DerivationFramework::KinkTrkZmumuTagTool::addBranches() const
+{
+  std::vector<float> *diMuonTrkMass = new std::vector<float>();
+  std::vector<float> *probeMuPt = new std::vector<float>();
+  std::string sgKey1(m_sgKeyPrefix+"DiMuMass");
+  std::string sgKey2(m_sgKeyPrefix+"ProbeMuPt");
+
+  const xAOD::MuonContainer* muons(0);
+  ATH_CHECK(evtStore()->retrieve(muons, m_muonSGKey));	
+
+  const xAOD::TrackParticleContainer* mstracks(0);
+  ATH_CHECK(evtStore()->retrieve(mstracks, m_trackSGKey));
+
+  for (auto muon: *muons) {
+    if (!checkTagMuon(muon)) continue;
+    for (auto track: *mstracks) {
+      if (!checkMSTrack(track)) continue;
+      if (!checkMuonTrackPair(muon, track)) continue;
+      diMuonTrkMass->push_back((muon->p4()+track->p4()).M());
+      probeMuPt->push_back(track->pt());
+    }
+  }
+
+  // Writing to SG
+  if (evtStore()->contains< float >(sgKey1)) {
+    ATH_MSG_ERROR("StoreGate key " << sgKey1 << "already exists.");
+    return StatusCode::FAILURE;
+  }
+  CHECK(evtStore()->record(diMuonTrkMass, sgKey1));
+
+  if (evtStore()->contains< float >(sgKey2)) {
+    ATH_MSG_ERROR("StoreGate key " << sgKey2 << "already exists.");
+    return StatusCode::FAILURE;
+  }
+  CHECK(evtStore()->record(probeMuPt, sgKey2));
+
+  return StatusCode::SUCCESS;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::passTrigger(const std::vector<std::string>& triggers) const
+{
+  for (unsigned int i=0; i<triggers.size(); i++) {
+    if (m_trigDecisionTool->isPassed(triggers[i])) return true;
+  }
+  return false;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::checkTagMuon(const xAOD::Muon *muon) const
+{
+  if (!passMuonQuality(muon)) return false;
+  if (m_doTrigMatch) {
+    if (!passMuonTrigMatch(muon, m_trigNames)) return false;
+  }
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::checkMSTrack(const xAOD::TrackParticle *track) const
+{
+  if (!passMSTrackQuality(track)) return false;
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::checkMuonTrackPair(const xAOD::Muon *muon, const xAOD::TrackParticle *track) const
+{
+  if (fabs(muon->p4().DeltaPhi(track->p4())) > m_dPhiMax) return false;
+  if (m_doOppositeSignReq) {
+    if (muon->charge()*track->charge() > 0) return false;
+  }
+  float mass = (muon->p4()+track->p4()).M();
+  if (mass < m_diMuonMassLow) return false;
+  if (mass > m_diMuonMassHigh) return false;
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::passMuonQuality(const xAOD::Muon *muon) const
+{
+  if (muon->pt() < m_muonPtCut) return false;
+  if (fabs(muon->eta()) > m_muonEtaMax) return false;
+
+  bool passID(false);
+  for (unsigned int i=0; i<m_muonIDKeys.size(); i++) {
+    int qflag(0);
+    if (m_muonIDKeys[i] == "VeryLoose") {
+      qflag = xAOD::Muon::VeryLoose;
+    } else if (m_muonIDKeys[i] == "Loose") {
+      qflag = xAOD::Muon::Loose;
+    } else if (m_muonIDKeys[i] == "Medium" ) {
+      qflag = xAOD::Muon::Medium;
+    } else if (m_muonIDKeys[i] == "Tight") { 
+      qflag = xAOD::Muon::Tight;
+    } else {
+      ATH_MSG_WARNING("Cannot find the muon quality flag " << m_muonIDKeys[i] << ". Use Medium instead.");
+      qflag = xAOD::Muon::Medium;
+    }
+
+    if ( m_muonSelectionTool->getQuality(*muon) <= qflag ) {
+      passID = true;
+      break;
+    }
+  }
+  if (!passID) return false;
+
+  return true;
+}
+
+
+bool DerivationFramework::KinkTrkZmumuTagTool::passMSTrackQuality(const xAOD::TrackParticle *track) const
+{
+  if (track->pt() < m_trackPtCut) return false;
+  if (fabs(track->eta()) > m_trackEtaMax) return false;
+  return true;
+}
+
+
+// checking the muon trigger matching
+bool DerivationFramework::KinkTrkZmumuTagTool::passMuonTrigMatch(const xAOD::Muon *muon, const std::vector<std::string>& triggers) const
+{
+  for (unsigned int i=0; i<triggers.size(); i++) {
+    if (m_trigMatchTool->chainPassedByObject<TrigMatch::TrigMuonEF, xAOD::Muon>(muon, triggers[i], m_trigMatchDeltaR)) return true;
+  }
+  return false;
+}
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvEgammaIDTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvEgammaIDTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..ae461d7949a843fbb172b542194f12fc560246f6
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvEgammaIDTool.cxx
@@ -0,0 +1,103 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// RpvEgammaIDTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Straight copy of DerivationFrameworkEGamma/EGammaPassSelectionWrapper.cxx
+// because DerivationFrameworkEGamma is not in AtlasProduction
+// From DerivationFrameworkEGamma/EGammaPassSelectionWrapper.cxx:
+// Author: James Catmore (James.Catmore@cern.ch)
+// Wrapper around the passSelection() method of xAOD egamma
+// Writes result to SG for later selection by string parser
+
+#include "LongLivedParticleDPDMaker/RpvEgammaIDTool.h"
+#include "xAODEgamma/EgammaContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::RpvEgammaIDTool::RpvEgammaIDTool( const std::string& t,
+						       const std::string& n,
+						       const IInterface* p ) :
+  AthAlgTool(t,n,p),
+  m_collName("ElectronCollection"),
+  m_sgPrefix("")
+  {
+    declareInterface<DerivationFramework::IAugmentationTool>(this);
+    declareProperty("SelectionVariables",m_qualFlags);
+    declareProperty("CollectionName", m_collName);
+    declareProperty("SGPrefix", m_sgPrefix);
+  }
+ 
+// Destructor
+DerivationFramework::RpvEgammaIDTool::~RpvEgammaIDTool() {
+}
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::RpvEgammaIDTool::initialize()
+{
+     if (m_qualFlags.size()==0) {
+        ATH_MSG_ERROR("No selection variables for the egamma passSelection wrapper tool!");
+        return StatusCode::FAILURE;
+     }
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::RpvEgammaIDTool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     return StatusCode::SUCCESS;
+}
+
+// Augmentation
+StatusCode DerivationFramework::RpvEgammaIDTool::addBranches() const
+{
+
+     // Retrieve data
+     const xAOD::EgammaContainer* egammas =  evtStore()->retrieve< const xAOD::EgammaContainer >( m_collName );
+     if( ! egammas ) {
+        ATH_MSG_ERROR("Couldn't retrieve e-gamma container with key: " << m_collName);
+        return StatusCode::FAILURE;
+     }
+       
+     // Make vectors for the cut results
+     std::vector<std::vector<int>* > allSelectionResults;
+     for (std::vector<std::string>::const_iterator strItr = m_qualFlags.begin(); strItr!=m_qualFlags.end(); ++strItr) {
+        std::vector<int> *passEgamma = new std::vector<int>(); 
+        allSelectionResults.push_back(passEgamma);
+     } 
+     // Loop over egammas, set decisions   
+     for (xAOD::EgammaContainer::const_iterator eIt = egammas->begin(); eIt!=egammas->end(); ++eIt) {
+        unsigned int itr(0);
+        for (std::vector<std::string>::const_iterator strItr = m_qualFlags.begin(); strItr!=m_qualFlags.end(); ++strItr, ++itr) {
+                bool val(0);
+                if ( (*eIt)->passSelection(val,*strItr) ) {
+                        if (val) {allSelectionResults[itr]->push_back(1);}
+                        else {allSelectionResults[itr]->push_back(0);}
+                } else {
+                        ATH_MSG_WARNING("Evident problem with quality flag " << *strItr << " so setting to false!");
+                        allSelectionResults[itr]->push_back(0);
+                }
+        }
+     }     
+
+     // Write decision to SG for access by downstream algs
+     unsigned int itr(0);
+     for (std::vector<std::string>::const_iterator strItr = m_qualFlags.begin(); strItr!=m_qualFlags.end(); ++strItr, ++itr) {
+        std::string sgKey("");
+        if (m_sgPrefix=="") {
+                sgKey = *strItr;
+        } else {
+                sgKey = m_sgPrefix+*strItr;
+        }   
+        if (evtStore()->contains<std::vector<int> >(sgKey)) {
+                ATH_MSG_ERROR("Tool is attempting to write a StoreGate key " << sgKey << " which already exists. Please use a different key");
+                return StatusCode::FAILURE;
+        }
+        CHECK(evtStore()->record(allSelectionResults[itr],sgKey));       
+     }
+     return StatusCode::SUCCESS;
+
+}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvElectronD0Tool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvElectronD0Tool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..005aaee78492498813b2a174d79172bb84934b57
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvElectronD0Tool.cxx
@@ -0,0 +1,83 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// RpvElectronD0Tool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Author: Mike Flowerdew (Michael.Flowerdew@cern.ch)
+// Tool to write lepton d0 in a way accessible by derivation framwork tools
+// Writes result to SG for later selection by string parser
+
+#include "LongLivedParticleDPDMaker/RpvElectronD0Tool.h"
+#include "xAODEgamma/ElectronContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::RpvElectronD0Tool::RpvElectronD0Tool( const std::string& t,
+							   const std::string& n,
+							   const IInterface* p ) :
+  AthAlgTool(t,n,p),
+  m_collName("Electrons"),
+  m_sgPrefix("")
+  {
+    declareInterface<DerivationFramework::IAugmentationTool>(this);
+    declareProperty("CollectionName", m_collName);
+    declareProperty("SGPrefix", m_sgPrefix);
+  }
+ 
+// Destructor
+DerivationFramework::RpvElectronD0Tool::~RpvElectronD0Tool() {
+} 
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::RpvElectronD0Tool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::RpvElectronD0Tool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     return StatusCode::SUCCESS;
+}
+
+// Augmentation
+StatusCode DerivationFramework::RpvElectronD0Tool::addBranches() const
+{
+
+     // Retrieve data
+     const xAOD::ElectronContainer* electrons =  evtStore()->retrieve< const xAOD::ElectronContainer >( m_collName );
+     if( ! electrons ) {
+	ATH_MSG_ERROR("Couldn't retrieve e-gamma container with key: " << m_collName);
+	return StatusCode::FAILURE;
+     }
+	
+     // Make a vector for the cut results
+     std::vector<float>* d0vec = new std::vector<float>();
+
+     // Loop over electrons, set decisions
+     for (xAOD::ElectronContainer::const_iterator eIt = electrons->begin(); eIt!=electrons->end(); ++eIt) {
+       
+       float d0 = 9e99;
+       if (*eIt && (*eIt)->trackParticle()) d0 = (*eIt)->trackParticle()->d0();
+       else ATH_MSG_WARNING("Problem accessing electron track!");
+       
+       d0vec->push_back(d0);
+     
+     }     
+
+     // Write decision to SG for access by downstream algs 
+     std::string sgKey(m_sgPrefix+"D0");
+
+     if (evtStore()->contains<std::vector<float> >(sgKey)) {
+       ATH_MSG_ERROR("Tool is attempting to write a StoreGate key " << sgKey << " which already exists. Please use a different key");
+       return StatusCode::FAILURE;
+     }
+     CHECK(evtStore()->record(d0vec, sgKey));       
+     
+     return StatusCode::SUCCESS;
+
+}
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonD0Tool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonD0Tool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..2e313ace8ba4e337cc2f9d851e3cb45a87d8bd1b
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonD0Tool.cxx
@@ -0,0 +1,100 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// RpvMuonD0Tool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Author: Mike Flowerdew (Michael.Flowerdew@cern.ch)
+// Tool to write lepton d0 in a way accessible by derivation framwork tools
+// Writes result to SG for later selection by string parser
+
+#include "LongLivedParticleDPDMaker/RpvMuonD0Tool.h"
+#include "xAODMuon/MuonContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::RpvMuonD0Tool::RpvMuonD0Tool( const std::string& t,
+						   const std::string& n,
+						   const IInterface* p ) :
+  AthAlgTool(t,n,p),
+  m_collName("Muons"),
+  m_sgPrefix("")
+  {
+    declareInterface<DerivationFramework::IAugmentationTool>(this);
+    declareProperty("CollectionName", m_collName);
+    declareProperty("SGPrefix", m_sgPrefix);
+  }
+ 
+// Destructor
+DerivationFramework::RpvMuonD0Tool::~RpvMuonD0Tool() {
+} 
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::RpvMuonD0Tool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::RpvMuonD0Tool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     return StatusCode::SUCCESS;
+}
+
+// Augmentation
+StatusCode DerivationFramework::RpvMuonD0Tool::addBranches() const
+{
+
+     // Retrieve data
+     const xAOD::MuonContainer* muons =  evtStore()->retrieve< const xAOD::MuonContainer >( m_collName );
+     if( ! muons ) {
+	ATH_MSG_ERROR("Couldn't retrieve muon container with key: " << m_collName);
+	return StatusCode::FAILURE;
+     }
+	
+     // Make a vector for the cut results
+     std::vector<float>* d0vec = new std::vector<float>();
+     std::vector<int>* isCombinedVec = new std::vector<int>();
+
+     // Loop over muons, set decisions
+     for (xAOD::MuonContainer::const_iterator muIt = muons->begin(); muIt!=muons->end(); ++muIt) {
+       
+       float d0 = 9e99;
+       // Alternative: (*muIt)->trackParticle( xAOD::Muon::InnerDetectorTrackParticle ) ?
+       if (*muIt && (*muIt)->primaryTrackParticle()) d0 = (*muIt)->primaryTrackParticle()->d0();
+       else ATH_MSG_WARNING("Problem accessing muon track!");
+       
+       d0vec->push_back(d0);
+       //// is it a combined muon?
+       if ((*muIt)->muonType()==xAOD::Muon::Combined) isCombinedVec->push_back(1);
+       else isCombinedVec->push_back(0);
+       
+
+     }     
+
+     // Write decision to SG for access by downstream algs 
+     std::string sgKey(m_sgPrefix+"D0");
+
+     if (evtStore()->contains<std::vector<float> >(sgKey)) {
+       ATH_MSG_ERROR("Tool is attempting to write a StoreGate key " << sgKey << " which already exists. Please use a different key");
+       return StatusCode::FAILURE;
+     }
+     CHECK(evtStore()->record(d0vec, sgKey)); 
+
+     sgKey = m_sgPrefix+"isCombined";
+
+     if (evtStore()->contains<std::vector<int> >(sgKey)) {
+       ATH_MSG_ERROR("Tool is attempting to write a StoreGate key " << sgKey << " which already exists. Please use a different key");
+       return StatusCode::FAILURE;
+     }
+     CHECK(evtStore()->record(isCombinedVec, sgKey));       
+
+     
+
+     
+     return StatusCode::SUCCESS;
+
+}
+
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonMSTool.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonMSTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..e0c29a34b5de235091a72964acf1264d7b96c9a2
--- /dev/null
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/RpvMuonMSTool.cxx
@@ -0,0 +1,76 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+///////////////////////////////////////////////////////////////////
+// RpvMuonMSTool.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+// Authors: Mike Flowerdew (Michael.Flowerdew@cern.ch), Dominik Krauss (dominik.krauss@cern.ch)
+// Augments a muon with a flag whether it has MS track
+// Writes result to SG for later selection by string parser
+
+#include "LongLivedParticleDPDMaker/RpvMuonMSTool.h"
+#include "xAODMuon/MuonContainer.h"
+#include <vector>
+#include <string>
+
+// Constructor
+DerivationFramework::RpvMuonMSTool::RpvMuonMSTool( const std::string& t,
+						   const std::string& n,
+						   const IInterface* p ) :
+  AthAlgTool(t,n,p),
+  m_collName("Muons"),
+  m_sgPrefix("")
+  {
+    declareInterface<DerivationFramework::IAugmentationTool>(this);
+    declareProperty("CollectionName", m_collName);
+    declareProperty("SGPrefix", m_sgPrefix);
+  }
+ 
+// Destructor
+DerivationFramework::RpvMuonMSTool::~RpvMuonMSTool() {
+} 
+
+// Athena initialize and finalize
+StatusCode DerivationFramework::RpvMuonMSTool::initialize()
+{
+     ATH_MSG_VERBOSE("initialize() ...");
+     return StatusCode::SUCCESS;
+}
+StatusCode DerivationFramework::RpvMuonMSTool::finalize()
+{
+     ATH_MSG_VERBOSE("finalize() ...");
+     return StatusCode::SUCCESS;
+}
+
+// Augmentation
+StatusCode DerivationFramework::RpvMuonMSTool::addBranches() const
+{
+     // Retrieve data
+     const xAOD::MuonContainer* muons = evtStore()->retrieve<const xAOD::MuonContainer>(m_collName);
+     if(!muons) {
+	ATH_MSG_ERROR("Couldn't retrieve muon container with key: " << m_collName);
+	return StatusCode::FAILURE;
+     }
+	
+     // Make a vector for the cut results
+     std::vector<int>* isMSVec = new std::vector<int>();
+
+     // Loop over muons, set decisions
+     for (xAOD::MuonContainer::const_iterator muIt = muons->begin(); muIt != muons->end(); ++muIt) {
+       // has it a MS track?
+       if ((*muIt)->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle) != NULL) isMSVec->push_back(1);
+       else isMSVec->push_back(0);
+     }     
+
+     // Write decision to SG for access by downstream algs 
+     std::string sgKey = m_sgPrefix + "isMS";
+
+     if (evtStore()->contains<std::vector<int> >(sgKey)) {
+       ATH_MSG_ERROR("Tool is attempting to write a StoreGate key " << sgKey << " which already exists. Please use a different key");
+       return StatusCode::FAILURE;
+     }
+     CHECK(evtStore()->record(isMSVec, sgKey));
+     
+     return StatusCode::SUCCESS;
+}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/StealthFilterAlg.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/StealthFilterAlg.cxx
deleted file mode 100644
index 846dc105b8ee3d12bde6e8dd60347087df513537..0000000000000000000000000000000000000000
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/StealthFilterAlg.cxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LongLivedParticleDPDMaker/StealthFilterAlg.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventType.h"
-#include "EventInfo/TriggerInfo.h"
-#include "EventPrimitives/EventPrimitivesHelpers.h"
-#include "EventPrimitives/EventPrimitives.h"
-
-#include "Particle/TrackParticle.h"
-#include "Particle/TrackParticleContainer.h"
-
-/// Standard Service Constructor
-StealthFilterAlg::StealthFilterAlg(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthFilterAlgorithm(name, pSvcLocator), 
-    m_nProcessed(0),
-    m_nEventsPassAll(0)
-	
-{
-  declareProperty("TrackParticleContainer", m_trackParticleContainerName = "TrackParticleCandidate");
-  declareProperty("cutMinTrackSd0", m_cutMinTrackSd0 = 15.);
-  declareProperty("cutMinTrackpT", m_cutMinTrackpT = 2000.);
-  declareProperty("cutMinTrackEta", m_cutMinTrackEta = 2.5);
-  declareProperty("cutMinNTracks", m_cutMinNTracks = 30);
-  declareProperty("passAll", m_passAll = false); 
-}
-
-/// Destructor
-StealthFilterAlg::~StealthFilterAlg() {}
-
-/// Gaudi Service Interface method implementations:
-StatusCode StealthFilterAlg::initialize()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-
-  msg(MSG::INFO) << "==> initialize ..." << name() << endreq;
-  msg(MSG::INFO)<< "******* StealthFilterAlg"<< name() <<" Configuration **********" << endreq;  
-  msg(MSG::INFO)<<"cutMinTrackSd0         "<<         m_cutMinTrackSd0        <<endreq;
-  msg(MSG::INFO)<<"cutMinNTracks          "<<         m_cutMinNTracks        <<endreq;
-  msg(MSG::INFO)<<"cutMinTrackpT          "<<         m_cutMinTrackpT        <<endreq;
-  msg(MSG::INFO)<<"cutMinTrackEta         "<<         m_cutMinTrackEta        <<endreq;
-  msg(MSG::INFO)<<"passAll                "<<            m_passAll           <<endreq;
-
-  return sc;
-}
-
-StatusCode StealthFilterAlg::execute()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-
-  m_nProcessed += 1;
-  
-  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "==> execute " << name() << " on " << m_nProcessed << " event..." << endreq;
-
-  //If passAll is selected, accept all events
-  if(m_passAll){
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << name() << " event passed because passAll is true" << endreq;
-    setFilterPassed(true);
-    return sc;
-  }
-  bool passCut = false;
-
-  //Load tracks
-  const Rec::TrackParticleContainer* trackTES1=0;
-   sc=evtStore()->retrieve( trackTES1, m_trackParticleContainerName);
-   if( sc.isFailure() ) {
-     msg(MSG::FATAL) << "Fatal error retrieving TrackParticleContainer " << m_trackParticleContainerName << endreq;
-     return sc;
-   }
-   if ( !trackTES1 ) {
-     msg(MSG::ERROR) << "No TrackParticle container " << m_trackParticleContainerName << " found" << endreq;
-     return StatusCode::SUCCESS;
-   }  
-   if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TrackParticleContainer successfully retrieved" << endreq;
-
-   Rec::TrackParticleContainer::const_iterator trackItr1  = trackTES1->begin();
-   Rec::TrackParticleContainer::const_iterator trackItrE1 = trackTES1->end();
-
-   int nTracksPassed=0;
-  //Iterate over all tracks in event  
-  for(unsigned int i=0; trackItr1 != trackItrE1; ++ trackItr1,++i) {
-
-    const Trk::TrackSummary *summary = (*trackItr1)->trackSummary();
-    
-    if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "AACC summary pointer track particle " << summary << endreq;
-
-    if( !summary ) continue;
-
-    float theta = (*trackItr1)->measuredPerigee()->parameters()[Trk::theta];
-    float qOverPt = (*trackItr1)->measuredPerigee()->parameters()[Trk::qOverP]/sin(theta);
-    float pT = (1/qOverPt);
-	float eta = -1.0*log(tan(0.5*theta));
-    float ApT = fabs(pT);
-	float Aeta = fabs(eta);
-	   
-	float track_d0 = (*trackItr1)->measuredPerigee()->parameters()[Trk::d0];
-	const AmgSymMatrix(5)* cov=(*trackItr1)->measuredPerigee()->covariance();
-	double err_d0 = Amg::error(*cov,Trk::d0);
-
-	//see if track passes cuts
-	 if(Aeta < m_cutMinTrackEta && ApT > m_cutMinTrackpT){	
-		float track_Sd0 = track_d0/err_d0;
-		if(fabs(track_Sd0) > m_cutMinTrackSd0) nTracksPassed++;
-	 }
-	}
-
-		////
-  
-  if(nTracksPassed > m_cutMinNTracks) passCut = true;
-  
-  if (passCut) {
-    setFilterPassed(true);
-    m_nEventsPassAll++;
-  }
-  else setFilterPassed(false);
-
-  return sc;  
-}
-
-StatusCode StealthFilterAlg::finalize()
-{
-  // Declare the simple StatusCode
-  StatusCode sc(StatusCode::SUCCESS);
-  
-  // Calculate the efficiencies and their errors
-  
-  // Efficiencies
-  double effiPassedAll  = m_nProcessed > 0 ? m_nEventsPassAll / (1.0*m_nProcessed) : 0.0;
-  
-  // Error on efficiencies
-  
-  double rootn = m_nProcessed > 0 ? sqrt((double)m_nProcessed) : 0.0;
-  double effiErrPassedAll = (rootn > 0 && effiPassedAll >= 0.0 && effiPassedAll <= 1.0)? sqrt(effiPassedAll*(1.0-effiPassedAll)) / rootn : 0.0;
-  
-  effiPassedAll *= 100.0;
-  effiErrPassedAll *= 100.0;
-
-  
-  if (msgLvl(MSG::INFO)) {
-    msg(MSG::INFO) << "==> finalize " << name() << endreq;
-    msg(MSG::INFO) << "***************************************************************" << endreq;
-    msg(MSG::INFO) << "Cut-flow table of " << name() << " skimming algorithm:" << endreq;
-    msg(MSG::INFO) << "-------------" << endreq;
-    msg(MSG::INFO) << " Number of processed events: " << m_nProcessed << endreq;
-    msg(MSG::INFO) << " Events passed all cuts:  " << m_nEventsPassAll << " and resulting efficiency = (" << effiPassedAll << "+/-" << effiErrPassedAll << ")" << endreq;
-    msg(MSG::INFO) << "***************************************************************" << endreq;
-  }
-
-  return sc;  
-}
diff --git a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/components/LongLivedParticleDPDMaker_entries.cxx b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/components/LongLivedParticleDPDMaker_entries.cxx
index 3453f3e413d3296527cb126d96b7608cd5980130..b3601ee1b37b2ab6edc537d651bce1a0ebefd8c7 100644
--- a/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/components/LongLivedParticleDPDMaker_entries.cxx
+++ b/PhysicsAnalysis/SUSYPhys/LongLivedParticleDPDMaker/src/components/LongLivedParticleDPDMaker_entries.cxx
@@ -1,25 +1,41 @@
 #include "GaudiKernel/DeclareFactoryEntries.h"
 
-#include "LongLivedParticleDPDMaker/HIPsFilterAlg.h"
-#include "LongLivedParticleDPDMaker/DVFilterAlg.h"
-#include "LongLivedParticleDPDMaker/DVFilterAlgEgamma.h"
-#include "LongLivedParticleDPDMaker/DVFilterAlgDiElectron.h"
-#include "LongLivedParticleDPDMaker/RPVLLTestRates.h"
-#include "LongLivedParticleDPDMaker/StealthFilterAlg.h"
+#include "LongLivedParticleDPDMaker/RpvElectronD0Tool.h"
+#include "LongLivedParticleDPDMaker/RpvMuonD0Tool.h"
+#include "LongLivedParticleDPDMaker/RpvMuonMSTool.h"
+#include "LongLivedParticleDPDMaker/RpvEgammaIDTool.h"
+#include "LongLivedParticleDPDMaker/HnlSkimmingTool.h"
+#include "LongLivedParticleDPDMaker/DVMissingETFilterTool.h"
+#include "LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h"
+#include "LongLivedParticleDPDMaker/DVMeffFilterTool.h"
+#include "LongLivedParticleDPDMaker/KinkTrkSingleJetMetFilterTool.h"
+#include "LongLivedParticleDPDMaker/KinkTrkZmumuTagTool.h"
+#include "LongLivedParticleDPDMaker/KinkTrkZeeTagTool.h"
 
-DECLARE_ALGORITHM_FACTORY( HIPsFilterAlg )
-DECLARE_ALGORITHM_FACTORY( DVFilterAlg )
-DECLARE_ALGORITHM_FACTORY( DVFilterAlgEgamma )
-DECLARE_ALGORITHM_FACTORY( DVFilterAlgDiElectron )
-DECLARE_ALGORITHM_FACTORY( RPVLLTestRates )
-DECLARE_ALGORITHM_FACTORY( StealthFilterAlg )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, RpvElectronD0Tool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, RpvMuonD0Tool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, RpvMuonMSTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, RpvEgammaIDTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, HnlSkimmingTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, DVMissingETFilterTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, DVMeffFilterTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, DVTracklessJetFilterTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, KinkTrkSingleJetMetFilterTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, KinkTrkZmumuTagTool )
+DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework, KinkTrkZeeTagTool )
 
 DECLARE_FACTORY_ENTRIES( LongLivedParticleDPDMaker ) {
-  DECLARE_ALGORITHM( HIPsFilterAlg  );
-  DECLARE_ALGORITHM( DVFilterAlg  );
-  DECLARE_ALGORITHM( DVFilterAlgEgamma  );
-  DECLARE_ALGORITHM( DVFilterAlgDiElectron  );
-  DECLARE_ALGORITHM( RPVLLTestRates  );
-  DECLARE_ALGORITHM( StealthFilterAlg  );
+
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, RpvElectronD0Tool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, RpvMuonD0Tool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, RpvMuonMSTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, RpvEgammaIDTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, HnlSkimmingTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, DVMissingETFilterTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, DVMeffFilterTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, DVTracklessJetFilterTool  );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, KinkTrkSingleJetMetFilterTool );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, KinkTrkZmumuTagTool );
+  DECLARE_NAMESPACE_TOOL( DerivationFramework, KinkTrkZmeeagTool );
 }